Snakemake Prometheus Logger Plugin
A Snakemake logger plugin that exposes workflow metrics via a Prometheus-compatible HTTP endpoint.
Installation
You can install this plugin via pip:
pip install snakemake-logger-plugin-prometheus
Or via Pixi/Conda if available in your channels.
Usage
To use this logger, run Snakemake with the --logger prometheus flag.
snakemake --logger prometheus ...
Pull Mode (Default)
By default, the metrics server runs on port 8000. Prometheus scrapes this address.
You can change the port using the --logger-prometheus-port flag:
snakemake --logger prometheus --logger-prometheus-port 9090 ...
Push Mode (Pushgateway)
If you cannot expose a port or prefer pushing metrics, specify a Pushgateway URL. The plugin will push metrics every 15 seconds.
snakemake --logger prometheus --logger-prometheus-push-gateway http://localhost:9091
You can optionally set the job name used in the Pushgateway (default: "snakemake"):
snakemake --logger prometheus --logger-prometheus-push-gateway http://localhost:9091 --logger-prometheus-push-job-name my-workflow
Available Metrics
Job Lifecycle
| Metric Name | Type | Labels | Description |
|---|---|---|---|
snakemake_jobs_submitted |
Gauge | rule |
Jobs known to the scheduler (Queued + Running). Increments when a job is ready, decrements when finished. |
snakemake_jobs_running |
Gauge | rule |
Jobs actively executing. Increments when execution starts, decrements when finished. |
snakemake_jobs_finished_total |
Counter | status (finished/failed), rule |
Cumulative count of completed jobs. Useful for throughput rates. |
snakemake_jobs_planned_total |
Gauge | rule |
Total jobs planned for the workflow. Updates dynamically if checkpoints trigger DAG re-evaluation. |
Resources
| Metric Name | Type | Labels | Description |
|---|---|---|---|
snakemake_resource_usage_total |
Gauge | resource |
Total resources currently consumed by Running jobs (e.g., threads, mem_mb). |
snakemake_resource_limits |
Gauge | resource |
Maximum resources available to the workflow (CLI limits or cluster capacity). |
Workflow Status
| Metric Name | Type | Labels | Description |
|---|---|---|---|
snakemake_workflow_progress |
Gauge | type (done/total) |
High-level progress counters. |
snakemake_errors_total |
Counter | None | Total number of workflow-level errors. |
Grafana Query Examples
Here are common queries to visualize this data:
| Description | Query |
|---|---|
| Queued Jobs | sum(snakemake_jobs_submitted) - sum(snakemake_jobs_running) |
| Running Jobs | sum(snakemake_jobs_running) |
| Throughput (Jobs/Minute) | sum(rate(snakemake_jobs_finished_total{status="finished"}[5m])) * 60 |
| Resource Utilization % | sum(snakemake_resource_usage_total{resource="threads"}) / sum(snakemake_resource_limits{resource="threads"}) * 100 |
| Failure Rate | sum(rate(snakemake_jobs_finished_total{status="failed"}[5m])) |
Development
This project uses pixi for dependency management and uv for building/publishing.
- Install dependencies:
pixi install - Run tests:
pixi run test - Run code formatting and linting:
pixi run qc - Build package:
pixi run build - Publish package:
pixi run publish
Metadata
Release files for snakemake-logger-plugin-prometheus 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| snakemake_logger_plugin_prometheus-0.1.3.tar.gz | 37.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| snakemake_logger_plugin_prometheus-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 44.6 kB
Release files / snakemake_logger_plugin_prometheus-0.1.3.tar.gz
| Download URL | snakemake_logger_plugin_prometheus-0.1.3.tar.gz |
|---|---|
| Size | 37.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19a43243faeb7f52ac57733b8202a5eb44cb2a782046894ad0f25a8af8c84bf4
|
|
BLAKE2b-256 checksum How to use checksums |
9e1dfbd70b094aa58994f0b91b95d137173311cf0699a5d0672b1be7de91c0e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 8, 2026.
Transparency logRelease files / snakemake_logger_plugin_prometheus-0.1.3-py3-none-any.whl
| Download URL | snakemake_logger_plugin_prometheus-0.1.3-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e02b1bc0fa0f4a8d72abd348e9b87e53fa00c9638b7f0007f818d2a67babe97a
|
|
BLAKE2b-256 checksum How to use checksums |
e9c84c59fed57b1ce40ecbc7af7f24ebaa208a8caa11e03bc4dc0a89cfa98609
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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 Jun 8, 2026.
Transparency log