Skip to main content

Managed Spark Cell Monitoring (managed-spark-cell-monitoring)

Managed Spark Cell Monitoring is a Jupyter kernel extension designed to monitor Apache Spark jobs directly from your notebook cells in real time.

Leveraging AnyWidget, it enables platform-agnostic, zero-installation frontend rendering across JupyterLab, Jupyter Classic, Colab Enterprise, and VS Code notebooks.


Key Features

  • 📊 Real-time Progress Tracking: Visual progress bars for active Apache Spark jobs and their tasks directly in notebook cells.
  • ⚡ AnyWidget Architecture: Precompiled ESM widgets rendered natively without requiring custom JupyterLab extension binaries.
  • ⏱️ Task Chart: Live chart of running and scheduled tasks against available executor cores.

Architecture Overview

  1. Scala Listener (scalalistener): Plugs into the Apache Spark driver's SparkListener bus to capture fine-grained task and stage metrics with lock-free queueing and delta-change metric caching.
  2. Python Kernel Extension (managed_spark_cell_monitoring.kernelextension): Intercepts cell execution hooks (pre_run_cell, post_run_cell) and routes telemetry events to active widget instances via Jupyter Comms.
  3. AnyWidget React Frontend (managed_spark_cell_monitoring/static/widget.js): Modular React 18 / MobX frontend compiled via esbuild, providing isolated UI components for the job table and task chart.

Installation & Usage

1. Installation

Install the pre-built package from PyPI (no Node.js, Yarn, Java, or SBT required on client machines):

pip install managed-spark-cell-monitoring

2. Enable in Notebook

In your IPython environment or notebook cell, load the kernel extension:

%load_ext managed_spark_cell_monitoring

Alternatively, configure it to load automatically in all notebook sessions by adding it to your IPython configuration (e.g. ~/.ipython/profile_default/ipython_kernel_config.py):

c.InteractiveShellApp.extensions.append('managed_spark_cell_monitoring')

3. Configure PySpark Session

Create your Apache Spark SparkSession with the extra configurations to activate the Scala Listener. Use managed_spark_cell_monitoring.get_jar_path(...) to automatically resolve the bundled listener JAR. Pass "3" for Apache Spark 3.5 or "4" for Apache Spark 4.x:

import managed_spark_cell_monitoring
from pyspark.sql import SparkSession

# Specify your target major Apache Spark version:
# • Pass "3" for Apache Spark 3.5 (e.g., Google Cloud Dataproc 2.2)
# • Pass "4" for Apache Spark 4.x
spark_major_version = "3"  # Change to "4" for Apache Spark 4.x clusters

# Automatically resolves the bundled listener JAR inside site-packages
jar_path = managed_spark_cell_monitoring.get_jar_path(spark_major_version)

spark = (
    SparkSession.builder
    .config(
        'spark.extraListeners',
        'managed_spark_cell_monitoring.listener.JupyterManagedSparkCellMonitoringListener',
    )
    .config('spark.driver.extraClassPath', jar_path)
    .getOrCreate()
)

Development & Building

Prerequisites

  • Node.js (>= 18.0) & Yarn
  • Java JDK (8, 11, or 17) & SBT
  • Python (>= 3.8)

Building from Source

1. React UI Frontend

The frontend uses React 18 and MobX, bundled via esbuild into standalone assets in managed_spark_cell_monitoring/static/.

# Install frontend dependencies
yarn --cwd js install

# Bundle frontend assets into static/widget.js and static/widget.css
yarn --cwd js build

# Run frontend tests and linter
yarn --cwd js test
yarn --cwd js lint

2. Scala Listener Fat JARs

The Scala listener is compiled using sbt and supports Apache Spark 3.5 (Scala 2.12) and Apache Spark 4.x (Scala 2.13). We use sbt-assembly to build shaded Fat JARs directly into managed_spark_cell_monitoring/static/listeners/.

# Run Scala unit tests
cd scala && sbt test && cd ..

# Build shaded Fat JARs for Apache Spark 3.5 and Apache Spark 4.x
cd scala && sbt assembly && cd ..

3. Python Kernel Package

Install in editable mode and run Python test suites:

# Install package in editable mode with test dependencies
pip install -e ".[test]"

# Run Python unit tests
pytest tests/

# Build distribution wheel (.whl) and source archive (.tar.gz)
python -m build

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.


Trademarks

Apache®, Apache Spark™, Spark™, and the Apache feather logo are either registered trademarks or trademarks of the Apache Software Foundation in the United States and/or other countries.

Metadata

Release files for managed-spark-cell-monitoring 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for managed-spark-cell-monitoring 1.0.2
File Size Uploaded Provenance Actions
managed_spark_cell_monitoring-1.0.2.tar.gz 52.0 MB With provenance Details for managed_spark_cell_monitoring-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for managed-spark-cell-monitoring 1.0.2
File Interpreter ABI Platform Actions
managed_spark_cell_monitoring-1.0.2-py3-none-any.whl Python 3 none any Details for managed_spark_cell_monitoring-1.0.2-py3-none-any.whl

Total release size: 58.5 MB

Release files / managed_spark_cell_monitoring-1.0.2.tar.gz

Download URL managed_spark_cell_monitoring-1.0.2.tar.gz
Size 52.0 MB
Tags Source
SHA-256 checksum
How to use checksums
6704b84692f7262674fd017fd9718fa8974d6681b370fd9ad92ab3288fb6f25f
BLAKE2b-256 checksum
How to use checksums
20d865df4ebaf1d44fd18b4cfa64a3050e3e467fe0947bc4f9ad63f295665dcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.11.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by Google Cloud, verified by PyPI on Nov 6, 2026.

Transparency log

Release files / managed_spark_cell_monitoring-1.0.2-py3-none-any.whl

Download URL managed_spark_cell_monitoring-1.0.2-py3-none-any.whl
Size 6.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
d856cd0bc639d42d6b3c42a9daa2877fa49d0030372df00de0ab63c9bbae2094
BLAKE2b-256 checksum
How to use checksums
c015f814cf7c41b03bab8b30fef75747fb6a6171a09e69cc896e6f82768ce56e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.2.0 CPython/3.11.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by Google Cloud, verified by PyPI on Nov 6, 2026.

Transparency log

Security for managed-spark-cell-monitoring 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for managed_spark_cell_monitoring-1.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by Google Cloud, verified by PyPI on Nov 6, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page