Skip to main content

Snakemake logger plugin for snakesee workflow monitoring

Project description

snakemake-logger-plugin-snakesee

A Snakemake logger plugin that integrates with snakesee for enhanced workflow monitoring.

Overview

This plugin captures real-time workflow events directly from Snakemake's execution engine and writes them to a JSONL file that snakesee can read. This provides more accurate and timely job status information than log parsing alone.

Installation

pip install snakemake-logger-plugin-snakesee

Or install alongside snakesee:

pip install snakesee snakemake-logger-plugin-snakesee

Usage

Run Snakemake with the snakesee logger:

snakemake --logger snakesee --cores 4

In another terminal, run snakesee to monitor:

snakesee watch

The plugin writes workflow events to .snakesee_events.jsonl in the workflow directory. Snakesee automatically detects and reads these events for real-time updates.

Benefits

Using the logger plugin provides:

  • Instant job detection: Jobs are reported immediately when they start/finish, not when log lines are parsed
  • Accurate timing: Job durations are calculated from actual execution timestamps
  • Direct wildcard access: Wildcard values come directly from Snakemake, not regex parsing
  • Reliable error tracking: Failed jobs are detected via Snakemake events, not log patterns

Configuration

Setting Default Description
event_file .snakesee_events.jsonl Path to event file (relative to workflow directory)
buffer_size 1 Events to buffer before flush (1 = immediate)

Event Types

The plugin emits the following event types:

Event Description
workflow_started Workflow initialization
job_submitted Job queued for execution
job_started Job execution began
job_finished Job completed successfully
job_error Job failed
progress Overall progress update

Event File Format

Events are written as JSON Lines (one JSON object per line):

{"event_type":"workflow_started","timestamp":1703001234.123}
{"event_type":"job_submitted","timestamp":1703001235.0,"job_id":1,"rule_name":"align","wildcards":{"sample":"A"}}
{"event_type":"job_started","timestamp":1703001235.5,"job_id":1}
{"event_type":"job_finished","timestamp":1703001335.5,"job_id":1,"duration":100.0}
{"event_type":"progress","timestamp":1703001335.6,"completed_jobs":1,"total_jobs":10}

Backward Compatibility

Snakesee works with or without this plugin:

  • Without plugin: Uses log parsing and metadata files (existing behavior)
  • With plugin: Uses real-time events for enhanced accuracy

The plugin is completely optional - snakesee will automatically use events when available and fall back to log parsing otherwise.

Requirements

  • Python 3.11+
  • Snakemake 8.0+ (for logger plugin support)
  • snakemake-interface-logger-plugins >= 1.0.0

License

MIT

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_snakesee-0.1.1.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file snakemake_logger_plugin_snakesee-0.1.1.tar.gz.

File metadata

File hashes

Hashes for snakemake_logger_plugin_snakesee-0.1.1.tar.gz
Algorithm Hash digest
SHA256 55db2a9f0ba716221450995fba6772108dc0536f572db4f525a2647e480135b2
MD5 3056111f1ded1bb0815503850f5b6d96
BLAKE2b-256 f090dc8378103611b510a5476d5359850e50fc27e2819bc64206057eb25b1877

See more details on using hashes here.

Provenance

The following attestation bundles were made for snakemake_logger_plugin_snakesee-0.1.1.tar.gz:

Publisher: publish-logger-plugin.yml on nh13/snakesee

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