This adds support for using the Jaeger distributed tracing tool with Jupyter.
Project description
jupyter-jaeger
This adds support for using the Jaeger distributed tracing tool with Jupyter. It facilitates the use case of tracking some process that starts in a kernel and is continued in a mime renderer.
We are using it to profile and debug ibis-vega-transform
which goes back and forth between the kernel and the frontend to interactively render charts with Altair.
Installing this adds two Jupyter server extensions that start up the jaeger-all-in-one
and jaeger-browser
processes when you launch Jupyter.
So to use it you must first instrument code in your kernel and/or in the frontend to record traces.
It also provis a NPM Typescript plugin you can use to access the client from inside a JupyterLab extension.
Requirements
- JupyterLab >= 3.0
Usage
# Install jaeger-all-in-one binary
conda install -c conda-forge jaeger
# Install this package
pip install jupyter-jaeger
# Optional, to see Jaeger icon in JupyterLab launcherr
jupyter labextension install jupyterlab-server-proxy-saulshanabrook
# Launch a Jupyter server
jupyter lab
# Open the jaeger UI
open http://localhost:8080/jaeger
Install
pip install jupyter-jaeger
Contributing
Development install
Note: You will need NodeJS to build the extension package.
The jlpm
command is JupyterLab's pinned version of
yarn that is installed with JupyterLab. You may use
yarn
or npm
in lieu of jlpm
below.
# Clone the repo to your local environment
# Change directory to the jupyter-jaeger directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build
You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab
With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
By default, the jlpm run build
command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
jupyter lab build --minimize=False
Uninstall
pip uninstall jupyter-jaeger
Example
This repo also includes an example of starting a trace from a kernel and continuing it in a mimeredenr jupyterlab extension,
in ./example
. You can try this example by:
- Launching the Binder for this repo.
- Create a launcher and launch the Jaeger UI
- Run the notebook.
- Inspect the trace created by the notebook execution.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file jupyter_jaeger-1.0.4.tar.gz
.
File metadata
- Download URL: jupyter_jaeger-1.0.4.tar.gz
- Upload date:
- Size: 61.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46628417163b28e67298af0f782d00e2f5e8d106a94785cca4cd454abc70e73d |
|
MD5 | a1c19b3699ff11ec10779f1b5116ff1f |
|
BLAKE2b-256 | 382940d51e1fb680be55042e99f516fbab6763eb413418186e3d23d803904997 |