Counter metrics are missing the conventional _total suffix
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- go, prometheus
- Domain
- observability
Research direction
Search the Go code for the affected metric names listed in the issue and read the metric declarations and registration points. Check the operator's /metrics output with promtool check metrics; done means all affected counter metrics use the _total suffix and the lint check no longer reports them.
Written by the indexing model from the issue text.
Description
Counter metrics are missing the conventional _total suffix
Summary
Several Prometheus counter metrics exposed by the operator's /metrics
endpoint are declared as counter in their # TYPE line but do not use the
conventional _total suffix recommended by the Prometheus naming best
practices and enforced by promtool check metrics.
Environment
- clickhouse-operator metrics endpoint: operator
/metrics(port 9999) - Checked with the official Prometheus
promtool check metrics
Steps to reproduce
curl -s http://<operator-host>:9999/metrics | promtool check metrics
promtool check metrics output
clickhouse_operator_chi_auto_recoveries_triggered counter metrics should have "_total" suffix
clickhouse_operator_chi_keeper_updates_skipped counter metrics should have "_total" suffix
clickhouse_operator_chi_reconciles_aborted counter metrics should have "_total" suffix
clickhouse_operator_chi_reconciles_completed counter metrics should have "_total" suffix
clickhouse_operator_chi_reconciles_started counter metrics should have "_total" suffix
clickhouse_operator_host_reconciles_completed counter metrics should have "_total" suffix
clickhouse_operator_host_reconciles_errors counter metrics should have "_total" suffix
clickhouse_operator_host_reconciles_restarts counter metrics should have "_total" suffix
clickhouse_operator_host_reconciles_started counter metrics should have "_total" suffix
clickhouse_operator_pod_add_events counter metrics should have "_total" suffix
10 of the 16 counter metric families exposed on the endpoint are affected
(6 counters already follow the _total convention).
Expected behavior
Counter metrics follow the Prometheus naming convention and carry a _total
suffix, e.g. clickhouse_operator_chi_reconciles_started_total.
See the Prometheus docs:
- https://prometheus.io/docs/practices/naming/#metric-names
promtool check metricslint rule
Impact
- Tooling that lints metrics (
promtool check metrics) reports these as
non-compliant. - Downstream consumers that assume the
_totalconvention (dashboards,
recording rules, metric-relabeling) need per-metric exceptions.
Suggested fix
Rename the affected counters to include the _total suffix.
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 577
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 4
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Altinity/clickhouse-operator
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Altinity/clickhouse-operator#2094 ·
Maintainers usually reply within 2 days
-
[Regression / Discussion] Loss of hot-reloaded password rotation after removal of k8s_secret_* in 0.27.4Possibly taken @sunsingerus claimed this 2 days ago. Openplanned for review
Difficulty 5/5 Over a week Newbie friendliness 38/100
Altinity/clickhouse-operator#2092 · 1 comment · 1 assignee ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
Altinity/clickhouse-operator#2089 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 45/100
Altinity/clickhouse-operator#2064 · 3 comments ·
Maintainers usually reply within 2 days
-
big deployment planned for review
Difficulty 4/5 3-5 days Newbie friendliness 52/100
Altinity/clickhouse-operator#2063 ·
Maintainers usually reply within 2 days
All issues in Altinity/clickhouse-operator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
war-and-code/dircue#200 ·
Maintainers usually reply within 1 day
-
actor/human kind/bug priority/important-soon triage-accepted
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
kelos-dev/kelos#1804 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
`date` → `date-time` (and `time` → `date-time`) is classified as a widening, but a date is not a valid date-timePossibly taken @reuvenharrison claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
fix: invalid GPU spec in SparkApplication is silently ignoredPossibly taken @pratik-naik003 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
kubeflow/spark-operator#3223 ·
Maintainers usually reply within 5 days