Repository navigation
Fix #2093: add _total suffix to CHI/host/pod counter metrics - #2097
Open
mehrdadbn9 wants to merge 1 commit into
Open
mehrdadbn9 wants to merge 1 commit into
mehrdadbn9 wants to merge 1 commit into
Conversation
promtool check metrics flags any counter exposed without the conventional _total suffix. The operator ships its OTel Prometheus exporter with WithoutCounterSuffixes(), so names are emitted verbatim and the 12 Int64Counter instruments in chi/metrics carried non-compliant names. This renames all of them (including pod_update/pod_delete, which were absent from the original scrape and thus escaped Altinity#2093 but fail the same lint once emitted). Histograms and the UpDownCounter are intentionally untouched. Adds a regression test asserting monotonic counters carry _total and non-counters do not. Signed-off-by: Mehrdad Biukian Naeini <mehrdadbiukian@gmail.com>
mehrdadbn9
marked this pull request as ready for review
October 9, 2026 04:40
Member
|
This will break existing dashboards. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2093.
promtool check metricsflags our counters: the exporter is built withprometheus.WithoutCounterSuffixes(), so OTel emits names verbatim and all 12Int64Counterinstruments inchi/metricsshipped without_total. Thisrenames them to
*_total, includingpod_update/pod_delete_eventswhich wereabsent from the original endpoint scrape and thus escaped #2093 but carry the
same latent defect. Histograms and the
clickhouse_operator_chiUpDownCounterintentionally unchanged.
Adds
TestAllCountersCarryTotalSuffixandTestNonCounterShapesHaveNoTotalSuffixas a regression guard using the OTel ManualReader.
go vetandgo testpass;full
pkg/controller/...builds clean.Heads-up: metric rename is user-visible. Dashboards and recording rules
referencing the old names, for example
clickhouse_operator_chi_reconciles_started, need a one-line update to the_totaltwin.