Skip to content
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

[Batch 2] Notebook PR Ports. #97

Merged
merged 9 commits into from
Sep 25, 2019
Merged

Conversation

starcruiseromega and others added 9 commits September 25, 2019 14:14
`exporter_map` is deprecated, so let's use the list of exporters fetched
from the installed entrypoints.

There's a supposed attribute `export_from_notebook` that should be set
to a friendly string name if the exporter should be exposed in the
front-end. However, the exporters defined in `nbconvert` don't have it
set, so I haven't used it to determine inclusion in the list. Instead,
I've used the entrypoint name as the friendly name, which looks like it
was the intention from the way they are named.

I ran the unit tests and tried starting up the notebook server and
accessing the API endpoint to verify the JSON looked correct.
Although I'm unable to reproduce the issue, its a safe change to
prevent an AttributeError from occuring ('NoneType' object has no
attribute 'close').  The user that reported this is attempting to
launch a kernel and I believe the launch only partially completed
such that `kernel._activity_stream` did not get established.
(This occurred from Jupyter Enterprise Gateway where we deal with remote
kernel launches across resource-managed clusters, so things are a bit
more involved relative to kernel establishment.)
It's still (IMHO) unclear how the adaptation goes. Like does "adapting
to protocol X.Y.Z." mean the end-result is X.Y.Z or what you
got is X.Y.Z and it's X.Y.W after adaptation.
Then split the file into two files, one containing the metrics themselves, the other containing any function that have something to do with prometheus.

Finally, Added new metrics into the prometheus.metrics file that represent the number of running terminals and added the functionality for that metric to be recorded in the terminal.api_handlers file.
@kevin-bates kevin-bates merged commit 97a9611 into jupyter-server:master Sep 25, 2019
@kevin-bates
Copy link
Member

No cleanup necessary.

@@ -1,18 +1,5 @@
"""
Prometheus metrics exported by Jupyter Notebook Server
from ..prometheus.metrics import HTTP_REQUEST_DURATION_SECONDS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it really be a .. here?

@@ -0,0 +1,24 @@
from notebook.prometheus.metrics import HTTP_REQUEST_DURATION_SECONDS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notebook

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #98.

@@ -26,6 +26,8 @@
from jupyter_server._tz import utcnow, isoformat
from ipython_genutils.py3compat import getcwd

from notebook.prometheus.metrics import KERNEL_CURRENTLY_RUNNING_TOTAL
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notebook?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#98

@vidartf vidartf mentioned this pull request Sep 26, 2019
@Zsailer Zsailer deleted the batch-2 branch January 10, 2020 17:35
Zsailer pushed a commit to Zsailer/jupyter_server that referenced this pull request Nov 18, 2022
* make provisioner ip configurable

* bump version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants