-
Notifications
You must be signed in to change notification settings - Fork 309
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
Add prometheus metric with version information #1467
Conversation
Allows for collection of jupyter server version as a prometheus metric, and filtering of various other metrics based on server version. Builds on top of conventions in other servers that expose version (or build) info. For example, kubernetes puts out this metric: > kubernetes_build_info{build_date="2024-09-09T04:15:23Z", compiler="gc", > git_commit="fa081458abcdbbc3ddfc3f99546ae5ea45aece17", git_tree_state="clean", > git_version="v1.29.8-gke.1700", go_version="go1.22.5 X:boringcrypto", > instance="10.128.0.50:443", job="kubernetes-apiservers", major="1", minor="29", > platform="linux/amd64"} Most of these parameters are not particularly relevant to us, but version is. So this PR only adds version - future labels can be added as needed.
for more information, see https://pre-commit.ci
153eb3f
to
b3b9315
Compare
for more information, see https://pre-commit.ci
Not really sure why it's failing in nbclassic now, although I see nbclassic is doing some fun import schenanigens... |
let's see if we end up in a loop, kinda?
This was a nice debug :) Due to https://github.com/jupyter/nbclassic/blob/9ae4cb137ea46c9a29cdcf56032dae624f6ff8d8/nbclassic/shim_notebook.py#L72,
The |
I'm not actually sure how to proceed here though, because I'm not fully sure I understand why https://github.com/jupyter/nbclassic/blob/9ae4cb137ea46c9a29cdcf56032dae624f6ff8d8/nbclassic/shim_notebook.py is doing what it's doing. I think it's patching "notebook." things to point to things in jupyter_server, but then it means we can't actually import notebook things in jupyter_server anymore, right? Otherwise you'll end up with circular imports exactly like we are now... |
Oooooh, funkier! So |
20e8a5e
to
44c2481
Compare
cbf2013
to
bff1432
Compare
for more information, see https://pre-commit.ci
Quite funny, as we can't actually rely on version info to see if we're on notebook v6, because nbclassic shims version too it looks like :D |
5ac601a
to
40029a7
Compare
This commit caused the *notebook* downstream version check to fail, which makes sense? This reverts commit 40029a7.
06e5cf3
to
3a4ceca
Compare
for more information, see https://pre-commit.ci
I don't see where nbclassic shims notebook._version, but if I print out |
All tests pass! That was rewarding. |
codespell crampin my styl |
I love @yuvipanda PRs :) I'm really swamped this week, but will do my best to give this a solid review tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good @yuvipanda! Thank you!
jupyter_server.prometheus.metrics
when nbclassic shimsnotebook.prometheus
to be the same asjupyter_server.prometheus