Skip to main content
dash-prometheus icon

dash-prometheus

PROMETHEUS FOR PLOTLY DASH
How often each Dash callback runs, and how long it takes.

PyPI version Dash 2.9.3 or newer Python 3.10 or newer MIT license


dash-prometheus wraps every dash.callback in a counter and a duration histogram and serves them on a Prometheus endpoint mounted on the app's own server. No sidecar, no second port: one import and one call.

pip install dash-prometheus
import dash_prometheus  # must come before `import dash`
import dash

app = dash.Dash(__name__)
dash_prometheus.add_middleware(app)  # serves /metrics

add_middleware(app, slug="stats") serves /stats instead.

Metrics

Type Name Description Labels
Counter dash_callback_calls Number of calls to a Dash callback file, callback
Histogram dash_callback_duration Duration of a Dash callback, in seconds file, callback

file is the source file that defines the callback and callback is its function name. Histogram buckets are 1 ms, 10 ms, 100 ms, 1 s, 5 s, 10 s, 30 s, 1 min, 2 min and 5 min.

Multiple workers

Metrics use prometheus_client's multiprocess mode, so every gunicorn worker reports into one set of numbers. Set PROMETHEUS_MULTIPROC_DIR to choose the directory; without it, the package creates a fresh one under /tmp. Either way the directory is emptied on import, so point it at a path used for nothing else.

Known limits

  • Import order matters: dash_prometheus patches dash.callback at import time and raises if dash is already loaded, rather than silently missing callbacks.
  • Only callbacks registered through dash.callback are measured; app.callback and clientside callbacks are not.
  • A callback that raises is not counted: the counter and histogram record completed calls.
  • prometheus-client is pinned to 0.18.0.

Development

mise run setup     # cold start: toolchain, frozen deps, git hooks, verify
mise run check     # lint + format + tests: the definition of done

See AGENTS.md for the working agreement.

Releasing

Publishing runs from CI, not from a laptop: bump version in pyproject.toml, merge, then push a tag v<version>. .github/workflows/release.yml re-runs the full check, refuses a tag that disagrees with pyproject.toml, and publishes to PyPI with trusted publishing, so no API token is stored anywhere.

Licence

MIT

Release files for dash-prometheus 2026.9.1

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

Source distribution (sdist)

Source distribution for dash-prometheus 2026.9.1
File Size Uploaded
dash_prometheus-2026.9.1.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dash-prometheus 2026.9.1
File Interpreter ABI Platform
dash_prometheus-2026.9.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.7 kB

Release files / dash_prometheus-2026.9.1.tar.gz

Download URL dash_prometheus-2026.9.1.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ddac16f7f658c18c837d7a8a11e43d8d2898ae2f82b2331854cda3aa9d20cdff
BLAKE2b-256 checksum
How to use checksums
115c8c7751045b00159431076c307cc241dfc2769b7939b6be19fd407a60515e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / dash_prometheus-2026.9.1-py3-none-any.whl

Download URL dash_prometheus-2026.9.1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37e97f885c9ce4118529511eac982231059ad2468feecebbfff812023a1d1dc0
BLAKE2b-256 checksum
How to use checksums
0ef1b5056b8e9c5e45e69f1022e1f626e56649a865ed71c58ec1193388517d82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2026.9.1 This release

2 release files

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