Skip to content

feat(analytics): implement API monitoring with request counts, error rates, slow endpoints, and usage by user#527

Merged
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
abore9769:feature/api-monitoring
May 29, 2026
Merged

feat(analytics): implement API monitoring with request counts, error rates, slow endpoints, and usage by user#527
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
abore9769:feature/api-monitoring

Conversation

@abore9769
Copy link
Copy Markdown
Contributor

closes #418

  • Track request counts per endpoint with requests/minute rate
  • Capture error rates overall and broken down by HTTP status code
  • Detect slow endpoints using 1000ms avg response time threshold
    with p95/p99 percentiles
  • Record per-user usage including request count, error count,
    avg response time, and last seen timestamp
  • Extend interceptor to capture authenticated userId and catch
    thrown exceptions for accurate error status tracking
  • Add time-windowed queries via ?window=N param (default 60m)

Endpoints: GET /analytics, /analytics/endpoints,
/analytics/slow-endpoints, /analytics/errors,
/analytics/users, /analytics/users/:userId,
DELETE /analytics/reset

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 27, 2026

@abore9769 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

@nanaf6203-bit
Copy link
Copy Markdown
Contributor

@abore9769 please stick to the task assign to you and nothing else.

Copy link
Copy Markdown
Contributor

@nanaf6203-bit nanaf6203-bit left a comment

Choose a reason for hiding this comment

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

@abore9769 fix the CI and also resolve conflicts

@nanaf6203-bit
Copy link
Copy Markdown
Contributor

@abore9769 ??

Copy link
Copy Markdown
Contributor

@nanaf6203-bit nanaf6203-bit left a comment

Choose a reason for hiding this comment

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

LGTM

@nanaf6203-bit nanaf6203-bit merged commit f4b79ba into MettaChain:main May 29, 2026
3 of 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.

Implement API Usage Monitoring

2 participants