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

Allow toggling auth for prometheus metrics #5870

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

yuvipanda
Copy link
Contributor

Equivalent to jupyterhub/jupyterhub#2224

Prometheus metrics can potentially leak information about
the user, so they should be kept behind auth by default.
However, for many JupyterHub deployments, they would need
to be scraped by a centralized Prometheus instance that can not
really authenticate separately to each user notebook without
a lot of work. Admins can use this setting to allow unauthenticated
access to the /metrics endpoint.

Equivalent to jupyterhub/jupyterhub#2224

Prometheus metrics can potentially leak information about
the user, so they should be kept behind auth by default.
However, for many JupyterHub deployments, they would need
to be scraped by a centralized Prometheus instance that can not
really authenticate separately to each user notebook without
a lot of work. Admins can use this setting to allow unauthenticated
access to the /metrics endpoint.
@yuvipanda
Copy link
Contributor Author

Happy to make an equivalent PR in jupyter_server repo as well - but would really love to see this land here :)

yuvipanda added a commit to yuvipanda/datahub-old-fork that referenced this pull request Nov 17, 2020
Brings in jupyter/notebook#5870,
working towards getting notebook request metrics into
prometheus.
Copy link
Member

@Zsailer Zsailer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Thanks, @yuvipanda.

@Zsailer Zsailer merged commit 5a73a8e into jupyter:master Nov 17, 2020
yuvipanda added a commit to yuvipanda/datahub-old-fork that referenced this pull request Nov 18, 2020
- /metrics now responds with prometheus metrics, rather than
  nbresuse metrics (jupyter-server/jupyter-resource-usage#68)
- Notebook Server's /metrics endpoint is now available without
  authentication, so prometheus can scrape those metrics
  (jupyter/notebook#5870)
- Annotations are set up on the user pods to tell prometheus the
  port and path to scrape.
- NetworkPolicy is set up to allow prometheus server to hit the
  singleuser server and the hub pods. Note that this required
  manually editing netpol in prometheus - should add that feature
  to the prometheus chart.
@blink1073 blink1073 added this to the 6.2 milestone Mar 18, 2021
yuvipanda added a commit to yuvipanda/datahub-old-fork that referenced this pull request Mar 19, 2021
jupyter/notebook#5870 has been
merged, and we weren't actually using it anyway.

Ref #2252
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants