jupyter_server icon indicating copy to clipboard operation
jupyter_server copied to clipboard

[Telemetry] Add basic telemetry to Jupyter server and begin emitting server events

Open kiendang opened this issue 4 years ago • 10 comments

original pr #233

This is for emitting server events. For client events using the eventlog endpoint see #501.

kiendang avatar Dec 17 '20 04:12 kiendang

Hi all, I was just curious if this is planned for a specific release / date? I noticed a few issues have been replaced by this one.

We are investigating adding telemetry event logging for certain actions, and it looks like this work covers use cases we would want to cover.

We're still planning how to approach our work, but we use the zero-to-jupyterhub-k8s for a deployment on AWS. We planned to do something to the effect of configure the event handler (like shown here: https://jupyter-telemetry.readthedocs.io/en/latest/pages/configure.html )

c.EventLog.handlers = [handler]

to use a CloudWatch or S3 EventLogger (as we're in AWS). e.g. https://pypi.org/project/cloudwatch/ (cloudwatch log handler).

Then we would import https://github.com/jupyterlab/jupyterlab-telemetry , and start injecting our events via our own extension (by subscribing to "signals", or customizing code as necessary).

Is that approach aligned with the work you're doing here? I assume we'd just start getting the additional events you're adding, once this code launches.

robertpyke avatar Feb 18 '21 06:02 robertpyke

Hi there's currently no specific release date for this but this is something that we've been actively working on and trying to get done as soon as we can. Could you elaborate more about your use cases? What events are you looking to record? These could potentially help us make better informed design decisions. Thanks!

kiendang avatar Feb 18 '21 10:02 kiendang

Hello! I work with @robertpyke and can speak to the details of this project. We are in the early stages and still nailing down specific requirements. But I can give a bit of context. We have a large user base on JupyterHub and are trying to get a better idea of usage patterns to inform our development. For instance, we'd like to know when people are using R kernel vs Python. When we have a better list I'll let you guys know.

tmlohman avatar Feb 18 '21 19:02 tmlohman

Our plan is to have telemetry events for Jupyterhub and Jupyter server REST APIs. Events for Jupyter server would be tracked under this PR while those for Jupyterhub would be under jupyterhub/jupyterhub#3218.

For instance, we'd like to know when people are using R kernel vs Python.

Starting a kernel would be one of those events being recorded, along with information on the user and kernel. That should work for your example use case?

When we have a better list I'll let you guys know.

Great!

Currently we are working on the telemetry backend itself. Once that is settled we will come back to adding telemetry events under these two aforementioned PRs.

kiendang avatar Feb 19 '21 07:02 kiendang

Codecov Report

Merging #364 (5703d94) into master (678878f) will increase coverage by 0.14%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #364      +/-   ##
==========================================
+ Coverage   77.73%   77.87%   +0.14%     
==========================================
  Files         106      107       +1     
  Lines        9288     9349      +61     
  Branches     1001     1007       +6     
==========================================
+ Hits         7220     7281      +61     
  Misses       1710     1710              
  Partials      358      358              
Impacted Files Coverage Δ
jupyter_server/base/handlers.py 63.91% <100.00%> (+0.22%) :arrow_up:
jupyter_server/pytest_plugin.py 92.14% <100.00%> (+0.43%) :arrow_up:
jupyter_server/serverapp.py 67.58% <100.00%> (+0.34%) :arrow_up:
jupyter_server/services/contents/handlers.py 84.93% <100.00%> (+0.76%) :arrow_up:
jupyter_server/tests/test_eventlog.py 100.00% <100.00%> (ø)
jupyter_server/utils.py 66.08% <100.00%> (+3.95%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 678878f...5703d94. Read the comment docs.

codecov-commenter avatar Apr 23 '21 13:04 codecov-commenter

This is now ready for review. Client event schema files are loaded using importlib.resources. The resource locations are exposed via entry points. I have added the details in the docs. Also included an example + tests in examples/client_event_example.

This depends on the changes in jupyter/telemetry#60. Currently I use my own branch here. Will update after a telemetry release.

kiendang avatar Apr 26 '21 10:04 kiendang

Thanks, @kiendang. I've added this to the Jupyter Server Team Meeting agenda for this week.

In the meantime, I'm going move this PR to "draft" state until we merge and release jupyter/telemetry#60.

Zsailer avatar Apr 27 '21 20:04 Zsailer

related jupyter/telemetry#61

kiendang avatar May 03 '21 16:05 kiendang

Is this still being worked on?

mlucool avatar Nov 30 '21 18:11 mlucool

@Zsailer sorry for not working on this for quite a while. I have been busy for the last year. I do have some free time now and would like to resume working on this and getting this merged.

The original todo list was

  • submit a PR for jupyter/telemetry#61
  • cut a new release for telemetry
  • merge this

Does that plan still look valid? anything new/changed regarding telemetry?

kiendang avatar Mar 24 '22 14:03 kiendang

This work has been superceded by #954 and #862.

Closing this PR in favor of the others.

Zsailer avatar Aug 29 '22 19:08 Zsailer