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
Release files for dash-prometheus 2026.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dash_prometheus-2026.9.0.tar.gz | 7.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dash_prometheus-2026.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.7 kB
Release files / dash_prometheus-2026.9.0.tar.gz
| Download URL | dash_prometheus-2026.9.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f55b6fc56dfd95f88e414f5b31d4c593e02fa6a059b376047179452f84a1c3e6
|
|
BLAKE2b-256 checksum How to use checksums |
115500d524026669727afa5ee79140f60efa973626a9f5229a9289cb7ba04580
|
| 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.0-py3-none-any.whl
| Download URL | dash_prometheus-2026.9.0-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f26d18c43d55d8bfb477a85270d4e0b0cb87381269683724239adf47fb5bd25
|
|
BLAKE2b-256 checksum How to use checksums |
8e5bcd7650dcc59a6652db257c6f007a8650249fc799577a40063daf3377f4d8
|
| 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