Metrics for maintenance health: due-work lag, maintenance errors, leadership and runtime version
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- postgresql, rust
- Área
- backend, observability
Línea de trabajo
Start with awa-metrics/src/lib.rs, the telemetry reference, and docs/grafana/README.md; trace existing metric recording and maintenance branches, then review related issues #703 and #627 for context. The work spans queue metrics, maintenance and cron instrumentation, tests, alert rules, and dashboard panels. It is done when the proposed metrics are emitted and documented, tests cover them, matching alerts and panels exist, and the README gaps are removed or narrowed.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The dashboards README lists four things awa's metrics can't show (docs/grafana/README.md, "What the dashboards cannot show"). The first and last of them stop a promotion stall from being alerted on directly:
- Due-but-unpromoted work.
awa.queue.depth{awa.job.state="scheduled"}counts every deferred job whether or not it is due, andawa.queue.lagonly sees jobs already in the ready lanes. - Maintenance leader identity. Leadership is an in-process flag with no metric.
- Runtime version. No metric reports which awa version a runtime runs.
- Maintenance task failures. Failed promotion, rescue, prune and cron queries are logged with
error!and not counted. Theawa.maintenance.branch.durationtimer records whether the body failed or not, andawa.maintenance.promote.*records successful batches only.
A real case: in 0.6.10, scheduled promotion failed client-side ("too many arguments for query") whenever a 4,096-row batch was due at once (fixed in 0.6.12). Promotion stopped for every queue for about ten hours. In metrics, that looked like a large scheduled depth and a flat promotion rate, which a busy deployment with jobs scheduled days ahead shows normally too. The only direct signal was an error! log per tick, emitted by whichever runtime held the maintenance lease. Error trackers attribute that log to that application, not to awa.
Proposal
These are all additions. No existing name, type or attribute key changes, per the stability policy (ADR-036). Names follow awa-metrics' rules and the OpenTelemetry naming guidance. Failures follow Recording errors: an error.type attribute on the operation's duration histogram, omitted on success, rather than a separate error counter.
| Metric | Instrument | Unit | Attributes | Meaning |
|---|---|---|---|---|
awa.queue.due.lag |
gauge (f64) | s |
awa.job.queue, awa.job.state (scheduled | retryable) |
now - min(run_at) over deferred jobs whose run_at <= now; 0 when none are due. The deferred counterpart of awa.queue.lag. |
awa.queue.due.depth |
gauge (i64) | {job} |
awa.job.queue, awa.job.state |
Deferred jobs that are due but not yet promoted. |
awa.maintenance.branch.duration (existing) |
histogram | s |
add error.type when the branch body fails |
Makes every maintenance branch's failures countable from the metric that already exists. |
awa.maintenance.promote.duration (existing) |
histogram | s |
record failed batches too, with error.type |
Failure rate of promotion itself, per awa.job.state. |
awa.maintenance.prune.duration (existing) |
histogram | s |
add error.type |
Same for prune. Rotate and rescue get a .duration with error.type too, if not covered by the branch timer. |
awa.maintenance.leader |
gauge (i64) | {runtime} |
none (the exporter's resource identifies the runtime) | 1 on the runtime holding the maintenance lease, 0 elsewhere. sum should be 1, and changes() counts handovers. |
awa.runtime.info |
gauge, constant 1 | {runtime} |
awa.version, awa.storage.engine |
Version and storage per runtime, for mixed-version rollouts. |
awa.cron.fire.delay |
histogram | s |
awa.job.queue, awa.job.kind |
Time from a periodic job's scheduled fire time to its enqueue. Missed fires are recorded with error.type (for example missed), using the existing missed-fire policy. |
error.type values stay low-cardinality: the AwaError variant or a fixed class such as database, timeout, bind_limit or lock_not_available, never the message.
With these, a promotion stall is max(awa_queue_due_lag_seconds) > N, and a failing branch is rate(awa_maintenance_branch_duration_seconds_count{error_type!=""}[5m]) > 0. Both are independent of which application holds the lease. Queries over a due backlog should use the deferred_jobs (state, run_at, …) due index so queue_stats stays cheap. If that isn't possible, compute it in the promote branch, which already scans due rows.
Also found
awa.job.insertedis defined (awa-metrics/src/lib.rs) but never recorded. Emit it on the insert paths, or document it as reserved.awa.cron.reconciliation.decisionsandawa.cron.retiredhave no unit ({decision},{schedule}), and the decisions counter uses a bareoutcomekey where everything else is namespaced (awa.cron.outcome). Adding the units doesn't change Prometheus names. Renaming the key is breaking, so it fits 0.7's metric review, emitting both until then if wanted.- Semantic-convention alignment for 0.7, for discussion rather than this issue. Spans already use messaging conventions (ADR-039, #454). Metrics use
awa.job.queuerather thanmessaging.destination.name, and split outcomes acrossawa.job.completed/.failed/.retriedwhere the recording-errors guidance would puterror.typeonawa.job.duration. The messaging metrics conventions are still Development, and none of them covers depth or lag, so awa's own names stay the right home for those.
Related: #703 (prune lock failures), #627 (rescue backlog).
Done when
- The metrics above are emitted, documented in the telemetry reference, and covered by tests in
awa-metrics. docs/grafana/alerts/awa-alerts-prometheus.yamlgains a due-lag alert and a maintenance-error alert, and the dashboards gain matching panels.- The four entries in "What the dashboards cannot show" are removed or narrowed.
- Lenguaje dominante
- Rust
- Estrellas
- 37
- Forks
- 8
- Merge medio
- 14 h 16 min
- PR fusionados (30 d)
- 244
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hardbyte/awa
-
feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Los mantenedores suelen responder en 1 día
-
0.6.19 release checklistAbiertooperational
Dificultad 5/5 Más de una semana Aptitud para principiantes 8/100
hardbyte/awa#861 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
hardbyte/awa#841 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de hardbyte/awa
Issues similares
-
Mobile release verification reports missing build inputs with a custom Cargo target directoryAbiertobug good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
getsotto/sotto-authenticator#139 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
registrystack/registry-stack#2924 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
foundry-rs/starknet-foundry#4733 ·
Los mantenedores suelen responder en 4 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100