Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(prometheus): Document how to set up scraping in kubernetes #3616

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions docs/source/administrator/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,26 @@ managing cost with JupyterHub, see {ref}`cost`.
Each Helm Chart is packaged with a specific version of JupyterHub (and
other software as well). See see the [Helm Chart repository](https://github.com/jupyterhub/helm-chart#release-notes)
for information about the versions of relevant software packages.

## Metrics scraping with prometheus or vmagent

Network policy needs to be modified in order for prometheus or vmagent to be able to reach the metrics endpoint. Working example configuration is as follows:

```yaml
hub:
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: "/hub/metrics"
prometheus.io/port: "8081"
networkPolicy:
ingress:
- from:
- namespaceSelector:
matchLabels:
# namespace where your prometheus or vmagent is running
name: victoriametrics
- podSelector:
matchLabels:
# a valid selector for the pod that needs to reach jupyterhub
app.kubernetes.io/instance: vmagent
```
10 changes: 10 additions & 0 deletions jupyterhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ hub:
minAvailable: 1
networkPolicy:
enabled: true
# To open for vmagent to scrape metrics from the hub pod, add the following
# to the ingress list:
# ingress:
# - from:
# - namespaceSelector:
# matchLabels:
# name: victoriametrics
# - podSelector:
# matchLabels:
# app.kubernetes.io/instance: vmagent
ingress: []
egress: []
egressAllowRules:
Expand Down