Skip to content

Commit ba9f4b4

Browse files
authored
[receiver/datadogreceiver] Configure /intake endpoint (#39787)
#### Description Datadog's `/intake` endpoint is used by agents to record information about the system they're running on. It's not a metrics/logs/traces endpoint, but instead accepts metadata about a specific host that a `datadog-agent` is running on. This meatadata is used by Datadog to enrich metrics for a specific host (e.g. host-specific tags that should be associated with all metrics from that host). While supporting `/intake` isn't striclty necessary to ingest metrics/logs/traces, it means that [pointing a `datadog-agent` at an OpenTelemetry Collector](https://github.com/DataDog/datadog-agent/blob/7.64.0/pkg/config/config_template.yaml#L40) will not work as expected, because all metrics submitted by the agent will be missing their host tags. By adding the ability to proxy `/intake` calls to Datadog itself, we enable this `datadog-agent`→`otelcol` workflow. The default behaviour maintains backwards-compatibility - if you don't specify an intake configuration, then intake calls aren't processed. #### Testing Ran both simulated calls and ran a `datadog-agent` against this receiver. The collector properly received and proxied the `/intake` calls (as could be seen in the Datadog hosts dashboard). #### Documentation Updated the README for the receiver.
1 parent 1b82715 commit ba9f4b4

File tree

15 files changed

+422
-123
lines changed

15 files changed

+422
-123
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: datadogreceiver
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Implement the `/intake` endpoint
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [39787]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# If your change doesn't affect end users or the exported elements of any package,
21+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22+
# Optional: The change log or logs in which this entry should be included.
23+
# e.g. '[user]' or '[user, api]'
24+
# Include 'user' if the change is relevant to end users.
25+
# Include 'api' if there is a change to a library API.
26+
# Default: '[user]'
27+
change_logs: [user]

cmd/opampsupervisor/go.mod

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,12 @@ require (
8181
github.com/leodido/go-syslog/v4 v4.2.0 // indirect
8282
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b // indirect
8383
github.com/lightstep/go-expohisto v1.0.0 // indirect
84-
github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect
84+
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
8585
github.com/magefile/mage v1.15.0 // indirect
8686
github.com/mitchellh/copystructure v1.2.0 // indirect
8787
github.com/mitchellh/reflectwalk v1.0.2 // indirect
8888
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
89-
github.com/modern-go/reflect2 v1.0.2 // indirect
89+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
9090
github.com/mostynb/go-grpc-compression v1.2.3 // indirect
9191
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
9292
github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector v0.128.0 // indirect
@@ -129,7 +129,7 @@ require (
129129
github.com/splunk/stef/go/pdata v0.0.6 // indirect
130130
github.com/splunk/stef/go/pkg v0.0.6 // indirect
131131
github.com/tklauser/go-sysconf v0.3.14 // indirect
132-
github.com/tklauser/numcpus v0.8.0 // indirect
132+
github.com/tklauser/numcpus v0.9.0 // indirect
133133
github.com/twmb/murmur3 v1.1.8 // indirect
134134
github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect
135135
github.com/valyala/fastjson v1.6.4 // indirect
@@ -216,7 +216,7 @@ require (
216216
go.opentelemetry.io/otel/sdk/metric v1.36.0 // indirect
217217
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
218218
golang.org/x/crypto v0.39.0 // indirect
219-
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac // indirect
219+
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
220220
golang.org/x/net v0.41.0 // indirect
221221
golang.org/x/sync v0.15.0 // indirect
222222
golang.org/x/text v0.26.0 // indirect
@@ -324,3 +324,13 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/stefr
324324
replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor => ../../processor/deltatocumulativeprocessor
325325

326326
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/gopsutilenv => ../../internal/gopsutilenv
327+
328+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders => ../../internal/metadataproviders
329+
330+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => ../../internal/k8sconfig
331+
332+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ../../internal/datadog
333+
334+
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog => ../../pkg/datadog
335+
336+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil => ../../internal/aws/ecsutil

cmd/opampsupervisor/go.sum

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exporter/elasticsearchexporter/integrationtest/go.mod

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,13 @@ require (
9292
github.com/leodido/ragel-machinery v0.0.0-20190525184631-5f46317e436b // indirect
9393
github.com/lestrrat-go/strftime v1.1.0 // indirect
9494
github.com/lightstep/go-expohisto v1.0.0 // indirect
95-
github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a // indirect
95+
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
9696
github.com/magefile/mage v1.15.0 // indirect
9797
github.com/minio/sha256-simd v1.0.1 // indirect
9898
github.com/mitchellh/copystructure v1.2.0 // indirect
9999
github.com/mitchellh/reflectwalk v1.0.2 // indirect
100100
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
101-
github.com/modern-go/reflect2 v1.0.2 // indirect
101+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
102102
github.com/mostynb/go-grpc-compression v1.2.3 // indirect
103103
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
104104
github.com/open-telemetry/opentelemetry-collector-contrib/connector/routingconnector v0.128.0 // indirect
@@ -141,7 +141,7 @@ require (
141141
github.com/splunk/stef/go/pdata v0.0.6 // indirect
142142
github.com/splunk/stef/go/pkg v0.0.6 // indirect
143143
github.com/tklauser/go-sysconf v0.3.14 // indirect
144-
github.com/tklauser/numcpus v0.8.0 // indirect
144+
github.com/tklauser/numcpus v0.9.0 // indirect
145145
github.com/twmb/murmur3 v1.1.8 // indirect
146146
github.com/ua-parser/uap-go v0.0.0-20240611065828-3a4781585db6 // indirect
147147
github.com/valyala/fastjson v1.6.4 // indirect
@@ -231,7 +231,7 @@ require (
231231
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
232232
go.uber.org/multierr v1.11.0 // indirect
233233
golang.org/x/crypto v0.39.0 // indirect
234-
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac // indirect
234+
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
235235
golang.org/x/net v0.41.0 // indirect
236236
golang.org/x/sys v0.33.0 // indirect
237237
golang.org/x/text v0.26.0 // indirect
@@ -346,3 +346,13 @@ replace github.com/open-telemetry/opentelemetry-collector-contrib/receiver/stefr
346346
replace github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatocumulativeprocessor => ../../../processor/deltatocumulativeprocessor
347347

348348
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/gopsutilenv => ../../../internal/gopsutilenv
349+
350+
replace github.com/open-telemetry/opentelemetry-collector-contrib/pkg/datadog => ../../../pkg/datadog
351+
352+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders => ../../../internal/metadataproviders
353+
354+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig => ../../../internal/k8sconfig
355+
356+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/datadog => ../../../internal/datadog
357+
358+
replace github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil => ../../../internal/aws/ecsutil

exporter/elasticsearchexporter/integrationtest/go.sum

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/tidylist/tidylist.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ extension/storage
3838
pkg/stanza
3939
pkg/translator/jaeger
4040
receiver/carbonreceiver
41+
internal/aws/ecsutil
42+
internal/k8sconfig
43+
internal/metadataproviders
44+
internal/datadog
45+
pkg/datadog
4146
receiver/datadogreceiver
4247
receiver/jaegerreceiver
4348
receiver/signalfxreceiver
@@ -57,11 +62,6 @@ confmap/provider/s3provider
5762
confmap/provider/secretsmanagerprovider
5863
internal/filter
5964
connector/countconnector
60-
internal/aws/ecsutil
61-
internal/k8sconfig
62-
internal/metadataproviders
63-
internal/datadog
64-
pkg/datadog
6565
pkg/xk8stest
6666
processor/k8sattributesprocessor
6767
pkg/sampling

receiver/datadogreceiver/README.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,26 @@ All config params here are valid as well
6767

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

70+
### `/intake` Config
71+
72+
The `datadog-agent` forwards metadata about its runtime environment via the `/intake` API endpoint.
73+
This receiver supports receiving this data and forwarding it directly to Datadog.
74+
(Note that this data isn't telemetry data, so it does not go through any configured collector pipelines.)
75+
76+
This feature can be enabled in the config:
77+
78+
```
79+
receivers:
80+
datadog:
81+
intake:
82+
behavior: proxy
83+
proxy:
84+
api:
85+
key: ${env:DD_API_KEY}
86+
site: datadoghq.com
87+
fail_on_invalid_key: true
88+
```
89+
7090
### Default Attributes
7191

7292
- `dd.span.Resource`: The datadog resource name (as distinct from the span name)
@@ -90,15 +110,15 @@ Format example can be found [here](./internal/translator/traces_translator_test.
90110

91111
**Metrics**
92112

93-
| Datadog API Endpoint | Status | Notes |
94-
|-----------------------------|-------------|-------|
95-
| /api/v1/series | Development | |
96-
| /api/v2/series | Development | |
97-
| /api/v1/check_run | Development | |
98-
| /api/v1/sketches | Development | |
99-
| /api/beta/sketches | Development | |
100-
| /api/v1/distribution_points | Development | |
101-
| /intake | Development | |
113+
| Datadog API Endpoint | Status | Notes |
114+
|-----------------------------|-------------|----------------------------|
115+
| /api/v1/series | Development | |
116+
| /api/v2/series | Development | |
117+
| /api/v1/check_run | Development | |
118+
| /api/v1/sketches | Development | |
119+
| /api/beta/sketches | Development | |
120+
| /api/v1/distribution_points | Development | |
121+
| /intake | Development | Support for proxying calls |
102122

103123
### Temporality considerations
104124

0 commit comments

Comments
 (0)