Documentation ¶
Overview ¶
Package datadog contains a Datadog exporter for OpenCensus.
Index ¶
Constants ¶
const ( // DefaultStatsAddrUDP specifies the default protocol (UDP) and address // for the DogStatsD service. DefaultStatsAddrUDP = "localhost:8125" // DefaultStatsAddrUDS specifies the default socket address for the // DogStatsD service over UDS. Only useful for platforms supporting unix // sockets. DefaultStatsAddrUDS = "unix:///var/run/datadog/dsd.socket" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter exports stats to Datadog.
func NewExporter ¶
NewExporter returns an exporter that exports stats and traces to Datadog. When using trace, it is important to call Stop at the end of your program for a clean exit and to flush any remaining tracing data to the Datadog agent. If an error occurs initializing the stats exporter, the error will be returned and the exporter will be nil.
func (*Exporter) ExportSpan ¶
ExportSpan implements trace.Exporter.
func (*Exporter) ExportView ¶
ExportView implements view.Exporter.
func (*Exporter) Stop ¶
func (e *Exporter) Stop()
Stop cleanly stops the exporter, flushing any remaining spans and stats to the transport and reporting any errors. Make sure to always call Stop at the end of your program in order to not lose any tracing data. Only call Stop once per exporter. Repeated calls will cause panic.
type Options ¶
type Options struct { // Namespace specifies the namespaces to which metric keys are appended. Namespace string // Service specifies the service name used for tracing. Service string // TraceAddr specifies the host[:port] address of the Datadog Trace Agent. // It defaults to localhost:8126. TraceAddr string // StatsAddr specifies the host[:port] address for DogStatsD. It defaults // to localhost:8125. StatsAddr string // OnError specifies a function that will be called if an error occurs during // processing stats or metrics. OnError func(err error) // Tags specifies a set of global tags to attach to each metric. Tags []string // GlobalTags holds a set of tags that will automatically be applied to all // exported spans. GlobalTags map[string]interface{} // DisableCountPerBuckets specifies whether to emit count_per_bucket metrics DisableCountPerBuckets bool // TagMetricNames specifies whether to include tags to metric names. TagMetricNames bool // HistogramPercentiles specifies percentiles for Distribution metrics e.g. ["0.5", "0.95", "0.99"] // For each percentile a metric is created e.g. metric_name.99percentile, metric_name.95percentile // Note: precision of percentile metrics directly depend on granularity of Opencensus distribution buckets, // more buckets granularity lead to better precision. HistogramPercentiles []string }
Options contains options for configuring the exporter.