-
Notifications
You must be signed in to change notification settings - Fork 744
SOLR-17628: Add query quantiles metrics to prometheus endpoint #3164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jkmuriithi for doing this!
@dsmiley maybe you can help review this and hopefully agree this is worth adding? I made this jira because I think this is important missing piece of metrics for prometheus and this PR addresses my poor implementation exporting timer (Should be a summary not a gauge average) but also adds support for creating a summary metric type.
The prometheus exporter doesn't seem to support histograms or summaries so this gets ahead of that curve.
solr/core/src/java/org/apache/solr/metrics/prometheus/core/SolrCoreHandlerMetric.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/metrics/prometheus/core/SolrCoreHandlerMetric.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/metrics/prometheus/core/SolrCoreSearcherMetric.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/metrics/prometheus/SolrPrometheusFormatter.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/metrics/prometheus/SolrPrometheusFormatter.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/metrics/prometheus/SolrPrometheusFormatter.java
Outdated
Show resolved
Hide resolved
solr/core/src/java/org/apache/solr/metrics/prometheus/core/SolrCoreHandlerMetric.java
Outdated
Show resolved
Hide resolved
Co-authored-by: David Smiley <dsmiley@apache.org> Co-authored-by: Matthew Biscocho <54160956+mlbiscoc@users.noreply.github.com>
This PR has had no activity for 60 days and is now labeled as stale. Any new activity will remove the stale label. To attract more reviewers, please tag people who might be familiar with the code area and/or notify the dev@solr.apache.org mailing list. To exempt this PR from being marked as stale, make it a draft PR or add the label "exempt-stale". If left unattended, this PR will be closed after another 60 days of inactivity. Thank you for your contribution! |
This PR is now closed due to 60 days of inactivity after being marked as stale. Re-opening this PR is still possible, in which case it will be marked as active again. |
I was looking at this PR for and just remembered I completely forgot about this PR! I think there is still value in having this for at least the 9x branch and then completely removed in 10 with OTEL. Not only did this add missing quantiles, it fixes up the timer export implementation with a summary giving better timer data. @dsmiley If you have no other comments I'd like to merge this in. Is it too late for 9.9? Not sure where that process went. |
Until there is a release branch for release X, no PR is "too late" for release X. Once a release branch exists (e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jkmuriithi for fixing the precommit failure and merging in main. Could you add a entry into CHANGES.txt under 9.9? I think this belongs under improvement section. Maybe something like "Export metrics timers to wt=prometheus as Prometheus Summaries (introduces count, sum, and quantiles)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 thanks for the before & after in JIRA. Really important for showing what changed.
Export metric timers via `wt=prometheus` as Prometheus summaries. This introduces count, sum, and quantiles.
Export metric timers via `wt=prometheus` as Prometheus summaries. This introduces count, sum, and quantiles.
https://issues.apache.org/jira/browse/SOLR-17628
Description
Modify the implementation of
SolrPrometheusFormatter.exportTimer
to export a Prometheus summary containing quantile information instead of a single Prometheus gauge. Rename the Timer-based metricssolr_metrics_core_average_request_time
andsolr_metrics_core_average_searcher_warmup_time
to reflect this change. Remove thesolr_metrics_core_requests_time
Counter metric.Solution
Prior to this change, Dropwizard Timer metrics (used for core request handlers and searchers) were exported in Prometheus format as single gauges representing the mean of all observations. This PR replaces the existing mean gauge metrics with a summary that includes quantile metrics, the count (number) of observations, and the sum of all observations.
Sample old output:
Sample new output:
Tests
I updated
MetricsHandlerTest
andSolrPrometheusFormatterTest
to align with the changes toexportTimer
../gradlew test
passes on my local machine.Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.