Summary
Instrument only the currently implemented operational paths that ADR 0012 names, without inventing future run execution, stage transition, retry, cancellation, or validation-runner behavior.
This issue now covers the telemetry that can be wired to existing control-plane paths: GitHub webhook outcomes, development-loop run start and trace correlation, approval wait/pending state, queued-run depth, lock contention, and central observability helper boundaries.
Run/step completion, duration, retry, cancellation, stage-transition outcomes, and deterministic validation execution telemetry are deferred to #73 under #14 so those metrics are implemented with the feature that creates the runtime behavior.
Deliverables
- Emit
loopworks.webhook.outcome for existing GitHub webhook route branches: accepted, rejected, duplicate, invalid signature, and unexpected error.
- Preserve
loopworks.run.started for development-loop creation and keep ADR 0012 trace correlation aligned across logs, spans, loop_runs.trace_id, run_steps.trace_id, and durable observability rows.
- Emit
loopworks.approval.wait_time for current approval decision paths and expose loopworks.approval.pending from existing outstanding approval rows.
- Emit
loopworks.queue.depth from existing queued loop_runs state.
- Emit
loopworks.lock.contention from existing idempotency lock conflict paths.
- Keep all OTel metric/span creation and metric-name literals behind
src/lib/observability/ helpers.
Acceptance Criteria
- Focused tests are written first and demonstrate the red state before production code changes.
- Emitted metric names, units, and attributes match ADR 0012 exactly for the metrics in this issue.
- Tests cover webhook outcome branches, approval decision paths, pending approval gauge behavior, queue-depth gauge behavior, and lock contention where currently implemented.
trace_id propagation remains aligned with run and step persistence for development-loop run creation.
- No instrumentation call site bypasses the central observability helpers.
- No fake production call sites are added for run/step completion, retries, cancellations, stage outcomes, or validation execution metrics.
- Runtime changes include
bun run build; broad observability changes finish with bun run validate.
Notes
Refs #21
Refs #14
Refs #73
Refs ADR 0012
Summary
Instrument only the currently implemented operational paths that ADR 0012 names, without inventing future run execution, stage transition, retry, cancellation, or validation-runner behavior.
This issue now covers the telemetry that can be wired to existing control-plane paths: GitHub webhook outcomes, development-loop run start and trace correlation, approval wait/pending state, queued-run depth, lock contention, and central observability helper boundaries.
Run/step completion, duration, retry, cancellation, stage-transition outcomes, and deterministic validation execution telemetry are deferred to #73 under #14 so those metrics are implemented with the feature that creates the runtime behavior.
Deliverables
loopworks.webhook.outcomefor existing GitHub webhook route branches: accepted, rejected, duplicate, invalid signature, and unexpected error.loopworks.run.startedfor development-loop creation and keep ADR 0012 trace correlation aligned across logs, spans,loop_runs.trace_id,run_steps.trace_id, and durable observability rows.loopworks.approval.wait_timefor current approval decision paths and exposeloopworks.approval.pendingfrom existing outstanding approval rows.loopworks.queue.depthfrom existing queuedloop_runsstate.loopworks.lock.contentionfrom existing idempotency lock conflict paths.src/lib/observability/helpers.Acceptance Criteria
trace_idpropagation remains aligned with run and step persistence for development-loop run creation.bun run build; broad observability changes finish withbun run validate.Notes
Refs #21
Refs #14
Refs #73
Refs ADR 0012