Documentation ¶
Index ¶
- Constants
- func Compare(a, b Labels) int
- func Equal(ls, o Labels) bool
- type Builder
- type Label
- type Labels
- func (ls Labels) Copy() Labels
- func (ls Labels) Get(name string) string
- func (ls Labels) Hash() uint64
- func (ls Labels) Len() int
- func (ls Labels) Less(i, j int) bool
- func (ls Labels) Map() map[string]string
- func (ls Labels) MarshalJSON() ([]byte, error)
- func (ls Labels) String() string
- func (ls Labels) Swap(i, j int)
- func (ls *Labels) UnmarshalJSON(b []byte) error
- type MatchType
- type Matcher
Constants ¶
View Source
const ( MetricName = "__name__" AlertName = "alertname" BucketLabel = "le" InstanceName = "instance" )
Well-known label names used by Prometheus components.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
LabelsBuilder allows modifiying Labels.
type Labels ¶
type Labels []Label
Labels is a sorted set of labels. Order has to be guaranteed upon instantiation.
func FromStrings ¶
FromStrings creates new labels from pairs of strings.
func New ¶
New returns a sorted Labels from the given labels. The caller has to guarantee that all label names are unique.
func (Labels) Get ¶
Get returns the value for the label with the given name. Returns an empty string if the label doesn't exist.
func (Labels) MarshalJSON ¶
func (*Labels) UnmarshalJSON ¶
type Matcher ¶
type Matcher struct { Type MatchType Name string Value string // contains filtered or unexported fields }
Matcher models the matching of a label.
func NewMatcher ¶
NewMatcher returns a matcher object.
Click to show internal directories.
Click to hide internal directories.