chore: better prometheus metrics#39475
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
_total counters)
6eea18e to
edb0ad4
Compare
27f3984 to
1697a76
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #39475 +/- ##
===========================================
- Coverage 70.96% 70.95% -0.01%
===========================================
Files 3198 3198
Lines 113449 113487 +38
Branches 20558 20541 -17
===========================================
+ Hits 80507 80525 +18
- Misses 30892 30912 +20
Partials 2050 2050
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
d-gubert
left a comment
There was a problem hiding this comment.
@copilot apply each of the comments in this change request as a separate commit.
Additionally, add the following metrics:
- A histogram to track response sizes in bytes
- A gauge to measure active requests
Both can be observed in the metrics middleware
All comments applied as separate commits:
|
|
@copilot fix the errors in this CI run https://github.com/RocketChat/Rocket.Chat/actions/runs/22868898741?pr=39475 Each fix gets its own commit. Do not fix lint errors from files you did not previously edit |
Fixed in commit
|
_total counters)summary/histogram params in metricsMiddleware to clarify intent
summary/histogram params in metricsMiddleware to clarify intentedb0ad4 to
dc27e65
Compare
a552243 to
982ca27
Compare
e5d5c1a to
dd83528
Compare
…counters)" Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
…stogram Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
…chain Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
…leware Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
…ctiveRequestsGauge mocks Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
…stogram in metricsMiddleware Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
Co-authored-by: d-gubert <1810309+d-gubert@users.noreply.github.com>
d8be014 to
371c277
Compare
|
Closing in favor of #39857 |
Motivation
The existing Prometheus metrics in Rocket.Chat had several issues:
_totalsuffix required by the OpenMetrics/Prometheus naming convention.Changes
New metrics:
_seconds) for all existing latency Summaries:rocketchat_meteor_methods_seconds,rocketchat_callbacks_seconds,rocketchat_hooks_seconds,rocketchat_rest_api_seconds,rocketchat_meteor_subscriptions_seconds,rocketchat_apps_bridge_methods_seconds,rocketchat_queue_wait_duration_seconds_totalsuffixed duplicates for counters that lacked them:rocketchat_deprecations_total,rocketchat_metrics_requests_total,rocketchat_messages_sent_total,rocketchat_notifications_sent_total,rocketchat_ddp_rate_limit_exceeded_total,rocketchat_livechat_webhooks_success_total,rocketchat_livechat_webhooks_failures_totalrocketchat_rest_api_response_size_bytes– histogram of REST API response payload sizes in bytesrocketchat_rest_api_active_requests– gauge tracking the number of concurrent in-flight REST API requestsnodejs_event_loop_utilization_ratio- gauge tracking the ratio of the event loop utilization reported by NodeJSMetrics middleware improvements:
summary/histogramparams toendpointTimeSummary/endpointTimeHistogramto clearly indicate what is being measuredendpointTimeHistograma required parameteruser_agent,version) from the histogram to reduce cardinality while keeping them on the summarymetrics → tracer → loggerin all three API entry pointsOriginal prompt
This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.