This is not a supported pattern. It interacts badly with the metrics.html generation (which uses cockroach gen metric-list), resulting in non-deterministic results.
This issue tracks fixing this. We should replace the category string with an enum value. Pebble can export a RegisterCategory("name") that we can call from init code. Then newStoreMetrics can enumerate all the categories. This will also get rid of pebbleCategoryIterMetricsContainer.metricsMap (we can use a simple immutable array).
We initialize the Pebble category stats lazily here: https://github.com/cockroachdb/cockroach/blob/master/pkg/kv/kvserver/metrics.go#L4142
This is not a supported pattern. It interacts badly with the metrics.html generation (which uses
cockroach gen metric-list
), resulting in non-deterministic results.This issue tracks fixing this. We should replace the category string with an enum value. Pebble can export a
RegisterCategory("name")
that we can call frominit
code. ThennewStoreMetrics
can enumerate all the categories. This will also get rid ofpebbleCategoryIterMetricsContainer.metricsMap
(we can use a simple immutable array).Jira issue: CRDB-43648