Skip to content

Commit

Permalink
metrics: Improve doc of FilteredLabels interface
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
  • Loading branch information
lambdanis committed Jul 3, 2024
1 parent fd703ad commit 92e5dfa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/metrics/doc.go
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 92e5dfa

Please # to comment.