Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snakemake_logger_plugin_prometheus-0.1.2.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file snakemake_logger_plugin_prometheus-0.1.2.tar.gz.

File metadata

File hashes

Hashes for snakemake_logger_plugin_prometheus-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2ccd230520e4cecc7b5c37ca40bda04646e2a7f977d003c7db36eebbcae7efbd
MD5 c9eb663c4118148853ad655a878a6819
BLAKE2b-256 c323eab96afa6a202530ed96f4beb2a0725ba4d133af5ca1c7aa6fe0957579a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakemake_logger_plugin_prometheus-0.1.2.tar.gz:

Publisher: release-please.yml on tedil/snakemake-logger-plugin-prometheus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file snakemake_logger_plugin_prometheus-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for snakemake_logger_plugin_prometheus-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ed12145c7ec8e6c1d1b3a71a3af78163b6ec7e5653a4b1b6bd0031e23ae70863
MD5 5a60947a2de3e4deff78e1cd247e3e0e
BLAKE2b-256 ea6be549de7f5dfc8eeadd46e8f7c04351c60a102e279fca3b8e7141870b5705

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakemake_logger_plugin_prometheus-0.1.2-py3-none-any.whl:

Publisher: release-please.yml on tedil/snakemake-logger-plugin-prometheus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page