Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24790 )
Change subject: [metrics] Support quantile selection in /metrics_prometheus ...................................................................... [metrics] Support quantile selection in /metrics_prometheus Native Kudu histograms are exported in the Prometheus summary format with a fixed set of seven quantile lines (min '0', 0.75, 0.95, 0.99, 0.999, 0.9999, and max '1') plus '_sum' and '_count'. On clusters with many histogram metrics and entities, every unwanted quantile is an extra exported time series, adding to scrape payload and TSDB cardinality. This lets an operator export only the quantiles they care about. The selection is driven either per-request via the 'quantiles' query parameter (e.g. ?quantiles=0.99,0.999) or server-wide via the new --metrics_prometheus_default_quantiles flag, which is applied whenever a request does not carry its own 'quantiles'. A request parameter takes precedence over the flag. This mirrors the existing 'merge_rules' / --metrics_prometheus_default_merge_rules mechanism. An empty selection (the default) exports every quantile, so existing output is unchanged. Unknown quantile tags are ignored with a warning; if a request or flag resolves to no known tags, all quantiles are exported (fail-open). The '_sum' and '_count' lines are always exported. Only the Prometheus endpoint is affected; the JSON endpoint is untouched. Change-Id: I01b48aa30f26f2a7efcd842bf6512a023cbf90ff Reviewed-on: http://gerrit.cloudera.org:8080/24790 Tested-by: Kudu Jenkins Reviewed-by: Alexey Serbin <[email protected]> --- M src/kudu/server/default_path_handlers.cc M src/kudu/util/metrics-test.cc M src/kudu/util/metrics.cc M src/kudu/util/metrics.h 4 files changed, 375 insertions(+), 53 deletions(-) Approvals: Kudu Jenkins: Verified Alexey Serbin: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/24790 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I01b48aa30f26f2a7efcd842bf6512a023cbf90ff Gerrit-Change-Number: 24790 Gerrit-PatchSet: 5 Gerrit-Owner: Yan-Daojiang <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Marton Greber <[email protected]> Gerrit-Reviewer: Yan-Daojiang <[email protected]>
