From 92e5dfabc097d15d999ad2eb98b79e07d633d515 Mon Sep 17 00:00:00 2001 From: Anna Kapuscinska Date: Wed, 3 Jul 2024 10:30:03 +0100 Subject: [PATCH] metrics: Improve doc of FilteredLabels interface Signed-off-by: Anna Kapuscinska --- pkg/metrics/doc.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/metrics/doc.go b/pkg/metrics/doc.go index 8eb97cf926c..80f0e3a54b8 100644 --- a/pkg/metrics/doc.go +++ b/pkg/metrics/doc.go @@ -40,9 +40,14 @@ // // `ConstrainedLabel` and `UnconstrainedLabel` structs represent metric labels. // -// `FilteredLabels` interface represents configurable labels, passed to metrics -// via type parameter. The values are always unconstrained. `NilLabels` package -// variable is a special case of `FilteredLabels` with no labels. +// `FilteredLabels` interface represents configurable labels. It's intended to +// be used as a type parameter when defining a granular metric, to add common +// labels. The idea is that users can configure which of these (potentially +// high-cardinality) labels are actually exposed - see `CreateProcessLabels` in +// `pkg/option` for an example. The values of these labels are always +// unconstrained. `NilLabels` package variable is a special case of +// `FilteredLabels` with no labels, which is used in convenience wrappers +// around granular metrics. // // `GranularCounter[L FilteredLabels]` (and analogous Gauge and Histogram) // struct is a wrapper around `prometheus.CounterVec` (Gauge, Histogram) with