Skip to content

feat: integrate telemetry metrics - #1027

Merged
ONEONUORA merged 1 commit into
Fracverse:masterfrom
Stanley-Owoh:integrate-telemetry-metrics-940
Jul 30, 2026
Merged

feat: integrate telemetry metrics#1027
ONEONUORA merged 1 commit into
Fracverse:masterfrom
Stanley-Owoh:integrate-telemetry-metrics-940

Conversation

@Stanley-Owoh

Copy link
Copy Markdown
Contributor

[Backend] Integrate telemetry metrics — Issue #940

Changes

backend/src/metrics.rs

  • Added REQUEST_COUNT — a CounterVec with (method, path, status) labels that explicitly tracks the total number of HTTP requests received. This complements the existing latency histogram by providing a direct counter for request rate calculations.
  • Updated init() to force-initialize the new REQUEST_COUNT metric at startup.
  • Updated latency_middleware to increment REQUEST_COUNT alongside recording latency observations in the histogram.

backend/src/api.rs

  • Reordered the metrics middleware layering so latency_middleware is applied before /metrics route registration. This ensures:
    • The /metrics endpoint is not tracked by the latency middleware (avoids circular metric collection on the metrics endpoint itself).
    • All API routes remain properly wrapped for request count, latency, and active-connection tracking.

Testing

  • cargo check / cargo clippy — clean.
  • cargo test — all 61 tests pass (34 lib, 16 api, 6 kyc_webhook, 5 middleware).
  • Builds correctly with and without the metrics feature flag.

Closes #940

@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@Stanley-Owoh Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@ONEONUORA ONEONUORA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great job @Stanley-Owoh

@ONEONUORA
ONEONUORA merged commit 3d8f4bd into Fracverse:master Jul 30, 2026
4 checks passed
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.

[Backend] Issue #31: Integrate telemetry metrics

2 participants