datadogreceiver

package module
v0.131.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 29 Imported by: 6

README

Datadog Receiver

Status
Stability alpha: traces, metrics
Distributions contrib
Issues Open issues Closed issues
Code coverage codecov
Code Owners @boostchicken, @gouthamve, @MovieStoreGuy

Overview

The Datadog receiver enables translation between Datadog and OpenTelemetry-compatible backends. It currently has support for Datadog's APM traces and Datadog metrics.

Configuration

Configuration wise is very simple, just need to specify where the Datadog receiver should listen and the read timeout.

Then, the receiver must be configured in the pipeline where it will be used.

The feature gate receiver.datadogreceiver.Enable128BitTraceID (disabled by default) enables the receiver to reconstruct 128-bit trace ids from spans coming from a datadog instrumented service. This is necessary if a trace is initiated with a 128-bit trace id by a service that then calls a datadog instrumented one. Without this, spans from the datadog instrumented service will not correlate with the other spans.

receivers:
  datadog:
    endpoint: localhost:8126
    read_timeout: 60s
    trace_id_cache_size: 100

exporters:
  debug:

service:
  pipelines:
    metrics:
      receivers: [datadog]
      exporters: [debug]
    traces:
      receivers: [datadog]
      exporters: [debug]
read_timeout (Optional)

The read timeout of the HTTP Server

Default: 60s

trace_id_cache_size (Optional)

The size of the LRU cache used to cache 64-bit trace ids and their matching 128-bit trace ids. This only has en effect when the feature gate receiver.datadogreceiver.Enable128BitTraceID is enabled.

Default: 100

HTTP Service Config

All config params here are valid as well

https://github.com/open-telemetry/opentelemetry-collector/tree/main/config/confighttp#server-configuration

/intake Config

The datadog-agent forwards metadata about its runtime environment via the /intake API endpoint. This receiver supports receiving this data and forwarding it directly to Datadog. (Note that this data isn't telemetry data, so it does not go through any configured collector pipelines.)

This feature can be enabled in the config:

receivers:
  datadog:
    intake:
      behavior: proxy
      proxy:
        api:
          key: ${env:DD_API_KEY}
          site: datadoghq.com
          fail_on_invalid_key: true
Default Attributes
  • dd.span.Resource: The datadog resource name (as distinct from the span name)
Optional Attributes
  • _dd.span_links: This receiver supports DD Agent's _dd.span_links attribute for span links creation, as produced by Datadog's tracing libraries. Format example can be found here.
Datadog's API support

Traces

Datadog API Endpoint Status Notes
/v0.3/traces Alpha Support for msgpack and json
/v0.4/traces Alpha Support for msgpack and json
/v0.5/traces Alpha Msgpack custom format
/v0.7/traces Alpha
/api/v0.2/traces Alpha

Metrics

Datadog API Endpoint Status Notes
/api/v1/series Development
/api/v2/series Development
/api/v1/check_run Development
/api/v1/sketches Development
/api/beta/sketches Development
/api/v1/distribution_points Development
/intake Development Support for proxying calls
Temporality considerations

Some backends use a different timestamp temporality than Datadog uses. Both delta and cumulative temporalities are allowed in the spec. In order to store metrics on these backends, the receiver will need to translate the timestamps. For backends that use cumulative temporality, a delta to cumulative processor can be configured in the pipeline.

Documentation

Overview

Package datadogreceiver ingests traces in the Datadog APM format and translates them OpenTelemetry for collector usage

Index

Constants

This section is empty.

Variables

View Source
var FullTraceIDFeatureGate = featuregate.GlobalRegistry().MustRegister(
	"receiver.datadogreceiver.Enable128BitTraceID",
	featuregate.StageAlpha,
	featuregate.WithRegisterDescription("When enabled, adds support for 128bits TraceIDs for spans coming from Datadog instrumented services."),
	featuregate.WithRegisterFromVersion("v0.125.0"),
	featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/36926"),
)

Functions

func NewFactory

func NewFactory() receiver.Factory

NewFactory creates a factory for DataDog receiver.

Types

type Config

type Config struct {
	confighttp.ServerConfig `mapstructure:",squash"`
	// ReadTimeout of the http server
	ReadTimeout time.Duration `mapstructure:"read_timeout"`
	// TraceIDCacheSize sets the cache size for the 64 bits to 128 bits mapping
	TraceIDCacheSize int `mapstructure:"trace_id_cache_size"`
	// Intake controls the `/intake` endpoint behavior
	Intake IntakeConfig `mapstructure:"intake"`
	// contains filtered or unexported fields
}

func (*Config) Validate added in v0.129.0

func (c *Config) Validate() error

type IntakeConfig added in v0.129.0

type IntakeConfig struct {
	// Behavior sets how the `/intake` endpoint should behave.
	// The value should be one of:
	// `disable` (default) - disable the endpoint entirely
	// `proxy` - proxy the requests to Datadog itself
	Behavior string `mapstructure:"behavior"`
	// Proxy controls how the `/intake` proxy operates
	Proxy ProxyConfig `mapstructure:"proxy"`
}

IntakeConfig controls the `/intake` endpoint behavior

type ProxyConfig added in v0.129.0

type ProxyConfig struct {
	// API defines the settings for calling Datadog with the proxied requests
	API datadogconfig.APIConfig `mapstructure:"api"`
	// contains filtered or unexported fields
}

ProxyConfig controls how the `/intake` proxy operates

Directories

Path Synopsis
internal
translator/header
Package header defines HTTP headers known convention used by the Trace Agent and Datadog's APM intake.
Package header defines HTTP headers known convention used by the Trace Agent and Datadog's APM intake.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL