Metrics exporter publishes NaN for per CPU, disk and network metrics on ClickHouse 26.8

Aperta
#2,135 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@Slach ci sta già lavorando.

Dal 6/11/2026.

  • #2136 di @lizardoluis — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, kubernetes
Ambito
observability

Direzione di ricerca

Start in pkg/metrics/clickhouse/clickhouse_metrics_fetcher.go at queryMetricsSQLTemplate, then read the existing excludeRegexp handling. Run test_010051 against ClickHouse 26.8 to check the CPU metric pattern; done means keyed asynchronous metrics are exported with the expected labels and values, and the existing per-CPU exclusions still work. The issue author says they already have a patch and plan to open a draft PR.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Summary

ClickHouse 26.8 changed how it publishes the asynchronous metrics that are broken down per CPU core, block device, network interface, disk, temperature sensor, memory controller and logging channel. The metrics exporter only reads the metric and value columns of system.asynchronous_metrics, so on 26.8 it exposes these metrics as a single series with value NaN and drops the real values.

Details

The new server setting asynchronous_metrics_key_values_mode defaults to key_values in 26.8. In that mode each family is one row in system.asynchronous_metrics: value is nan and the per key values are in the new key_values Map column.

26.3 26.8
system.asynchronous_metrics rows matching OS.*CPU[0-9]+ OSUserTimeCPU0 ... OSUserTimeCPU9 none
Row for the family none OSUserTimeCPU, value = nan, key_values = {'0': ..., '1': ...}

What the exporter returns on 26.8:

chi_clickhouse_metric_OSUserTimeCPU{chi="...",hostname="...",namespace="..."} NaN

Affected families, from the setting's documentation: per CPU core (OSUserTimeCPU, OSIdleTimeCPU, CPUFrequencyMHz, ...), block device (BlockReadBytes, ...), network interface (NetworkReceiveBytes, ...), disk (DiskTotal, ...), temperature sensor, memory controller (EDAC...) and logging channel.

This is also what makes test_010051 fail on 26.8: its CPU metric pattern never matches.

The setting can restore the old names (asynchronous_metrics_key_values_mode: legacy_names or both), but the exporter should handle the default.

Where

pkg/metrics/clickhouse/clickhouse_metrics_fetcher.go, queryMetricsSQLTemplate, on the 0.28.0 branch (the query is the same in 0.27.4).

Proposed fix

Detect the key_values column in system.columns, then read the keyed rows with ARRAY JOIN key_values AS kv and publish each as the same metric name with a key label. Apply the existing excludeRegexp filters to the pre 26.8 name of the series (OSUserTimeCPU3, CPUFrequencyMHz_0), so the default per CPU exclusion keeps working. I have a patch and will open a draft PR.

Lingua principale
Go
Stelle
2.6k
Fork
584
Merge medio
4g 11h
PR unite (30g)
15

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Altinity/clickhouse-operator

Tutte le issue di Altinity/clickhouse-operator

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.