Documentation ¶
Overview ¶
Package datadog provides types and functions to export metrics and logs to Datadog via a statds client.
Index ¶
- Variables
- func NewHook(level log.Level, client *statsd.Client, host string) log.Hook
- type Client
- func (c *Client) DeltaCount(name string, delta int64)
- func (c *Client) DeltaCountWithTags(name string, delta int64, tags []string)
- func (c *Client) Duration(name string, value time.Duration)
- func (c *Client) DurationWithTags(name string, value time.Duration, tags []string)
- func (c *Client) Gauge(name string, value float64)
- func (c *Client) GaugeWithTags(name string, value float64, tags []string)
- func (c *Client) Histogram(name string, value float64)
- func (c *Client) HistogramWithTags(name string, value float64, tags []string)
- func (c *Client) RawCount(name string, value int64)
- func (c *Client) RawCountWithTags(name string, value int64, tags []string)
- type Config
Constants ¶
This section is empty.
Variables ¶
var Desc = baker.MetricsDesc{ Name: "Datadog", Config: &Config{}, New: newClient, }
Desc describes the Datadog metrics client inteface.
Functions ¶
func NewHook ¶
NewHook returns a Logrus hook that forwards log entries as events to a statsd client, such as the datadog-agent.
Log entries with a level higher than level are discarded. host is used to fill the Hostname field of statsd events, its purpose it NOT to serve as configuring the stats connection (the client must already be configured). tags is a list of tags to include with all events.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows to instrument code and export the metrics to a dogstatds client.
func (*Client) DeltaCount ¶
DeltaCount increments the value of a metric of type counter by delta. delta must be positive.
func (*Client) DeltaCountWithTags ¶
DeltaCountWithTags increments the value of a metric or type counter and associates that value with a set of tags.
func (*Client) Duration ¶
Duration adds a duration to a metric of type histogram. A histogram samples observations and counts them in different 'buckets'. Duration is basically an histogram but allows to sample values of type time.Duration.
In Datadog, this is shown as a 'Timer', an implementation of an 'Histogram' DogStatsd metric type, on which percentiles, mean and other info are calculated. see https://docs.datadoghq.com/developers/dogstatsd/data_types/#timers
func (*Client) DurationWithTags ¶
DurationWithTags adds a duration to an histogram and associates that duration with a set of tags.
func (*Client) Gauge ¶
Gauge sets the value of a metric of type gauge. A Gauge represents a single numerical data point that can arbitrarily go up and down.
func (*Client) GaugeWithTags ¶
GaugeWithTags sets the value of a metric of type gauge and associates that value with a set of tags.
func (*Client) Histogram ¶
Histogram adds a sample to a metric of type histogram. A histogram samples observations and counts them in different 'buckets' in order to track and show the statistical distribution of a set of values.
In Datadog, this is shown as an 'Histogram', a DogStatsd metric type on which percentiles, mean and other info are calculated. see https://docs.datadoghq.com/developers/dogstatsd/data_types/#histograms
func (*Client) HistogramWithTags ¶
HistogramWithTags adds a sample to an histogram and associates that sample with a set of tags.
type Config ¶
type Config struct { Prefix string // Prefix is the prefix of all metric names. defaults to baker. Host string // Host is the address (host:port) of the statsd host to send log to (in UDP). defaults to 127.0.0.1:8125. Tags []string // Tags is the list of tags to attach to all metrics. SendLogs bool `toml:"send_logs"` // SendLogs indicates whether logs should be sent (as statds events) to the statsd client at Host. }
Config is the configuration of the Datadog metrics client.