Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[receiver/datadog] Missing DDAgentFeaturesDiscovery #34718

Closed
melchiormoulin opened this issue Aug 16, 2024 · 2 comments · Fixed by #34726
Closed

[receiver/datadog] Missing DDAgentFeaturesDiscovery #34718

melchiormoulin opened this issue Aug 16, 2024 · 2 comments · Fixed by #34726
Assignees
Labels
bug Something isn't working receiver/datadog

Comments

@melchiormoulin
Copy link
Contributor

Component(s)

receiver/datadog

What happened?

Description

Currently Datadog receiver does not implement GET /info needed for featuresdiscovery by Datadog SDK

This lead to the fallback mecanism of Datadog SDK which probe opentelemetry collector tracing endpoint with Content-lenght: 0 which lead to a stacktrace

Steps to Reproduce

Expected Result

No stacktrace.

Actual Result

2024-07-12T13:56:36.749Z	error	datadogreceiver@v0.104.0/receiver.go:95	Unable to unmarshal reqs	{"kind": "receiver", "name": "datadog", "data_type": "traces"}
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver.(*datadogReceiver).handleTraces
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver@v0.104.0/receiver.go:95
net/http.HandlerFunc.ServeHTTP
	net/http/server.go:2166
net/http.(*ServeMux).ServeHTTP
	net/http/server.go:2683
go.opentelemetry.io/collector/config/confighttp.(*decompressor).ServeHTTP
	go.opentelemetry.io/collector/config/confighttp@v0.104.0/compression.go:172
go.opentelemetry.io/collector/config/confighttp.(*ServerConfig).ToServer.maxRequestBodySizeInterceptor.func2
	go.opentelemetry.io/collector/config/confighttp@v0.104.0/confighttp.go:485
net/http.HandlerFunc.ServeHTTP
	net/http/server.go:2166
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*middleware).serveHTTP
	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.52.0/handler.go:212
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewMiddleware.func1.1
	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.52.0/handler.go:73
net/http.HandlerFunc.ServeHTTP
	net/http/server.go:2166
go.opentelemetry.io/collector/config/confighttp.(*clientInfoHandler).ServeHTTP
	go.opentelemetry.io/collector/config/confighttp@v0.104.0/clientinfohandler.go:26
net/http.serverHandler.ServeHTTP
	net/http/server.go:3137
net/http.(*conn).serve
	net/http/server.go:2039

Collector version

v0.104.0

Environment information

Environment

OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")

OpenTelemetry Collector configuration

receivers:
  datadog:
    endpoint: 0.0.0.0:8080
    read_timeout: 60s

processors:
  probabilistic_sampler:
    sampling_percentage: 0

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    traces:
      receivers: [datadog]
      processors: [probabilistic_sampler]
      exporters: [debug]

Log output

No response

Additional context

I can handle the fix.
To quick fix we can just check content length:0 of the http request and return same response code 400.

@melchiormoulin melchiormoulin added bug Something isn't working needs triage New item requiring triage labels Aug 16, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@jpkrohling
Copy link
Member

I can handle the fix.

Go ahead!

@jpkrohling jpkrohling removed the needs triage New item requiring triage label Aug 16, 2024
jpkrohling pushed a commit that referenced this issue Aug 19, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

**Link to tracking Issue:** 
Fix
#34718

**Testing:** 
this otel config

```
receivers:
  datadog:
    endpoint: 0.0.0.0:8080
    read_timeout: 60s

processors:
  probabilistic_sampler:
    sampling_percentage: 0

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    traces:
      receivers: [datadog]
      processors: [probabilistic_sampler]
      exporters: [debug] 
```
tcpdump on 8080 port and having this http request performed : 
```
PUT /v0.4/traces HTTP/1.1
Content-Type: application/msgpack
Content-Length: 0
Host: 10.0.0.2:8080
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.12.15

HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Sun, 18 Aug 2024 22:06:39 GMT
Content-Length: 23

Fake featuresdiscovery
```
**Documentation:** <Describe the documentation added.>
f7o pushed a commit to f7o/opentelemetry-collector-contrib that referenced this issue Sep 12, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->

**Link to tracking Issue:** 
Fix
open-telemetry#34718

**Testing:** 
this otel config

```
receivers:
  datadog:
    endpoint: 0.0.0.0:8080
    read_timeout: 60s

processors:
  probabilistic_sampler:
    sampling_percentage: 0

exporters:
  debug:
    verbosity: detailed

service:
  pipelines:
    traces:
      receivers: [datadog]
      processors: [probabilistic_sampler]
      exporters: [debug] 
```
tcpdump on 8080 port and having this http request performed : 
```
PUT /v0.4/traces HTTP/1.1
Content-Type: application/msgpack
Content-Length: 0
Host: 10.0.0.2:8080
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.12.15

HTTP/1.1 400 Bad Request
Content-Type: text/plain; charset=utf-8
X-Content-Type-Options: nosniff
Date: Sun, 18 Aug 2024 22:06:39 GMT
Content-Length: 23

Fake featuresdiscovery
```
**Documentation:** <Describe the documentation added.>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working receiver/datadog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants