Snakemake logger plugin that exposes job info to prometheus.
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file snakemake_logger_plugin_prometheus-0.1.1.tar.gz.
File metadata
- Download URL: snakemake_logger_plugin_prometheus-0.1.1.tar.gz
- Upload date:
- Size: 36.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6951c402ae02443902ce7480dd12fa2bc6fba8ea4396a27bc356345cc649814
|
|
| MD5 |
b9910fc889ff333b82ae62f07baec499
|
|
| BLAKE2b-256 |
1205c8c36000b814ece509c03f788b8675638e83b6ab5b30a29565542328a415
|
Provenance
The following attestation bundles were made for snakemake_logger_plugin_prometheus-0.1.1.tar.gz:
Publisher:
release-please.yml on tedil/snakemake-logger-plugin-prometheus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snakemake_logger_plugin_prometheus-0.1.1.tar.gz -
Subject digest:
b6951c402ae02443902ce7480dd12fa2bc6fba8ea4396a27bc356345cc649814 - Sigstore transparency entry: 1096673603
- Sigstore integration time:
-
Permalink:
tedil/snakemake-logger-plugin-prometheus@ee581adaff334a48e2b237af3564d10ac1d2f340 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tedil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@ee581adaff334a48e2b237af3564d10ac1d2f340 -
Trigger Event:
push
-
Statement type:
File details
Details for the file snakemake_logger_plugin_prometheus-0.1.1-py3-none-any.whl.
File metadata
- Download URL: snakemake_logger_plugin_prometheus-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9358768d8719fca183d34f9682ec8f02188f6390b575b0e3669724729133667
|
|
| MD5 |
7475087cea0e2c697fa486961448be38
|
|
| BLAKE2b-256 |
d1e163f006b318c1d8bff001bc417b15d24f26ec1f76a1b50357600ee4efcc07
|
Provenance
The following attestation bundles were made for snakemake_logger_plugin_prometheus-0.1.1-py3-none-any.whl:
Publisher:
release-please.yml on tedil/snakemake-logger-plugin-prometheus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
snakemake_logger_plugin_prometheus-0.1.1-py3-none-any.whl -
Subject digest:
e9358768d8719fca183d34f9682ec8f02188f6390b575b0e3669724729133667 - Sigstore transparency entry: 1096673606
- Sigstore integration time:
-
Permalink:
tedil/snakemake-logger-plugin-prometheus@ee581adaff334a48e2b237af3564d10ac1d2f340 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tedil
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@ee581adaff334a48e2b237af3564d10ac1d2f340 -
Trigger Event:
push
-
Statement type: