Skip to content

docs: ADR 020 — observability and metrics standard - #192

Merged
thiras merged 3 commits into
mainfrom
adr/020-observability
Apr 8, 2026
Merged

thiras merged 3 commits into
mainfrom
adr/020-observability

Conversation

@alpergundogdu

Copy link
Copy Markdown
Contributor

Summary

Adds ADR 020, the canonical Prometheus metric registry for all deCDN nodes.

Background

Issue #190 identified that metrics are scattered across ADRs 001, 005, 011, 015 and architecture.md with no consistent naming, no mandatory/optional split, and no alert thresholds. Operators running PoC nodes cannot build monitoring without hunting across 8 documents.

What's in this ADR

Naming convention: decdn_ prefix, snake_case, _total suffix for counters, unit suffixes (_seconds, _bytes) for gauges/histograms.

35 metrics across 8 subsystems, split into mandatory (M) and recommended (R):

Subsystem Metrics Tier
Slash-safety 7 metrics M (all)
Delivery 5 metrics M
Cache 5 metrics M + R
Probing 2 metrics M + R
Payment channels 6 metrics M + R
Gossip 4 metrics M + R
Reputation 3 metrics R (prod only)
QUIC / 0-RTT 3 metrics R

Alert thresholds for all 7 slash-safety metrics (Warning/Critical + recommended action).

/health endpoint — JSON with ready/degraded/not_ready status, peer count, channel balances, blacklist sync state. HTTP 200 / 503.

Cross-reference table mapping all prior informal metric names (from ADRs 001, 005, 011, 015, architecture.md) to their canonical decdn_ replacements — no semantic changes, naming only.

architecture.md changes

Replaces the inline metric list in § Observability with a short summary pointing at ADR 020 as the authoritative source.

Addresses

Issue #190, item 6 (Observability & metrics standard).

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces ADR 019 and ADR 020, which formalize the node onboarding process and observability standards for the network. ADR 019 defines a five-phase sequential flow for node operators to transition from server provisioning to active delivery, while ADR 020 establishes a canonical Prometheus metric registry, naming conventions, and a structured health endpoint. The feedback focuses on maintaining consistency with these new standards, specifically by using canonical metric names in the onboarding documentation and aligning the health endpoint JSON keys with the defined metric registry.

Comment thread adr/019-node-onboarding.md Resolved
Comment thread adr/020-observability.md Resolved
@alpergundogdu

Copy link
Copy Markdown
Contributor Author

Addressing the cross-ADR consistency note from the review:

The informal gossip_messages_rejected_clock_skew reference in ADR 019 §1 (line 51) has been replaced with the canonical decdn_gossip_messages_rejected_total{reason="clock_skew"} in PR #191. That PR targets main independently, so by the time this PR is merged the name is already consistent.

alpergundogdu and others added 2 commits April 8, 2026 12:21
Consolidates metrics scattered across ADRs 001, 005, 011, 015 and
architecture.md into a single canonical registry with:

- decdn_ prefix + _total/unit-suffix naming convention
- 35 metrics across 8 subsystems split into mandatory (M) and
  recommended (R) tiers
- Recommended alert thresholds for the 7 slash-safety metrics
- /health JSON endpoint with ready/degraded/not_ready semantics
- Cross-reference table mapping all prior informal metric names to
  their canonical decdn_ replacements

Updates architecture.md Observability section to reference ADR 020
and remove the now-superseded inline metric list.

Addresses the observability gap identified in issue #190 (item 6).

Co-authored-by: Copilot <[email protected]>
- Add §2.9 Node/Process Metrics with decdn_node_uptime_seconds (Gauge/R)
- Align /health JSON keys with canonical metric names:
  peer_count → peer_table_size, uptime_seconds → node_uptime_seconds
- Add JSON key → Prometheus metric mapping table below /health example
- This resolves the inconsistency flagged between health endpoint fields
  and the canonical metric registry

Co-authored-by: Copilot <[email protected]>
@alpergundogdu
alpergundogdu force-pushed the adr/020-observability branch from 61b29ca to 85ba3c1 Compare April 8, 2026 11:21
@thiras
thiras merged commit e235b3d into main Apr 8, 2026
@thiras
thiras deleted the adr/020-observability branch April 8, 2026 23:14
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.

2 participants