You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/administrator/troubleshooting.md
+29Lines changed: 29 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -24,3 +24,32 @@ managing cost with JupyterHub, see {ref}`cost`.
24
24
Each Helm Chart is packaged with a specific version of JupyterHub (and
25
25
other software as well). See see the [Helm Chart repository](https://github.com/jupyterhub/helm-chart#release-notes)
26
26
for information about the versions of relevant software packages.
27
+
28
+
## Metrics scraping with prometheus or vmagent
29
+
30
+
Network policy needs to be modified in order for prometheus or vmagent to be able to reach the metrics endpoint. The recommended way is by setting [interNamespaceAccessLabels=accept](https://z2jh.jupyter.org/en/stable/resources/reference.html#hub-networkpolicy-internamespaceaccesslabels). This makes the hub pod's associated NetworkPolicy accept ingress from pods in other namespaces that have specific access labels.
31
+
32
+
```yaml
33
+
hub:
34
+
networkPolicy:
35
+
interNamespaceAccessLabels: accept
36
+
```
37
+
38
+
And then set [`prometheus.server.podLabels`](https://github.com/prometheus-community/helm-charts/blob/0c7bf42ac2265d13845ffe0c499d16e6b8cdedea/charts/prometheus/values.yaml#L554) to be `hub.jupyter.org/network-access-hub: "true"` to enable prometheus to reach the hub.
39
+
40
+
Alternatively you can also set an explicit ingress rule to allow the prometheus or vmagent pod to reach the hub pod to scrape metrics.
41
+
42
+
```yaml
43
+
hub:
44
+
networkPolicy:
45
+
ingress:
46
+
- from:
47
+
- namespaceSelector:
48
+
matchLabels:
49
+
# namespace where your prometheus or vmagent is running
50
+
name: <namespace>
51
+
- podSelector:
52
+
matchLabels:
53
+
# a valid selector for the pod that needs to reach jupyterhub
0 commit comments