Petr Fedchenkov has uploaded a new patch set (#2). (
https://gerrit.cloudera.org/25484 )
Change subject: IMPALA-15835: Fix duplicate Prometheus metric names when
statestored HA is enabled
......................................................................
IMPALA-15835: Fix duplicate Prometheus metric names when statestored HA is
enabled
With enable_statestored_ha=true, StatestoreSubscriber creates a
StatestoreStub per statestore instance. Both stubs registered metrics
with identical keys (e.g. statestore-subscriber.topic-$0.update-interval)
in their respective child metric groups. Since
MetricGroup::ToPrometheus() flattens all child groups without prefixing
the group name, the /metrics_prometheus exposition contained each such
metric twice with its own HELP/TYPE header, and every standards-compliant
text-format parser (prometheus/common expfmt, promtool) rejects the
scrape with 'second HELP line for metric name ...'. This broke scraping of
the admissiond, impalad and catalogd metrics pages whenever statestored
HA was enabled.
Prefix every stub metric key with the same name_prefix the stub's metric
group already uses ('statestore-subscriber' or 'statestore2-subscriber'),
and register the matching MetricDefs entries in metrics.json. The keys of
the first stub stay unchanged, so single-statestored deployments and
existing dashboards are not affected.
The new regression test enables statestored HA and asserts the exposition
has no duplicate HELP lines or sample names. The statestored addresses of
the test subscriber are never dialed, so port 0 would reach the
constructor validation unresolved; the test probes two distinct unused
ports with FindUnusedEphemeralPort() instead.
Testing: statestore-test passes; the new
HaPrometheusUniqueMetricNames case fails on master without the key
prefixes and passes with them.
Change-Id: I4b888fcdbe5cb5ab4a9f52220a94bf0b0778eb32
---
M be/src/statestore/statestore-subscriber.cc
M be/src/statestore/statestore-subscriber.h
M be/src/statestore/statestore-test.cc
M common/thrift/metrics.json
4 files changed, 240 insertions(+), 21 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/84/25484/2
--
To view, visit https://gerrit.cloudera.org/25484
To unsubscribe, visit https://gerrit.cloudera.org/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I4b888fcdbe5cb5ab4a9f52220a94bf0b0778eb32
Gerrit-Change-Number: 25484
Gerrit-PatchSet: 2
Gerrit-Owner: Petr Fedchenkov <[email protected]>