Skip to content

Commit 17c02f1

Browse files
authored
docs: Add config for z2jh (#42)
1 parent d9f9ccc commit 17c02f1

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ Once installed, the `jupyterhub-groups-exporter` service will interact with the
4141

4242
### Configuration
4343

44+
#### Exporter
45+
4446
The exporter supports the following argument options:
4547

4648
- `--port`: Port to listen on for the groups exporter. Default is `9090`.
@@ -53,9 +55,41 @@ The exporter supports the following argument options:
5355
- `--jupyterhub_metrics_prefix`: Prefix/namespace for the JupyterHub metrics for Prometheus. Default is `"jupyterhub"`.
5456
- `--log_level`: Logging level for the exporter service. Options are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`. Default is `"INFO"`.
5557

56-
### Exporting user group memberships to Prometheus
58+
#### JupyterHub
59+
60+
The [`jupyterhub-groups-exporter`](https://github.com/2i2c-org/jupyterhub-groups-exporter) project provides a [service](https://jupyterhub.readthedocs.io/en/latest/reference/services.html) that integrates with JupyterHub to export user group memberships as Prometheus metrics. This component is readily deployable as part of any JupyterHub instance, such as a standalone deployment or a [Zero to JupyterHub (z2jh)](https://z2jh.jupyter.org/en/stable/) deployment on Kubernetes.
5761

58-
The [`jupyterhub-groups-exporter`](https://github.com/2i2c-org/jupyterhub-groups-exporter) project provides a [service](https://jupyterhub.readthedocs.io/en/latest/reference/services.html) that integrates with JupyterHub to export user group memberships as Prometheus metrics. This component is readily deployable as part of any JupyterHub instance, such as a standalone deployment or a Zero to JupyterHub deployment on Kubernetes.
62+
To enable the `jupyterhub-groups-exporter` service in your JupyterHub deployment, you need to add the service configuration to your JupyterHub configuration through your z2jh chart values. Here is an example configuration:
63+
64+
```yaml
65+
jupyterhub:
66+
hub:
67+
services:
68+
jupyterhub-groups-exporter: {}
69+
loadRoles:
70+
jupyterhub-groups-exporter:
71+
services:
72+
- jupyterhub-groups-exporter
73+
scopes:
74+
- users
75+
- groups
76+
```
77+
78+
You may also need configure a few settings for your [authenticator](https://oauthenticator.readthedocs.io/en/latest/) to provide group information to the exporter service. Here is an example configuration for the `GitHubOAuthenticator`:
79+
80+
```yaml
81+
jupyterhub:
82+
hub:
83+
config:
84+
GitHubOAuthenticator:
85+
enable_auth_state: true
86+
manage_groups: true
87+
populate_teams_in_auth_state: true
88+
scope:
89+
- read:org
90+
```
91+
92+
### Exporting user group memberships to Prometheus
5993

6094
The exporter provides a [Gauge metric](https://prometheus.io/docs/concepts/metric_types/) called `jupyterhub_user_group_info`, which contain the following labels:
6195

docs/reference/configuration.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Configuration
22

3+
## Exporter
4+
35
The exporter supports the following argument options:
46

57
- `--port`: Port to listen on for the groups exporter. Default is `9090`.
@@ -11,3 +13,35 @@ The exporter supports the following argument options:
1113
- `--jupyterhub_namespace`: Kubernetes namespace where the JupyterHub is deployed. Default is fetched from the environment variable `NAMESPACE`.
1214
- `--jupyterhub_metrics_prefix`: Prefix/namespace for the JupyterHub metrics for Prometheus. Default is `"jupyterhub"`.
1315
- `--log_level`: Logging level for the exporter service. Options are `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`. Default is `"INFO"`.
16+
17+
## JupyterHub
18+
19+
To enable the `jupyterhub-groups-exporter` service in your JupyterHub deployment, you need to add the service configuration to your JupyterHub configuration through your [Zero To JupyterHub](https://z2jh.jupyter.org/en/stable/) (z2jh) chart values. Here is an example configuration:
20+
21+
```yaml
22+
jupyterhub:
23+
hub:
24+
services:
25+
jupyterhub-groups-exporter: {}
26+
loadRoles:
27+
jupyterhub-groups-exporter:
28+
services:
29+
- jupyterhub-groups-exporter
30+
scopes:
31+
- users
32+
- groups
33+
```
34+
35+
You may also need configure a few settings for your [authenticator](https://oauthenticator.readthedocs.io/en/latest/) to provide group information to the exporter service. Here is an example configuration for the `GitHubOAuthenticator`:
36+
37+
```yaml
38+
jupyterhub:
39+
hub:
40+
config:
41+
GitHubOAuthenticator:
42+
enable_auth_state: true
43+
manage_groups: true
44+
populate_teams_in_auth_state: true
45+
scope:
46+
- read:org
47+
```

0 commit comments

Comments
 (0)