Skip to content

chore(planning): adopt decision records; record metrics-recorder non-unification (review #4)#112

Merged
lesnik512 merged 2 commits into
mainfrom
chore/adopt-planning-decisions
Jun 23, 2026
Merged

chore(planning): adopt decision records; record metrics-recorder non-unification (review #4)#112
lesnik512 merged 2 commits into
mainfrom
chore/adopt-planning-decisions

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Summary

Adopt the lightweight decision-record convention from modern-di (planning/decisions/), and use it to record candidate #4 from the 2026-06-23 architecture review as rejected.

Candidate #4 proposed unifying the two MetricsRecorder adapters (PrometheusRecorder, OpenTelemetryRecorder) behind a shared data-driven event→metric table. On inspection that doesn't earn its keep, so rather than build a shallow abstraction we record the decision (with a revisit trigger) so a future review doesn't re-propose it.

Why #4 was rejected

The two __call__ switches share only the event-name dispatch ladder; the per-event bodies are irreducibly backend-specific:

  • dispatched → Prometheus does 3 ops (counter + size histogram + in-process gauge.inc); OpenTelemetry is a no-op.
  • acked/nacked_* → Prometheus uses separate labeled counters + gauge.dec; OTel folds reason/exception into attributes on one shared histogram.
  • lease_lost → Prometheus reuses processed_total{status=error}; OTel doesn't.
  • fetched → Prometheus has a non_empty label; OTel has no such attribute.

A (metric kind, name, label set) table can't express this (different instrument counts per backend; label-vs-attribute placement differs; cross-event reuse). Deletion test: a shared table only removes the trivial dispatch ladder and pushes the bodies back where they are — a shallow abstraction that worsens locality. Full rationale + revisit trigger in the decision record.

What this adds (convention)

  • planning/_templates/decision.md — ported from modern-di.
  • planning/index.py — lists planning/decisions/*.md newest-first under a ## Decisions section (just index).
  • planning/README.md + CLAUDE.md — document the convention.
  • planning/decisions/2026-06-23-metrics-recorders-not-unified.md — the decision.

No package code changed. just lint-ci clean.

🤖 Generated with Claude Code

lesnik512 and others added 2 commits June 23, 2026 21:57
…corder non-unification

Add the lightweight decision-record convention from modern-di: a decision.md
template, index.py support (lists decisions newest-first), and README/CLAUDE.md
docs. Record candidate #4 from the 2026-06-23 architecture review (unify the two
metrics recorders behind a shared event->metric table) as rejected — the per-event
bodies are irreducibly backend-specific, so a shared table is a shallow abstraction
with negative locality — with a revisit trigger.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 merged commit 730211e into main Jun 23, 2026
3 checks passed
@lesnik512 lesnik512 deleted the chore/adopt-planning-decisions branch June 23, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant