dash-prometheus
PROMETHEUS FOR PLOTLY DASH
How often each Dash callback runs, and how long it takes.
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_prometheuspatchesdash.callbackat import time and raises ifdashis already loaded, rather than silently missing callbacks. - Only callbacks registered through
dash.callbackare measured;app.callbackand clientside callbacks are not. - A callback that raises is not counted: the counter and histogram record completed calls.
prometheus-clientis pinned to0.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
Metadata
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dash_prometheus-2026.9.1.tar.gz | 7.0 kB | With provenance | Details for dash_prometheus-2026.9.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dash_prometheus-2026.9.1-py3-none-any.whl | Python 3 | none | any | Details for dash_prometheus-2026.9.1-py3-none-any.whl |
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 logRelease 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 logSecurity for dash-prometheus 2026.9.1
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.
Attestation for dash_prometheus-2026.9.1.tar.gz
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 logA 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.