Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRelabelConfig = RelabelConfig{ Action: Replace, Separator: ";", Regex: mustNewRegexp("(.*)"), Replacement: "$1", }
DefaultRelabelConfig sets the default values of fields when decoding a RelabelConfig block.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action string
Action is the relabelling action to be performed.
const ( Replace Action = "replace" Keep Action = "keep" Drop Action = "drop" HashMod Action = "hashmod" LabelMap Action = "labelmap" LabelDrop Action = "labeldrop" LabelKeep Action = "labelkeep" Lowercase Action = "lowercase" Uppercase Action = "uppercase" )
All possible Action values.
func (Action) MarshalText ¶
MarshalText implements encoding.TextMarshaler for Action.
func (*Action) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler for Action.
type Arguments ¶
type Arguments struct { // Targets contains the input 'targets' passed by a service discovery component. Targets []Target `hcl:"targets"` // The relabelling steps to apply to the each target's label set. RelabelConfigs []*RelabelConfig `hcl:"relabel_config,block"` }
Arguments holds values which are used to configure the targets.mutate component.
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
Component implements the targets.mutate component.
type Exports ¶
type Exports struct {
Output []Target `hcl:"output,attr"`
}
Exports holds values which are exported by the targets.mutate component.
type Regexp ¶
Regexp encapsulates the Regexp type from Grafana's fork of the Go stdlib regexp package.
func (Regexp) MarshalText ¶
MarshalText implements encoding.TextMarshaler for Regexp.
func (*Regexp) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler for Regexp.
type RelabelConfig ¶
type RelabelConfig struct { SourceLabels []string `hcl:"source_labels,optional"` Separator string `hcl:"separator,optional"` Regex Regexp `hcl:"regex,optional"` Modulus uint64 `hcl:"modulus,optional"` TargetLabel string `hcl:"target_label,optional"` Replacement string `hcl:"replacement,optional"` Action Action `hcl:"action,optional"` }
RelabelConfig describes a relabelling step to be applied on a target.
func (*RelabelConfig) DecodeHCL ¶
func (rc *RelabelConfig) DecodeHCL(body hcl.Body, ctx *hcl.EvalContext) error
DecodeHCL implements gohcl.Decoder. This method is only called on blocks, not objects.
type Target ¶
Target refers to a singular HTTP or HTTPS endpoint that will be used for scraping. Here, we're using a map[string]string instead of labels.Labels; if the label ordering is important, we can change to follow the upstream logic instead. TODO (@tpaschalis) Maybe the target definitions should be part of the Service Discovery components package. Let's reconsider once it's ready.