package datadog

import "github.com/hashicorp/go-metrics/datadog"

Index

Types

type DogStatsdSink

type DogStatsdSink struct {
	// contains filtered or unexported fields
}

DogStatsdSink provides a MetricSink that can be used with a dogstatsd server. It utilizes the Dogstatsd client at github.com/DataDog/datadog-go/statsd

func NewDogStatsdSink

func NewDogStatsdSink(addr string, hostName string) (*DogStatsdSink, error)

NewDogStatsdSink is used to create a new DogStatsdSink with sane defaults

func (*DogStatsdSink) AddSample

func (s *DogStatsdSink) AddSample(key []string, val float32)

func (*DogStatsdSink) AddSampleWithLabels

func (s *DogStatsdSink) AddSampleWithLabels(key []string, val float32, labels []metrics.Label)

func (*DogStatsdSink) EmitKey

func (s *DogStatsdSink) EmitKey(key []string, val float32)

EmitKey is not implemented since DogStatsd does not provide a metric type that holds an arbitrary number of values

func (*DogStatsdSink) EnableHostNamePropagation

func (s *DogStatsdSink) EnableHostNamePropagation()

EnableHostnamePropagation forces a Dogstatsd `host` tag with the value specified by `s.HostName` Since the go-metrics package has its own mechanism for attaching a hostname to metrics, setting the `propagateHostname` flag ensures that `s.HostName` overrides the host tag naively set by the DogStatsd server

func (*DogStatsdSink) IncrCounter

func (s *DogStatsdSink) IncrCounter(key []string, val float32)

func (*DogStatsdSink) IncrCounterWithLabels

func (s *DogStatsdSink) IncrCounterWithLabels(key []string, val float32, labels []metrics.Label)

func (*DogStatsdSink) SetGauge

func (s *DogStatsdSink) SetGauge(key []string, val float32)

func (*DogStatsdSink) SetGaugeWithLabels

func (s *DogStatsdSink) SetGaugeWithLabels(key []string, val float32, labels []metrics.Label)

The following ...WithLabels methods correspond to Datadog's Tag extension to Statsd. http://docs.datadoghq.com/guides/dogstatsd/#tags

func (*DogStatsdSink) SetPrecisionGauge

func (s *DogStatsdSink) SetPrecisionGauge(key []string, val float64)

func (*DogStatsdSink) SetPrecisionGaugeWithLabels

func (s *DogStatsdSink) SetPrecisionGaugeWithLabels(key []string, val float64, labels []metrics.Label)

The following ...WithLabels methods correspond to Datadog's Tag extension to Statsd. http://docs.datadoghq.com/guides/dogstatsd/#tags

func (*DogStatsdSink) SetTags

func (s *DogStatsdSink) SetTags(tags []string)

SetTags sets common tags on the Dogstatsd Client that will be sent along with all dogstatsd packets. Ref: http://docs.datadoghq.com/guides/dogstatsd/#tags

func (*DogStatsdSink) Shutdown

func (s *DogStatsdSink) Shutdown()

Shutdown disables further metric collection, blocks to flush data, and tears down the sink.

Source Files

dogstatsd.go

Version
v0.5.4 (latest)
Published
Jan 8, 2025
Platform
linux/amd64
Imports
4 packages
Last checked
1 day ago

Tools for package owners.