Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultRelabelConfig = Config{
Action: Replace,
Separator: ";",
Regex: mustNewRegexp("(.*)"),
Replacement: "$1",
}
DefaultRelabelConfig sets the default values of fields when decoding a RelabelConfig block.
Functions ¶
func ComponentToPromRelabelConfigs ¶
func ComponentToPromRelabelConfigs(rcs []*Config) []*relabel.Config
ComponentToPromRelabelConfigs bridges the Compnoent-based configuration of relabeling steps to the Prometheus implementation.
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 ¶
func (a Action) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler for Action.
func (Action) String ¶
func (a Action) String() string
String returns the string representation of the Action type.
func (*Action) UnmarshalText ¶
func (a *Action) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler for Action.
type Config ¶
type Config struct {
SourceLabels []string `river:"source_labels,attr,optional"`
Separator string `river:"separator,attr,optional"`
Regex Regexp `river:"regex,attr,optional"`
Modulus uint64 `river:"modulus,attr,optional"`
TargetLabel string `river:"target_label,attr,optional"`
Replacement string `river:"replacement,attr,optional"`
Action Action `river:"action,attr,optional"`
}
Config describes a relabelling step to be applied on a target.
func (*Config) UnmarshalRiver ¶
func (rc *Config) UnmarshalRiver(f func(interface{}) error) error
UnmarshalRiver implements river.Unmarshaler.
type Regexp ¶
type Regexp struct {
*regexp.Regexp
}
Regexp encapsulates the Regexp type from Grafana's fork of the Go stdlib regexp package.
func (Regexp) MarshalText ¶
func (re Regexp) MarshalText() (text []byte, err error)
MarshalText implements encoding.TextMarshaler for Regexp.
func (*Regexp) UnmarshalText ¶
func (re *Regexp) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler for Regexp.