I have followed the instructions to install The Littlest JupyterHub on my custom server, including SSL, and everything is working correctly.
In addition, I have installed Prometheus in said server, and I successfully added it as a data source in an external Grafana server using
Now, I was trying to leverage the JupyterHub Prometheus metrics that are advertised in the documentation, but so far I’ve been unsuccessful. The docs only give this hint:
Prometheus is a separate open source tool that can be configured to repeatedly poll JupyterHub’s
/metricsendpoint to parse and save its current state.
I inferred that I needed to add a new job to
/etc/prometheus/prometheus.yml, and this is what I tried:
scrape_configs: ... - job_name: jupyterhub scheme: https static_configs: - targets: ['localhost']
However, I still don’t see the
jupyterhub_* metrics showing up. I must be doing something wrong, but I’m not sure how to proceed.
targets: ['localhost']is clearly wrong - the machine has a SSL certificate for the domain I pointed to it, and therefore I don’t think it’s going to work. But how or where do I see Prometheus spitting errors because of it?
- I could point the target to the domain, like
targets: ['sub.domain.space'], but I’ll still get authentication errors. This post by @jason_anderson suggests a solution, but when I try
jupyterhub token $whatever, I get an error:
root@jupyterhub:~# /opt/tljh/hub/bin/jupyterhub token root [W 2022-11-19 15:34:01.462 JupyterHub app:1828] No admin users, admin interface will be unavailable. [W 2022-11-19 15:34:01.462 JupyterHub app:1829] Add any administrative users to `c.Authenticator.admin_users` in config. [I 2022-11-19 15:34:01.462 JupyterHub app:1858] Not using allowed_users. Any authenticated user will be allowed. No such user: root
No admin users does not make much sense to me, since I do have an admin user: