Documentation ¶
Overview ¶
This package deals with sets of metric labels and lists of label values.
Index ¶
- type RuneList
- type Set
- func (ls *Set) Init(skipKeys []string, labelDescs []*monitoring.LabelDescriptor, ...)
- func (ls *Set) KeptKeys() []string
- func (ls *Set) LabelPairs(rl RuneList) []*dto.LabelPair
- func (ls *Set) Len() int
- func (ls *Set) RuneList(metricLabels map[string]string, resourceLabels map[string]string) RuneList
- func (ls *Set) ValueList(rl RuneList) []string
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RuneList ¶
type RuneList string
A RuneList is just a string. It is used to store a list of values of type `rune`.
type Set ¶
type Set struct { SkippedKeys []string // Sorted list of omitted label names. // contains filtered or unexported fields }
A label.Set tracks the possible label names and seen label values for a metric.
func (*Set) Init ¶
func (ls *Set) Init( skipKeys []string, labelDescs []*monitoring.LabelDescriptor, resourceLabels map[string]bool, )
Initializes a new label.Set to track the passed-in metric labels and resource labels, ignoring any labels in `skipKeys`.
func (*Set) LabelPairs ¶
Converts a RuneList into a list of LabelPairs ready to export.
type Values ¶
type Values struct {
// contains filtered or unexported fields
}
A label.Values contains all of the seen label values (regardless of label name) and provides a mapping between each unique value and a rune. This allows a list of label values to be recorded very compactly (in a short string) which also provides an efficient way to find the prior metric having identical label values (via a map[string] type).