Documentation ¶
Index ¶
- func CreateMetricSink(server *veneur.Server, name string, logger *logrus.Entry, config veneur.Config, ...) (sinks.MetricSink, error)
- func CreateSpanSink(server *veneur.Server, name string, logger *logrus.Entry, config veneur.Config, ...) (sinks.SpanSink, error)
- func MigrateConfig(conf *veneur.Config)
- func ParseMetricConfig(name string, config interface{}) (veneur.MetricSinkConfig, error)
- func ParseSpanConfig(name string, config interface{}) (veneur.SpanSinkConfig, error)
- type DDEvent
- type DDMetric
- type DDServiceCheck
- type DatadogMetricSink
- func (dd *DatadogMetricSink) Flush(ctx context.Context, interMetrics []samplers.InterMetric) error
- func (dd *DatadogMetricSink) FlushOtherSamples(ctx context.Context, samples []ssf.SSFSample)
- func (dd *DatadogMetricSink) Name() string
- func (dd *DatadogMetricSink) SetExcludedTags(excludes []string)
- func (dd *DatadogMetricSink) Start(cl *trace.Client) error
- type DatadogMetricSinkConfig
- type DatadogSpanSink
- type DatadogSpanSinkConfig
- type DatadogTraceSpan
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMetricSink ¶ added in v14.2.0
func CreateMetricSink( server *veneur.Server, name string, logger *logrus.Entry, config veneur.Config, sinkConfig veneur.MetricSinkConfig, ) (sinks.MetricSink, error)
CreateMetricSink creates a new Datadog sink for metrics. This function should match the signature of a value in veneur.MetricSinkTypes, and is intended to be passed into veneur.NewFromConfig to be called based on the provided configuration.
func CreateSpanSink ¶ added in v14.2.0
func CreateSpanSink( server *veneur.Server, name string, logger *logrus.Entry, config veneur.Config, sinkConfig veneur.SpanSinkConfig, ) (sinks.SpanSink, error)
CreateSpanSink creates a new Datadog sink for spans. This function should match the signature of a value in veneur.SpanSinkTypes, and is intended to be passed into veneur.NewFromConfig to be called based on the provided configuration.
func MigrateConfig ¶ added in v14.2.0
func MigrateConfig(conf *veneur.Config)
TODO(arnavdugar): Remove this once the old configuration format has been removed.
func ParseMetricConfig ¶ added in v14.2.0
ParseMetricConfig decodes the map config for a Datadog metric sink into a DatadogMetricSinkConfig struct.
func ParseSpanConfig ¶ added in v14.2.0
ParseSpanConfig decodes the map config for a Datadog span sink into a DatadogSpanSinkConfig struct.
Types ¶
type DDEvent ¶
type DDEvent struct { Title string `json:"msg_title"` Text string `json:"msg_text"` Timestamp int64 `json:"timestamp,omitempty"` // represented as a unix epoch Hostname string `json:"host,omitempty"` Aggregation string `json:"aggregation_key,omitempty"` Priority string `json:"priority,omitempty"` Source string `json:"source_type_name,omitempty"` AlertType string `json:"alert_type,omitempty"` Tags []string `json:"tags,omitempty"` }
DDEvent represents the structure of datadog's undocumented /intake endpoint
type DDMetric ¶
type DDMetric struct { Name string `json:"metric"` Value [1][2]float64 `json:"points"` Tags []string `json:"tags,omitempty"` MetricType string `json:"type"` Hostname string `json:"host,omitempty"` DeviceName string `json:"device_name,omitempty"` Interval int32 `json:"interval,omitempty"` }
DDMetric is a data structure that represents the JSON that Datadog wants when posting to the API
type DDServiceCheck ¶
type DDServiceCheck struct { Name string `json:"check"` Status int `json:"status"` Hostname string `json:"host_name"` Timestamp int64 `json:"timestamp,omitempty"` // represented as a unix epoch Tags []string `json:"tags,omitempty"` Message string `json:"message,omitempty"` }
DDServiceCheck is a representation of the service check.
type DatadogMetricSink ¶
type DatadogMetricSink struct { HTTPClient *http.Client APIKey string DDHostname string // contains filtered or unexported fields }
func (*DatadogMetricSink) Flush ¶
func (dd *DatadogMetricSink) Flush(ctx context.Context, interMetrics []samplers.InterMetric) error
Flush sends metrics to Datadog
func (*DatadogMetricSink) FlushOtherSamples ¶
func (dd *DatadogMetricSink) FlushOtherSamples(ctx context.Context, samples []ssf.SSFSample)
FlushOtherSamples serializes Events or Service Checks directly to datadog. May make 2 external calls to the datadog client.
func (*DatadogMetricSink) Name ¶
func (dd *DatadogMetricSink) Name() string
Name returns the name of this sink.
func (*DatadogMetricSink) SetExcludedTags ¶
func (dd *DatadogMetricSink) SetExcludedTags(excludes []string)
SetExcludedTags sets the excluded tag names. Any tags with the provided key (name) will be excluded.
type DatadogMetricSinkConfig ¶ added in v14.2.0
type DatadogMetricSinkConfig struct { APIKey string `yaml:"api_key"` APIHostname string `yaml:"api_hostname"` FlushMaxPerBody int `yaml:"flush_max_per_body"` MetricNamePrefixDrops []string `yaml:"metric_name_prefix_drops"` ExcludeTagsPrefixByPrefixMetric []struct { MetricPrefix string `yaml:"metric_prefix"` Tags []string `yaml:"tags"` } `yaml:"exclude_tags_prefix_by_prefix_metric"` }
type DatadogSpanSink ¶
DatadogSpanSink is a sink for sending spans to a Datadog trace agent.
func (*DatadogSpanSink) Flush ¶
func (dd *DatadogSpanSink) Flush()
Flush signals the sink to send it's spans to their destination. For this sync it means we'll be making an HTTP request to send them along. We assume it's beneficial to performance to defer these until the normal 10s flush.
func (*DatadogSpanSink) Ingest ¶
func (dd *DatadogSpanSink) Ingest(span *ssf.SSFSpan) error
Ingest takes the span and adds it to the ringbuffer.
func (*DatadogSpanSink) Name ¶
func (dd *DatadogSpanSink) Name() string
Name returns the name of this sink.
type DatadogSpanSinkConfig ¶ added in v14.2.0
type DatadogTraceSpan ¶
type DatadogTraceSpan struct { Duration int64 `json:"duration"` Error int64 `json:"error"` Meta map[string]string `json:"meta"` Metrics map[string]float64 `json:"metrics"` Name string `json:"name"` ParentID int64 `json:"parent_id,omitempty"` Resource string `json:"resource,omitempty"` Service string `json:"service"` SpanID int64 `json:"span_id"` Start int64 `json:"start"` TraceID int64 `json:"trace_id"` Type string `json:"type"` }
DatadogTraceSpan represents a trace span as JSON for the Datadog tracing API.