Skip to content

feat(metrics): export bounded cumulative latency histograms - #454

Draft
voidvec wants to merge 6 commits into
feature/v1.8.0-roadmapfrom
feat/v1.8.0-metrics-histogram
Draft

voidvec wants to merge 6 commits into
feature/v1.8.0-roadmapfrom
feat/v1.8.0-metrics-histogram

Conversation

@voidvec

@voidvec voidvec commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Problem and resulting behavior

DrogonMetrics::observeHistogram previously wrote INFO logs only. O1-A now exports oauth2_latency_seconds through the existing PromExporter using fixed cumulative second buckets and finite operation/storage labels. Native export uses the existing event loop, with no per-tuple thread or rolling timer. Existing counter/gauge/cache export and independent metric-log fallback are retained.

Only the fixed latency family is exported: 5 operations × 4 storage values = at most 20 tuples / 300 bucket/sum/count series. Invalid values/labels and foreign base/suffix collectors are rejected. Counter/Gauge calls cannot create or mutate the reserved base, _bucket, _sum, or _count names. Third-party direct runtime registry writes cannot be made transactional across names and are explicitly prohibited for this family.

Production request timing is not wired in this PR. O1-B will add controller-completion observations; O1-C will address legacy statics and existing counter/gauge semantics. No SDK/OpenAPI/DB/dependency/CI-gate changes.

Small commits

  1. 496708bc — fixed private latency policy and dictionary tests.
  2. 4b4315ed — native cumulative export, collision protection and real collector concurrency/boundary tests.
  3. cf087da5 — exact real /metrics delta regression and EN/zh/generated documentation.
  4. 2a71e7da — isolated real HTTP fixture started at WARN, verifying all 15 histogram samples with INFO disabled.

The detailed design, scope amendment and implementation received independent technical/execution reviews with zero open P0/P1/P2. An uncommitted test initially changed Trantor's non-atomic log level during server execution; review caught this and it was replaced before commit by the isolated startup-WARN fixture. No runtime level mutation or sanitizer suppression was added.

Validation and current checkpoint

  • PASS locally: pure C++17 policy driver (-Wall -Wextra -Werror -pedantic), API diff (276 headers), architecture guard, double-move guard, naming, EN/zh mirror, generated docs idempotence, diff whitespace checks.
  • CMake/Conan are unavailable locally. Native gtests, full main binary (without internal -r), new LatencyHistogramExport CTest fixture, EndpointTests, three-platform WERROR, Feature Matrix and installed-consumer tests are running in CI; no completed acceptance is claimed yet.
  • Full sanitizer dispatch: run 47516778431; hard coverage dispatch: run 47516781684, at head 2a71e7dace453edb685545aac79a98ff91b13af2. Full TSan/ratchet gates remain unchanged.
  • CLA reports startup_failure under the repository's pull_request_target policy, separately from product checks.

Dependency and scope

Based on F0 aa3ea971 (#446), targeting feature/v1.8.0-roadmap. O1 net diff is 13 files; inherited F0 changes are separate. Draft pending exact-head CI/artifact reconciliation, F0 dependency and CLA policy resolution. No automatic merge.

Addresses #453
Addresses #414

Include the exact v1.8.0 integration branch in existing validation events.
Compare OpenAPI against the actual PR base or an explicit manual base.
Observe asynchronous invitation attribution within a bounded read window,
preserving all lifecycle assertions and registration behavior.

Fixes #445

Fixes #447

Addresses #417

This branch has not been deployed

No deployments
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