Yan-Daojiang has uploaded this change for review. ( http://gerrit.cloudera.org:8080/24836
Change subject: [metrics] add --metrics_prometheus_default_metrics for a server-side allowlist ...................................................................... [metrics] add --metrics_prometheus_default_metrics for a server-side allowlist The /metrics_prometheus endpoint already honors a per-request 'metrics' allowlist (a case-insensitive substring match), but there is no server-side default: only severity has one, via --metrics_default_level. As a result, any scrape that omits the 'metrics' parameter -- an ad-hoc curl, a one-off script, or a misconfigured collector -- receives the full metric set, and the allowlist must be carried in every scrape URL. That URL channel is bounded by the ~16KB request buffer and is prone to silent degradation: if the value collapses to no usable token, filtering is disabled and the full output is returned. Add --metrics_prometheus_default_metrics, mirroring the existing --metrics_prometheus_default_merge_rules / --metrics_prometheus_default_quantiles family: a request's own 'metrics' parameter takes precedence over the flag default, which is applied only when the request carries none; an empty value (the default) preserves the current behavior. This turns the allowlist from a per-request convention into a server-side policy that covers parameter-less scrapes as well. Also simplify the 'export_all' check in Histogram::WriteAsPrometheus() per a review suggestion from Change-Id: I01b48aa. Change-Id: I70ef54eef456108f8503a4edfdfb68fab3173353 --- M src/kudu/server/default_path_handlers.cc M src/kudu/tserver/tablet_server-test.cc M src/kudu/util/metrics-test.cc M src/kudu/util/metrics.cc M src/kudu/util/metrics.h 5 files changed, 169 insertions(+), 4 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/36/24836/1 -- To view, visit http://gerrit.cloudera.org:8080/24836 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I70ef54eef456108f8503a4edfdfb68fab3173353 Gerrit-Change-Number: 24836 Gerrit-PatchSet: 1 Gerrit-Owner: Yan-Daojiang <[email protected]>
