mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-16 22:43:00 +00:00
docs for metric prefix
This commit is contained in:
@@ -18,3 +18,17 @@ tool like [Grafana](https://grafana.com).
|
|||||||
|
|
||||||
/reference/metrics
|
/reference/metrics
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Customizing the metrics prefix
|
||||||
|
|
||||||
|
JupyterHub metrics all have a `jupyterhub_` prefix.
|
||||||
|
As of JupyterHub 5.0, this can be overridden with `$JUPYTERHUB_METRICS_PREFIX` environment variable
|
||||||
|
in the Hub's environment.
|
||||||
|
|
||||||
|
For example,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export JUPYTERHUB_METRICS_PREFIX=jupyterhub_prod
|
||||||
|
```
|
||||||
|
|
||||||
|
would result in the metric `jupyterhub_prod_active_users`, etc.
|
||||||
|
@@ -6,6 +6,8 @@ conventions for metrics & labels. We generally prefer naming them
|
|||||||
`<noun>_<verb>_<type_suffix>`. So a histogram that's tracking
|
`<noun>_<verb>_<type_suffix>`. So a histogram that's tracking
|
||||||
the duration (in seconds) of servers spawning would be called
|
the duration (in seconds) of servers spawning would be called
|
||||||
server_spawn_duration_seconds.
|
server_spawn_duration_seconds.
|
||||||
|
A namespace prefix is always added, so this metric is accessed as
|
||||||
|
`jupyterhub_server_spawn_duration_seconds` by default.
|
||||||
|
|
||||||
We also create an Enum for each 'status' type label in every metric
|
We also create an Enum for each 'status' type label in every metric
|
||||||
we collect. This is to make sure that the metrics exist regardless
|
we collect. This is to make sure that the metrics exist regardless
|
||||||
|
Reference in New Issue
Block a user