Documentation ¶
Overview ¶
Package metrics handles metrics.
This is a wrapper around Code Hale's Metrics library. It also setups the supported exporters.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
func NewHTTPClient(config PromPushGWConfiguration) (*http.Client, error)
NewHTTPClient creates an HTTP client for a given config.
Types ¶
type CollectdConfiguration ¶
CollectdConfiguration represents the configuration for exporting metrics to collectd
func (*CollectdConfiguration) UnmarshalYAML ¶
func (c *CollectdConfiguration) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML parses a configuration for collectd from YAML.
type Configuration ¶
type Configuration []ExporterConfiguration
Configuration is a list list of exporter configurations. However, we have several kind of exporters.
func (*Configuration) UnmarshalYAML ¶
func (c *Configuration) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML parses configuration for the metrics subsystem from YAML.
type ExporterConfiguration ¶
type ExporterConfiguration interface { UnmarshalYAML(f func(interface{}) error) error // contains filtered or unexported methods }
ExporterConfiguration is an interface for the configuration for an exporter.
type ExpvarConfiguration ¶
ExpvarConfiguration is the configuration for exporting metrics to expvar.
func (*ExpvarConfiguration) UnmarshalYAML ¶
func (c *ExpvarConfiguration) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML parses a configuration from YAML.
type FileConfiguration ¶
FileConfiguration is the configuration for exporting metrics to files.
func (*FileConfiguration) UnmarshalYAML ¶
func (c *FileConfiguration) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML parses the configuration from YAML.
type Metrics ¶
type Metrics struct { Registry metrics.Registry // contains filtered or unexported fields }
Metrics represents the internal state of the metric subsystem.
func New ¶
func New(configuration Configuration, prefix string) (*Metrics, error)
New creates a new metric registry and setup the appropriate exporters. The provided prefix is used for system-wide metrics.
func (*Metrics) MustStart ¶
func (m *Metrics) MustStart()
MustStart starts the metric collection and panic if there is an error.
type PromPushGWConfiguration ¶
type PromPushGWConfiguration struct { URL string Job string CertFile config.FilePath KeyFile config.FilePath CacertFile config.FilePath // contains filtered or unexported fields }
func (*PromPushGWConfiguration) UnmarshalYAML ¶
func (c *PromPushGWConfiguration) UnmarshalYAML(unmarshal func(interface{}) error) error
type PrometheusConfiguration ¶
type PrometheusConfiguration struct { Listen config.Addr Interval config.Duration Namespace string Subsystem string CertFile config.FilePath KeyFile config.FilePath CacertFile config.FilePath }
PrometheusConfiguration is the configuration for exporting metrics to files.
func (*PrometheusConfiguration) UnmarshalYAML ¶
func (c *PrometheusConfiguration) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML parses the configuration from YAML.