datadogexporter

package module
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 60 Imported by: 10

README

Datadog Exporter

Status
Stability beta: traces, metrics, logs
Distributions contrib
Issues Open issues Closed issues
Code Owners @mx-psi, @dineshg13, @liustanley, @songy23, @mackjmr, @ankitpatel96, @jade-guiton-dd
Emeritus @gbbr

Please review the Collector's security documentation, which contains recommendations on securing sensitive information such as the API key required by this exporter.

The Datadog Exporter now skips APM stats computation by default. It is recommended to only use the Datadog Connector in order to compute APM stats. To temporarily revert to the previous behavior, disable the exporter.datadogexporter.DisableAPMStats feature gate. Example: otelcol --config=config.yaml --feature-gates=-exporter.datadogexporter.DisableAPMStats

Find the full configs of Datadog exporter and their usage in collector.yaml. More example configs can be found in the official documentation.

FAQs

Why am I getting errors 413 - Request Entity Too Large, how do I fix it?

This error indicates the payload size sent by the Datadog exporter exceeds the size limit (see previous examples https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16834, https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/17566).

This is usually caused by the pipeline batching too many telemetry data before sending to the Datadog exporter. To fix that, try lowering send_batch_size and send_batch_max_size in your batchprocessor config. You might want to have a separate batch processor dedicated for datadog exporter if other exporters expect a larger batch size, e.g.

processors:
  batch:  # To be used by other exporters
    timeout: 1s
    # Default value for send_batch_size is 8192
  batch/datadog:
    send_batch_max_size: 100
    send_batch_size: 10
    timeout: 10s
...
service:
  pipelines:
    metrics:
      receivers: ...
      processors: [batch/datadog]
      exporters: [datadog]

The exact values for send_batch_size and send_batch_max_size depends on your specific workload. Also note that, Datadog intake has different payload size limits for the 3 signal types:

Fall back to the Zorkian metric client with feature gate

Since v0.69.0, the Datadog exporter has switched to use the native metric client datadog-api-client-go for metric export instead of Zorkian client by default. While datadog-api-client-go fixed several issues that are present in Zorkian client, there is a performance regression with it compared to Zorkian client especially under high metric volume. If you observe memory or throughput issues in the Datadog exporter with datadog-api-client-go, you can configure the Datadog exporter to fall back to the Zorkian client by disabling the feature gate exporter.datadogexporter.metricexportnativeclient, e.g.

otelcol --config=config.yaml --feature-gates=-exporter.datadogexporter.metricexportnativeclient

Note that we are currently migrating the Datadog metrics exporter to use the metrics serializer instead. The feature flag exporter.datadogexporter.metricexportnativeclient will be deprecated and eventually removed in the future, following the feature lifecycle.

Remap OTel’s service.name attribute to service for logs

NOTE this workaround is only needed when feature gate exporter.datadogexporter.UseLogsAgentExporter is disabled. This feature gate is enabled by default starting v0.108.0.

For Datadog Exporter versions 0.83.0 - v0.107.0, the service field of OTel logs is populated as OTel semantic convention service.name. However, service.name is not one of the default service attributes in Datadog’s log preprocessing.

To get the service field correctly populated in your logs, you can specify service.name to be the source of a log’s service by setting a log service remapper processor.

How to add custom log source

In order to add a custom source to your OTLP logs, set resource attribute datadog.log.source. This feature requires exporter.datadogexporter.UseLogsAgentExporter feature flag to be enabled (now enabled by default).

Example:

processors:
  transform/logs:
    log_statements:
      - context: resource
        statements:
          - set(attributes["datadog.log.source"], "otel")

Documentation

Index

Constants

View Source
const (
	// Deprecated: [v0.110.0] Use `datadogconfig.TypeStr` instead.
	// DefaultSite is the default site of the Datadog intake to send data to
	DefaultSite = datadogconfig.DefaultSite
)

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() exporter.Factory

NewFactory creates a Datadog exporter factory

Types

type APIConfig deprecated

type APIConfig = datadogconfig.APIConfig

Deprecated: [v0.110.0] Use `datadogconfig.TypeStr` instead. APIConfig defines the API configuration options

type Config deprecated

type Config = datadogconfig.Config

Deprecated: [v0.110.0] Use `datadogconfig.Config` instead. Config defines configuration for the Datadog exporter.

type CumulativeMonotonicSumMode deprecated added in v0.55.0

type CumulativeMonotonicSumMode = datadogconfig.CumulativeMonotonicSumMode

