shigoto_metrics_definitions (shigoto_metrics v0.1.4)
View SourceDeclares the Prometheus metrics that shigoto_metrics_handlers updates from
shigoto telemetry events.
High-cardinality keys (job_id, batch_id) deliberately stay out of metric
labels; they remain on the raw telemetry events for tracing or audit sinks that
need them. Labels are limited to bounded dimensions: worker, queue,
priority, snooze reason, cron name, and testing mode.
Label values MUST be bounded, developer-controlled dimensions. Never route
untrusted input into a queue name, a priority, or a snooze reason (e.g. a
worker snoozing with a per-job id embedded in the reason): each distinct value
mints a new Prometheus series and unbounded values are a cardinality DoS on both
the exporter and the scraping Prometheus.
The [shigoto, job, progress] event is intentionally NOT exported. It is a
per-job 0..100 percentage that only aggregates meaningfully keyed by job_id,
which is excluded on purpose; it has no bounded counter or histogram shape.