Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Counter metrics are missing the conventional _total suffix

Open Beginner friendly
#2,093 1 comment 0 reactions 0 assignees View on GitHub

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:

Impact

  • Tooling that lints metrics (promtool check metrics) reports these as
    non-compliant.
  • Downstream consumers that assume the _total convention (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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Altinity/clickhouse-operator

All issues in Altinity/clickhouse-operator

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.