Commit 147b231
committed
Soft-deprecate /metrics endpoint
/metrics is where notebook server publishes prometheus metrics.
Currently, if nbresuse is installed, it's impossible to get
prometheus metrics out of running notebooks.
Just removing /metrics caused issues with third-party
code (#36) that depended
on the JSON API from the endpoint, and so was reverted.
Instead, we 'soft' deprecate that endpoint.
1. Re-add /api/metrics/v1 endpoint, with exact same semantics as
/metrics. This is enabled unconditionally.
2. /metrics is also enabled by default, but can be turned off with
a notebook config. This allows admins who need prometheus metrics
to turn it on.
3. The bundled notebook extension will read from /api/metrics/v1
endpoint, so for those users things will 'just work'.
The path to removing /metrics is:
1. Release this as 0.4.0 even though there aren't any breaking changes.
This makes it easier for code using legacy endpoints to simply pin
to nbresuse<0.4.0
2. Find third party users relying on /metrics, and simply change them
to use /api/metrics/v1 - should be a fairly simple change. They can
then be pin to nbresuse>=0.4.0
3. When we're sure enough packages have switched, we can release a 0.5.0
where /metrics is disabled by default, but enablable with a config.
4. Eventually, we can simply remove /metrics and the associated config.
Ref #361 parent de920c0 commit 147b231
3 files changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | | - | |
| 45 | + | |
40 | 46 | | |
| 47 | + | |
41 | 48 | | |
42 | 49 | | |
43 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
39 | 48 | | |
40 | 49 | | |
41 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
0 commit comments