Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
MetricConfigs []MetricParser `yaml:"metric_configs,omitempty"`
// Catchall
XXX map[string]string `yaml:",inline"`
Original string
}
type ErrorInvalidMetricType ¶
type ErrorInvalidMetricType struct{}
func (ErrorInvalidMetricType) Error ¶
func (this ErrorInvalidMetricType) Error() string
type LabelDef ¶
type LabelDef struct {
Name LabelValueDef `yaml:"name,omitempty"`
Value LabelValueDef `yaml:"value,omitempty"`
// Optional parameter: specify a default value for a missing key
Default string
HasDefault bool
// contains filtered or unexported fields
}
func (*LabelDef) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface.
func (*LabelDef) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type LabelValueDef ¶
type LabelValueDef struct {
FieldType LabelValueType
Literal string
CaptureGroup int
CaptureGroupName string
}
Defines a type which sets ascii label values
func (*LabelValueDef) MarshalYAML ¶
func (this *LabelValueDef) MarshalYAML() (interface{}, error)
MarshalYAML implements the yaml.Marshaler interface.
func (*LabelValueDef) UnmarshalYAML ¶
func (this *LabelValueDef) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type LabelValueType ¶
type LabelValueType int
const ( LabelValueLiteral LabelValueType = iota LabelValueCaptureGroup LabelValueType = iota LabelValueCaptureGroupNamed LabelValueType = iota )
type MetricParser ¶
type MetricParser struct {
Name string `yaml:"name,omitempty"`
Type MetricType `yaml:"type,omitempty"`
Help string `yaml:"help,omitempty"`
Regex Regexp `yaml:"regex,omitempty"`
Labels []LabelDef `yaml:"labels,omitempty"`
Value ValueDef `yaml:"value,omitempty"`
Timeout model.Duration `yaml:"timeout,omitempty"`
}
func (*MetricParser) UnmarshalYAML ¶
func (this *MetricParser) UnmarshalYAML(unmarshal func(interface{}) error) error
type MetricParserErrorNoHelp ¶
type MetricParserErrorNoHelp struct{}
func (MetricParserErrorNoHelp) Error ¶
func (this MetricParserErrorNoHelp) Error() string
type MetricType ¶
type MetricType int
Metric type definitions
const ( MetricUntyped MetricType = iota MetricGauge MetricType = iota MetricCounter MetricType = iota )
func (*MetricType) MarshalYAML ¶
func (this *MetricType) MarshalYAML() (interface{}, error)
func (*MetricType) UnmarshalYAML ¶
func (this *MetricType) UnmarshalYAML(unmarshal func(interface{}) error) error
type Regexp ¶
Regexp encapsulates a regexp.Regexp and makes it YAML marshallable.
func MustNewRegexp ¶
func MustNewRegexp(s flaggedRegex) *Regexp
MustNewRegexp works like NewRegexp, but panics if the regular expression does not compile.
func NewRegexp ¶
NewRegexp creates a new anchored Regexp and returns an error if the passed-in regular expression does not compile.
func (*Regexp) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface.
func (*Regexp) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type RegexpCompileError ¶
type RegexpCompileError struct {
*pcre.CompileError
}
RegexpCompileError wraps the pcre Compile error
func (RegexpCompileError) Error ¶
func (this RegexpCompileError) Error() string
type RegexpFlagsError ¶
type RegexpFlagsError struct {
// contains filtered or unexported fields
}
RegexpFlagsError provides a useful error message when bad flags are found for the supplied regexp
func (RegexpFlagsError) Error ¶
func (this RegexpFlagsError) Error() string
type ValueDef ¶
type ValueDef struct {
ValueOp ValueOpType
ValueSource ValueSourceType
Literal float64
CaptureGroup int
CaptureGroupName string
}
ValueDef is the definition for numeric values which will be assigned to metrics
func (*ValueDef) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface
func (*ValueDef) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type ValueOpType ¶
type ValueOpType int
ValueSourceType specifies the sourcex
const ( ValueOpAdd ValueOpType = iota ValueOpSubtract ValueOpEquals )
type ValueSourceType ¶
type ValueSourceType int
const ( // Assign the specified value directly to the metric ValueSourceLiteral ValueSourceType = iota // Assign the value from the capture group to the metric ValueSourceCaptureGroup // Assign the value frm the given named capture group to the metric ValueSourceNamedCaptureGroup )