Skip to content

Commit ecbfcaf

Browse files
Felipe Lopesf7o
authored andcommitted
[receiver/datadog] Implement '/stats' endpoint (open-telemetry#34790)
**Description:** <Describe what has changed.> Following up on open-telemetry#34772, this PR implements Datadog Agent's `/stats` endpoint, which is used for sending [client stats](https://github.com/DataDog/dd-trace-java/blob/master/communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java#L40) of the [local sampled spans](https://github.com/DataDog/dd-trace-java/blob/master/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java#L993-L1008) to calculate the [trace metrics](https://docs.datadoghq.com/tracing/metrics/metrics_namespace/). This PR also does a minor refactor in the usage of Datadog's common headers, moving from literal strings to centralized constants. **Link to tracking Issue:** <Issue number if applicable> **Testing:** <Describe what testing was performed and which tests were added.> **Documentation:** <Describe the documentation added.>
1 parent c7ae830 commit ecbfcaf

File tree

15 files changed

+813
-50
lines changed

15 files changed

+813
-50
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 '/stats' 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: [34790]
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: []

cmd/otelcontribcol/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ require (
326326
github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.56.0-rc.12 // indirect
327327
github.com/DataDog/datadog-agent/pkg/obfuscate v0.56.0-rc.12 // indirect
328328
github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.12 // indirect
329-
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.56.0-rc.12 // indirect
329+
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.56.0 // indirect
330330
github.com/DataDog/datadog-agent/pkg/status/health v0.56.0-rc.12 // indirect
331331
github.com/DataDog/datadog-agent/pkg/telemetry v0.56.0-rc.12 // indirect
332332
github.com/DataDog/datadog-agent/pkg/trace v0.57.0-devel.0.20240722160158-ad956a31a730 // indirect

cmd/otelcontribcol/go.sum

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

receiver/datadogreceiver/go.mod

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@ go 1.22.0
44

55
require (
66
github.com/DataDog/agent-payload/v5 v5.0.130
7-
github.com/DataDog/datadog-agent/pkg/obfuscate v0.55.3
7+
github.com/DataDog/datadog-agent/pkg/obfuscate v0.56.0-rc.12
88
github.com/DataDog/datadog-agent/pkg/proto v0.56.0-rc.12
9+
github.com/DataDog/datadog-agent/pkg/trace v0.56.0-rc.12
910
github.com/DataDog/datadog-api-client-go/v2 v2.29.0
11+
github.com/DataDog/sketches-go v1.4.6
1012
github.com/open-telemetry/opentelemetry-collector-contrib/internal/exp/metrics v0.107.0
1113
github.com/open-telemetry/opentelemetry-collector-contrib/internal/sharedcomponent v0.107.0
1214
github.com/stretchr/testify v1.9.0
15+
github.com/tinylib/msgp v1.1.9
1316
github.com/vmihailenco/msgpack/v4 v4.3.13
1417
go.opentelemetry.io/collector/component v0.107.1-0.20240827012220-5963d446ca4a
1518
go.opentelemetry.io/collector/component/componentstatus v0.107.1-0.20240827012220-5963d446ca4a
@@ -27,18 +30,22 @@ require (
2730
)
2831

2932
require (
33+
github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.56.0 // indirect
3034
github.com/DataDog/datadog-go/v5 v5.5.0 // indirect
3135
github.com/DataDog/go-sqllexer v0.0.12 // indirect
32-
github.com/DataDog/zstd v1.5.2 // indirect
33-
github.com/Microsoft/go-winio v0.5.1 // indirect
36+
github.com/DataDog/go-tuf v1.1.0-0.5.2 // indirect
37+
github.com/DataDog/opentelemetry-mapping-go/pkg/otlp/attributes v0.14.0 // indirect
38+
github.com/DataDog/zstd v1.5.5 // indirect
39+
github.com/Microsoft/go-winio v0.6.1 // indirect
3440
github.com/beorn7/perks v1.0.1 // indirect
3541
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3642
github.com/davecgh/go-spew v1.1.1 // indirect
37-
github.com/dustin/go-humanize v1.0.0 // indirect
43+
github.com/dustin/go-humanize v1.0.1 // indirect
3844
github.com/felixge/httpsnoop v1.0.4 // indirect
3945
github.com/fsnotify/fsnotify v1.7.0 // indirect
4046
github.com/go-logr/logr v1.4.2 // indirect
4147
github.com/go-logr/stdr v1.2.2 // indirect
48+
github.com/go-ole/go-ole v1.2.6 // indirect
4249
github.com/go-viper/mapstructure/v2 v2.1.0 // indirect
4350
github.com/goccy/go-json v0.10.2 // indirect
4451
github.com/gogo/protobuf v1.3.2 // indirect
@@ -51,6 +58,7 @@ require (
5158
github.com/knadh/koanf/maps v0.1.1 // indirect
5259
github.com/knadh/koanf/providers/confmap v0.1.0 // indirect
5360
github.com/knadh/koanf/v2 v2.1.1 // indirect
61+
github.com/lufia/plan9stats v0.0.0-20220913051719-115f729f3c8c // indirect
5462
github.com/mitchellh/copystructure v1.2.0 // indirect
5563
github.com/mitchellh/reflectwalk v1.0.2 // indirect
5664
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
@@ -61,13 +69,19 @@ require (
6169
github.com/philhofer/fwd v1.1.2 // indirect
6270
github.com/pkg/errors v0.9.1 // indirect
6371
github.com/pmezard/go-difflib v1.0.0 // indirect
72+
github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect
6473
github.com/prometheus/client_golang v1.20.1 // indirect
6574
github.com/prometheus/client_model v0.6.1 // indirect
6675
github.com/prometheus/common v0.55.0 // indirect
6776
github.com/prometheus/procfs v0.15.1 // indirect
6877
github.com/rs/cors v1.11.0 // indirect
69-
github.com/tinylib/msgp v1.1.9 // indirect
78+
github.com/secure-systems-lab/go-securesystemslib v0.7.0 // indirect
79+
github.com/shirou/gopsutil/v3 v3.24.4 // indirect
80+
github.com/shoenig/go-m1cpu v0.1.6 // indirect
81+
github.com/tklauser/go-sysconf v0.3.12 // indirect
82+
github.com/tklauser/numcpus v0.6.1 // indirect
7083
github.com/vmihailenco/tagparser v0.1.2 // indirect
84+
github.com/yusufpapurcu/wmi v1.2.4 // indirect
7185
go.opentelemetry.io/collector v0.107.1-0.20240827012220-5963d446ca4a // indirect
7286
go.opentelemetry.io/collector/client v1.13.1-0.20240827012220-5963d446ca4a // indirect
7387
go.opentelemetry.io/collector/config/configauth v0.107.1-0.20240827012220-5963d446ca4a // indirect
@@ -88,14 +102,18 @@ require (
88102
go.opentelemetry.io/otel/sdk v1.28.0 // indirect
89103
go.opentelemetry.io/otel/sdk/metric v1.28.0 // indirect
90104
go.opentelemetry.io/otel/trace v1.28.0 // indirect
91-
go.uber.org/atomic v1.10.0 // indirect
105+
go.uber.org/atomic v1.11.0 // indirect
106+
golang.org/x/mod v0.17.0 // indirect
92107
golang.org/x/net v0.28.0 // indirect
93108
golang.org/x/oauth2 v0.21.0 // indirect
109+
golang.org/x/sync v0.8.0 // indirect
94110
golang.org/x/sys v0.23.0 // indirect
95111
golang.org/x/text v0.17.0 // indirect
112+
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
96113
google.golang.org/appengine v1.6.8 // indirect
97114
google.golang.org/genproto/googleapis/rpc v0.0.0-20240701130421-f6361c86f094 // indirect
98115
google.golang.org/grpc v1.65.0 // indirect
116+
gopkg.in/ini.v1 v1.67.0 // indirect
99117
gopkg.in/yaml.v3 v3.0.1 // indirect
100118
)
101119

0 commit comments

Comments
 (0)