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/datadogreceiver] api/v2/series does not seem to support the datadog api client libraries #36079

Open
jdgeisler opened this issue Oct 29, 2024 · 1 comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/datadog

Comments

@jdgeisler
Copy link
Contributor

jdgeisler commented Oct 29, 2024

Component(s)

receiver/datadog

What happened?

Description

We are using datadog api client libraries, such as the python library, to ship metrics to the /api/v2/series endpoint.

We have verified that the v2 api spec and request that we are sending is correct according to the datadog documentation, however we are getting 400 response errors such as proto: illegal wireType 6 and proto: wrong wireType = 0 for field Points

When using the api/v1/series instead, we are able to successfully ship metrics using the datadog client api library.

Looking in our logs and at the code, we see that these requests are likely failing here https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/datadogreceiver/internal/translator/series.go#L38-L41.

pl := new(gogen.MetricPayload)
if err := pl.Unmarshal(buf.Bytes()); err != nil {
	return mp, err
}

This could be because it is trying to unmarshal directly into a protobuf message from the datadog agent payload, but this fails because the datadog api request body is json.

Steps to Reproduce

  1. Try to ship metrics to the api/v2/series endpoint using the datadog api client library. Here is an example using the python library
  2. See that a 400 response is returned with the above protobuf errors

Expected Result

The api/v2/series endpoint can accept json requests from the datadog api client libraries

Actual Result

Metric requests to the api/v2/series endpoint from the datadog api client library fail with the above protobuf errors.

Collector version

v0.112.0

Environment information

Environment

OpenTelemetry Collector configuration

No response

Log output

2024-10-29 15:10:38.689	
2024-10-29T20:10:38.689Z	info	Metrics	{"kind": "exporter", "data_type": "metrics", "name": "debug", "resource metrics": 1, "metrics": 23, "data points": 27}
2024-10-29 15:10:31.566	
	net/http/server.go:2092
2024-10-29 15:10:31.566	
net/http.(*conn).serve
2024-10-29 15:10:31.566	
	net/http/server.go:3210
2024-10-29 15:10:31.566	
net/http.serverHandler.ServeHTTP
2024-10-29 15:10:31.566	
	go.opentelemetry.io/collector/config/confighttp@v0.112.0/clientinfohandler.go:26
2024-10-29 15:10:31.566	
go.opentelemetry.io/collector/config/confighttp.(*clientInfoHandler).ServeHTTP
2024-10-29 15:10:31.566	
	net/http/server.go:2220
2024-10-29 15:10:31.566	
net/http.HandlerFunc.ServeHTTP
2024-10-29 15:10:31.566	
	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.56.0/handler.go:65
2024-10-29 15:10:31.566	
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.NewMiddleware.func1.1
2024-10-29 15:10:31.566	
	go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp@v0.56.0/handler.go:171
2024-10-29 15:10:31.566	
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp.(*middleware).serveHTTP
2024-10-29 15:10:31.566	
	net/http/server.go:2220
2024-10-29 15:10:31.566	
net/http.HandlerFunc.ServeHTTP
2024-10-29 15:10:31.566	
	go.opentelemetry.io/collector/config/confighttp@v0.112.0/confighttp.go:553
2024-10-29 15:10:31.566	
go.opentelemetry.io/collector/config/confighttp.(*ServerConfig).ToServer.maxRequestBodySizeInterceptor.func2
2024-10-29 15:10:31.566	
	go.opentelemetry.io/collector/config/confighttp@v0.112.0/compression.go:175
2024-10-29 15:10:31.566	
go.opentelemetry.io/collector/config/confighttp.(*decompressor).ServeHTTP
2024-10-29 15:10:31.566	
	net/http/server.go:2747
2024-10-29 15:10:31.566	
net/http.(*ServeMux).ServeHTTP
2024-10-29 15:10:31.566	
	net/http/server.go:2220
2024-10-29 15:10:31.566	
net/http.HandlerFunc.ServeHTTP
2024-10-29 15:10:31.566	
	github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver@v0.112.0/receiver.go:305
2024-10-29 15:10:31.566	
github.com/open-telemetry/opentelemetry-collector-contrib/receiver/datadogreceiver.(*datadogReceiver).handleV2Series
2024-10-29 15:10:31.566	
2024-10-29T20:10:31.566Z	error	datadogreceiver@v0.112.0/receiver.go:305	proto: illegal wireType 6

Additional context

No response

@jdgeisler jdgeisler added bug Something isn't working needs triage New item requiring triage labels Oct 29, 2024
Copy link
Contributor

Pinging code owners:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New item requiring triage receiver/datadog
Projects
None yet
Development

No branches or pull requests

1 participant