Package: jupyterlab-pioneer
JupyterLab PioneerA JupyterLab extension for generating and exporting JupyterLab event telemetry data.Get startedRun the extension with docker compose# enter the configuration_examples directory and rundockercompose-pjupyterlab_pioneerup--buildA JupyterLab application with the extension installed and configured will run on localhost:8888.(To play with different exporter configurations, editDockerfileand run docker compose again)Or install the extension and configure it manuallyTo install the extension, execute:pipinstalljupyterlab_pioneerBefore starting Jupyter Lab, users need to write their own configuration files (or use the provided configuration examples) andplace them in the correct directory.Examples of configurations arehere.ConfigurationsOverviewThe configuration file controls the activated events and data exporters.To add a data exporter, users should assign a callable function along with function arguments when configuringexporters.This extension provides 5 default exporters.console_exporter, which sends telemetry data to the browser consolecommand_line_exporter, which sends telemetry data to the python console jupyter is running onfile_exporter, which saves telemetry data to local fileremote_exporter, which sends telemetry data to a remote http endpointopentelemetry_exporter, which sends telemetry data via otlp.Additionally, users can write customized exporters in the configuration file.Configuration file name & pathJupyter Server expects the configuration file to be named after the extension’s name like so:jupyter_{extension name defined in application.py}_config.py. So, the configuration file name for this extension isjupyter_jupyterlab_pioneer_config.py.Jupyter Server looks for an extension’s config file in a set of specific paths.The configuration file should be saved into one of the config directories provided byjupyter --path.Check jupyter serverdocfor more details.SyntaxactivateEvents: An array of active events. Each active event in the array should have the following structure:{'name':# string, event name'logWholeNotebook':# boolean, whether to export the entire notebook content when event is triggered}The extension would only generate and export data for valid event that has an id associated with the event class, and the event name is included inactiveEvents.
The extension will export the entire notebook content only for valid events when thelogWholeNotebookflag is True.exporters: An array of exporters. Each exporter in the array should have the following structure:{'type':# One of 'console_exporter', 'command_line_exporter',# 'file_exporter', 'remote_exporter',# or 'custom_exporter'.'args':# Optional. Arguments passed to the exporter function.# It needs to contain 'path' for file_exporter, 'url' for remote_exporter.'activeEvents':# Optional. Exporter's local activeEvents config will override global activeEvents config}ExampleDefault exportersall_exporters/jupyter_jupyterlab_pioneer_config.pyCustom exporter functioncustom_exporter/jupyter_jupyterlab_pioneer_config.pyUninstallTo remove the extension, execute:pipuninstalljupyterlab_pioneerTroubleshootIf you are seeing the frontend extension, but it is not working, check
that the server extension is enabled:jupyterserverextensionlistIf the server extension is installed and enabled, but you are not seeing
the frontend extension, check the frontend extension is installed:jupyterlabextensionlistContributingDevelopment install(Optional) create conda environment from the providedenvironment.ymlfilecondaenvcreate-fenvironment.ymlClone and build the extension packageNote: You will need NodeJS to build the extension package.Thejlpmcommand is JupyterLab's pinned version ofyarnthat is installed with JupyterLab. You may useyarnornpmin lieu ofjlpmbelow.# Clone the repo to your local environment# Change directory to the jupyterlab-pioneer directory# Install package in development modepipinstall-e"."# Link your development version of the extension with JupyterLabjupyterlabextensiondevelop.--overwrite# Server extension must be manually installed in develop modejupyterserverextensionenablejupyterlab_pioneer# Rebuild extension Typescript source after making changesjlpmbuildYou 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 neededjlpmwatch# Run JupyterLab in another terminaljupyterlabWith 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, thejlpm buildcommand 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:jupyterlabbuild--minimize=FalseDevelopment uninstall# Server extension must be manually disabled in develop modejupyterserverextensiondisablejupyterlab_pioneer
pipuninstalljupyterlab_pioneerIn development mode, you will also need to remove the symlink created byjupyter labextension developcommand. To find its location, you can runjupyter labextension listto figure out where thelabextensionsfolder is located. Then you can remove the symlink namedjupyterlab-pioneerwithin that folder.Packaging the extensionSeeRELEASEContributors ✨Thanks goes to these wonderful people (emoji key):Mengyan Wu💻🤔🚧📆🚇⚠️📖Christopher Brooks🤔📆🚇Steve Oney🤔📆Christopher Ostrouchov🤔💻Amit Kumar🚇This project follows theall-contributorsspecification. Contributions of any kind welcome!