Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{ DefaultPrefix: "", EnableTags: false, UseOpenMetricsFormat: false, Write: WriteConfig{ CarbonAddress: "", CarbonTransport: "tcp", CarbonReconnectInterval: 1 * time.Hour, EnablePathsCache: true, PathsCacheTTL: 1 * time.Hour, PathsCachePurgeInterval: 2 * time.Hour, }, Read: ReadConfig{ URL: "", }, }
DefaultConfig is the default graphite configuration.
Functions ¶
func AddCommandLine ¶
func AddCommandLine(app *kingpin.Application, cfg *Config)
AddCommandLine setup Graphite specific cli args and flags.
Types ¶
type Config ¶
type Config struct { Write WriteConfig `yaml:"write,omitempty" json:"write,omitempty"` Read ReadConfig `yaml:"read,omitempty" json:"read,omitempty"` DefaultPrefix string `yaml:"default_prefix,omitempty" json:"default_prefix,omitempty"` EnableTags bool `yaml:"enable_tags,omitempty" json:"enable_tags,omitempty"` UseOpenMetricsFormat bool `yaml:"openmetrics,omitempty" json:"openmetrics,omitempty"` // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} `yaml:",inline" json:"-"` }
Config is the graphite configuration.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type LabelSet ¶
type LabelSet map[model.LabelName]model.LabelValue
LabelSet pairs a LabelName to a LabelValue.
type LabelSetRE ¶
LabelSetRE defines pairs like LabelSet but does regular expression
type ReadConfig ¶
type ReadConfig struct { URL string `yaml:"url,omitempty" json:"url,omitempty"` // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} `yaml:",inline" json:"-"` }
ReadConfig is the read graphite configuration.
func (*ReadConfig) UnmarshalYAML ¶
func (c *ReadConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Regexp ¶
Regexp encapsulates a regexp.Regexp and makes it YAML marshalable.
func (Regexp) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (Regexp) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface.
func (*Regexp) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Rule ¶
type Rule struct { Tmpl Template `yaml:"template,omitempty" json:"template,omitempty"` Match LabelSet `yaml:"match,omitempty" json:"match,omitempty"` MatchRE LabelSetRE `yaml:"match_re,omitempty" json:"match_re,omitempty"` Continue bool `yaml:"continue,omitempty" json:"continue,omitempty"` // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} `yaml:",inline" json:"-"` }
Rule defines a templating rule that customize graphite path using the Tmpl if a metric matching the labels exists.
func (*Rule) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type Template ¶
Template is a parsable template.
func (Template) MarshalYAML ¶
MarshalYAML implements the yaml.Marshaler interface.
func (*Template) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.
type WriteConfig ¶
type WriteConfig struct { CarbonAddress string `yaml:"carbon_address,omitempty" json:"carbon_address,omitempty"` CarbonTransport string `yaml:"carbon_transport,omitempty" json:"carbon_transport,omitempty"` CarbonReconnectInterval time.Duration `yaml:"carbon_reconnect_interval,omitempty" json:"carbon_reconnect_interval,omitempty"` EnablePathsCache bool `yaml:"enable_paths_cache,omitempty" json:"enable_paths_cache,omitempty"` PathsCacheTTL time.Duration `yaml:"paths_cache_ttl,omitempty" json:"paths_cache_ttl,omitempty"` PathsCachePurgeInterval time.Duration `yaml:"paths_cache_purge_interval,omitempty" json:"paths_cache_purge_interval,omitempty"` TemplateData map[string]interface{} `yaml:"template_data,omitempty" json:"template_data,omitempty"` Rules []*Rule `yaml:"rules,omitempty" json:"rules,omitempty"` // Catches all undefined fields and must be empty after parsing. XXX map[string]interface{} `yaml:",inline" json:"-"` }
WriteConfig is the write graphite configuration.
func (*WriteConfig) UnmarshalYAML ¶
func (c *WriteConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements the yaml.Unmarshaler interface.