docs(observability): record the thin-layer architecture decisions#534
Closed
bussyjd wants to merge 1 commit into
Closed
docs(observability): record the thin-layer architecture decisions#534bussyjd wants to merge 1 commit into
bussyjd wants to merge 1 commit into
Conversation
After the OBOL parity smoke + Prometheus expert review, we made
explicit design choices worth recording so they don't get
re-litigated:
1. Counters are intentionally per-process — Prometheus design.
Pod restarts reset them; rate()/increase() handle this at
query time via the TSDB's reset detection. Don't add
persistence to the counter itself.
2. Prometheus = recent operational telemetry (bounded by retention).
On-chain settlement TXs = canonical lifetime financial record.
3. Recording rules use the convention <level>:<metric>:<operations>;
name the window (7d_by_offer, not lifetime_by_offer).
4. Add labels you'd query by directly (chain, asset_symbol —
both CR-derived, both query-meaningful, both bounded).
5. div-by-zero guards use epsilon (1e-9), not 1.0.
6. CRD versioning stance: stay on v1alpha1 during active dev;
the alpha promise IS "no compat". Graduate only when an
external operator commits to depending on the schema.
The PVC-backed counter persistence option was considered and
rejected for our single-operator local-k3d use case. The doc
walks through why, what would change that decision, and where
the canonical "lifetime" answer comes from.
Adds CLAUDE.md pointer so future contributors land here first.
6 tasks
Collaborator
Author
|
Superseded by bundle PR #536 — closing in favor of the consolidated merge target. Original branch and history preserved. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pure docs PR — captures the architectural decisions made during the OBOL parity integration smoke + Prometheus expert review so they don't get re-litigated.
docs/observability.md(~370 lines) establishes:rate()/increase()handle resets at query time via the TSDB. The PVC-backed-state, Pushgateway, and OTelcumulativetodeltaalternatives were all considered and rejected for our single-operator local-k3d use case, with reasoning so the rejection can be revisited if requirements change.<level>:<metric>:<operations>, name the window in the rule (7d_by_offer, neverlifetime_*), useincrease()over an explicit range, keep the range inside retention.chain,asset_symbol). Don't label by unbounded attributes (payer address, tx hash).v1alpha1during active dev; the alpha promise IS "no compat". Graduate tov1beta1only when an external operator commits to depending on the schema. The architecture review'sv1beta1 graduationflag was hypothetical, not actionable.clamp_min(..., 1)is an anti-pattern: epsilon must be1e-9, not1.0. The1.0form silently makes low-traffic alerts under-report.CLAUDE.md gets a one-line pointer in the Pitfalls section so future contributors land in
docs/observability.mdfirst when touching metrics.References
fix(prometheus-rules): escape PromQL $labels for Helm renderingfix(prometheus-rules): use increase() for the per-offer revenue rulefeat(x402-metrics): add asset_symbol label for per-token queriesplans/release-smoke-hardening-*.mdandplans/post-490-integration-*.md)Test plan
grep -n "docs/observability.md" CLAUDE.mdreturns the new pointer linegh pr view 527 / 530 / 531origin/main(no incidental changes)