Deprecated: [v0.110.0] Use `datadogconfig.CumulativeMonotonicMode` instead. CumulativeMonotonicSumMode is the export mode for OTLP Sum metrics.

const (
	// Deprecated: [v0.110.0] Use `datadogconfig.CumulativeMonotonicSumMode` instead.
	// CumulativeMonotonicSumModeToDelta calculates delta for
	// cumulative monotonic sum metrics in the client side and reports
	// them as Datadog counts.
	CumulativeMonotonicSumModeToDelta CumulativeMonotonicSumMode = datadogconfig.CumulativeMonotonicSumModeToDelta

	// Deprecated: [v0.110.0] Use `datadogconfig.CumulativeMonotonicSumMode` instead.
	// CumulativeMonotonicSumModeRawValue reports the raw value for
	// cumulative monotonic sum metrics as a Datadog gauge.
	CumulativeMonotonicSumModeRawValue CumulativeMonotonicSumMode = datadogconfig.CumulativeMonotonicSumModeRawValue
)

type HistogramConfig deprecated added in v0.55.0

type HistogramConfig = datadogconfig.HistogramConfig

Deprecated: [v0.110.0] Use `datadogconfig.HistogramConfig` instead. HistogramConfig customizes export of OTLP Histograms.

type HistogramMode deprecated added in v0.55.0

type HistogramMode = datadogconfig.HistogramMode

Deprecated: [v0.110.0] Use `datadogconfig.HistogramMode` instead. HistogramMode is the export mode for OTLP Histogram metrics.

const (
	// HistogramModeNoBuckets reports no bucket histogram metrics. .sum and .count metrics will still be sent
	// if `send_count_sum_metrics` is enabled.
	HistogramModeNoBuckets HistogramMode = datadogconfig.HistogramModeNoBuckets
	// HistogramModeCounters reports histograms as Datadog counts, one metric per bucket.
	HistogramModeCounters HistogramMode = datadogconfig.HistogramModeCounters
	// HistogramModeDistributions reports histograms as Datadog distributions (recommended).
	HistogramModeDistributions HistogramMode = datadogconfig.HistogramModeDistributions
)

type HostMetadataConfig deprecated added in v0.55.0

type HostMetadataConfig = datadogconfig.HostMetadataConfig

Deprecated: [v0.110.0] Use `datadogconfig.HostMetadataConfig` instead. HostMetadataConfig defines the host metadata related configuration. Host metadata is the information used for populating the infrastructure list, the host map and providing host tags functionality.

The exporter will send host metadata for a single host, whose name is chosen according to `host_metadata::hostname_source`.

type HostnameSource deprecated added in v0.55.0

type HostnameSource = datadogconfig.HostnameSource

Deprecated: [v0.110.0] Use `datadogconfig.HostnameSource` instead. HostnameSource is the source for the hostname of host metadata.

const (
	// Deprecated: [v0.110.0] Use `datadogconfig.HostnameSource` instead.
	// HostnameSourceFirstResource picks the host metadata hostname from the resource
	// attributes on the first OTLP payload that gets to the exporter. If it is lacking any
	// hostname-like attributes, it will fallback to 'config_or_system' behavior (see below).
	//
	// Do not use this hostname source if receiving data from multiple hosts.
	HostnameSourceFirstResource HostnameSource = datadogconfig.HostnameSourceFirstResource

	// Deprecated: [v0.110.0] Use `datadogconfig.HostnameSource` instead.
	// HostnameSourceConfigOrSystem picks the host metadata hostname from the 'hostname' setting,
	// and if this is empty, from available system APIs and cloud provider endpoints.
	HostnameSourceConfigOrSystem HostnameSource = datadogconfig.HostnameSourceConfigOrSystem
)

type InitialValueMode deprecated added in v0.82.0

type InitialValueMode = datadogconfig.InitialValueMode

Deprecated: [v0.110.0] Use `datadogconfig.InitialValueMode` instead. InitialValueMode defines what the exporter should do with the initial value of a time series when transforming from cumulative to delta.

const (
	// InitialValueModeAuto reports the initial value if its start timestamp
	// is set and it happens after the process was started.
	InitialValueModeAuto InitialValueMode = datadogconfig.InitialValueModeAuto

	// InitialValueModeDrop always drops the initial value.
	InitialValueModeDrop InitialValueMode = datadogconfig.InitialValueModeDrop

	// InitialValueModeKeep always reports the initial value.
	InitialValueModeKeep InitialValueMode = datadogconfig.InitialValueModeKeep
)

type LogsConfig deprecated added in v0.61.0

type LogsConfig = datadogconfig.LogsConfig

