Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NoneLabelMatcher = []*labels.Matcher{{ Name: "__", Value: "none", Type: labels.MatchEqual, }}
NoneLabelMatcher is a prometheus label matcher that fails for all metrics
Functions ¶
func MustParseLabels ¶
MustParseLabels is a ParseLabels version that panics on error
Types ¶
type Labeler ¶
type Labeler struct {
// contains filtered or unexported fields
}
Labeler provides the relabeling functions and thracks the metrics
func (*Labeler) AddLabels ¶
AddLabels reversively walks through a promql.Expr and adds the LabelMatches provided by core.ACL to every metric
This function tries to follow the same flow as Promtheus eval https://github.com/prometheus/prometheus/blob/master/promql/engine.go#L923
func (*Labeler) DedupeMatchers ¶
DedupeMatchers tries to find Matchers that do the same stuff and remove the more cpu intersive version.
func (*Labeler) PromACLMiddlewareFor ¶
PromACLMiddlewareFor generates a Middleware for a URL that modifies Prometheus Queries by injecting additional Labels. These labels are provided by a core.ACL interface via the requests Context