Deprecated: [v0.110.0] Use `datadogconfig.LogsConfig` instead. LogsConfig defines logs exporter specific configuration

type MetricsConfig deprecated

type MetricsConfig = datadogconfig.MetricsConfig

Deprecated: [v0.110.0] Use `datadogconfig.MetricsConfig` instead. MetricsConfig defines the metrics exporter specific configuration options

type MetricsExporterConfig deprecated added in v0.55.0

type MetricsExporterConfig = datadogconfig.MetricsExporterConfig

Deprecated: [v0.110.0] Use `datadogconfig.MetricsExporterConfig` instead. MetricsExporterConfig provides options for a user to customize the behavior of the metrics exporter

type SumConfig deprecated added in v0.55.0

type SumConfig = datadogconfig.SumConfig

Deprecated: [v0.110.0] Use `datadogconfig.SumConfig` instead. SumConfig customizes export of OTLP Sums.

type SummaryConfig deprecated added in v0.55.0

type SummaryConfig = datadogconfig.SummaryConfig

Deprecated: [v0.110.0] Use `datadogconfig.SummaryMode` instead. SummaryConfig customizes export of OTLP Summaries.

type SummaryMode deprecated added in v0.55.0

type SummaryMode = datadogconfig.SummaryMode

Deprecated: [v0.110.0] Use `datadogconfig.SummaryMode` instead. SummaryMode is the export mode for OTLP Summary metrics.

const (
	// SummaryModeNoQuantiles sends no `.quantile` metrics. `.sum` and `.count` metrics will still be sent.
	SummaryModeNoQuantiles SummaryMode = datadogconfig.SummaryModeNoQuantiles
	// SummaryModeGauges sends `.quantile` metrics as gauges tagged by the quantile.
	SummaryModeGauges SummaryMode = datadogconfig.SummaryModeGauges
)

type TagsConfig deprecated

type TagsConfig = datadogconfig.TagsConfig

Deprecated: [v0.110.0] Use `datadogconfig.TagsConfig` instead. TagsConfig defines the tag-related configuration It is embedded in the configuration

type TracesConfig deprecated

type TracesConfig = datadogconfig.TracesExporterConfig

Deprecated: [v0.110.0] Use `datadogconfig.TracesExporterConfig` instead. TracesConfig defines the traces exporter specific configuration options

Directories

Path Synopsis
internal
clientutil
Package clientutil contains the Datadog API client util functions.
Package clientutil contains the Datadog API client util functions.
hostmetadata
Package hostmetadata is responsible for collecting host metadata from different providers such as EC2, ECS, AWS, etc and pushing it to Datadog.
Package hostmetadata is responsible for collecting host metadata from different providers such as EC2, ECS, AWS, etc and pushing it to Datadog.
hostmetadata/internal/azure
Package azure contains the Azure hostname provider
Package azure contains the Azure hostname provider
hostmetadata/internal/ec2
Package ec2 contains the AWS EC2 hostname provider
Package ec2 contains the AWS EC2 hostname provider
hostmetadata/internal/ecs
Package ecs contains the ECS Fargate hostname provider
Package ecs contains the ECS Fargate hostname provider
hostmetadata/internal/gcp
Package gcp contains the GCP hostname provider
Package gcp contains the GCP hostname provider
hostmetadata/internal/gohai
package gohai provides system information like cpu, memory in a format that is expected by the datadog intake
package gohai provides system information like cpu, memory in a format that is expected by the datadog intake
hostmetadata/internal/k8s
Package k8s contains the Kubernetes hostname provider
Package k8s contains the Kubernetes hostname provider
hostmetadata/internal/system
Package system contains the system hostname provider
Package system contains the system hostname provider
hostmetadata/provider
Package provider contains the cluster name provider
Package provider contains the cluster name provider
logs
Package logs provides utils for transforming OTLP LogRecord to Datadog format it also provides sender for submitting transformed logs to datadog backend This uses datadog-api-client-go for submitting logs
Package logs provides utils for transforming OTLP LogRecord to Datadog format it also provides sender for submitting transformed logs to datadog backend This uses datadog-api-client-go for submitting logs
metrics
Package metrics contains helper functions for Datadog metric export
Package metrics contains helper functions for Datadog metric export
metrics/sketches
Package sketches is a copy of part from github.com/DataDog/datadog-agent/pkg/metrics.
Package sketches is a copy of part from github.com/DataDog/datadog-agent/pkg/metrics.
scrub
Package scrub contains a Scrubber that scrubs error from sensitive details
Package scrub contains a Scrubber that scrubs error from sensitive details

Jump to

Keyboard shortcuts

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