-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Labels
Comments
jdgeisler
added
bug
Something isn't working
needs triage
New item requiring triage
labels
Oct 29, 2024
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
pull bot
pushed a commit
to abaguas/opentelemetry-collector-contrib
that referenced
this issue
Nov 12, 2024
…dpoint (open-telemetry#36218) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Adding json handling for the `api/v2/series` endpoint. The datadog api client libraries use json messages, however only protobuf messages are currently supported in the` api/v2/series` endpoint, so requests fail with `proto: illegal wireType 6` If `Content-Type: application/json` is set, then we handle the json message. Otherwise, we handle the protobuf message. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#36079 <!--Describe what testing was performed and which tests were added.--> #### Testing Added test with a json metric payload that now passes. Additionally, I also tested these changes in my own image and confirmed that the datadog api client libraries can now successfully ship metrics to the `api/v2/series` endpoint. I also confirmed with the following curl: ``` curl -X POST \ -H "Content-Type: application/json" \ -H "DD-API-KEY: your_api_key_here" \ -d '{ "series": [ { "resources": [ { "name": "dummyhost", "type": "host" } ], "tags": ["env:test"], "metric": "test.metric", "points": [ { "timestamp": 1730829575, "value": 1.0 } ], "type": 3 } ] }' \ https://datadog-receiver/api/v2/series {"errors":[]} ``` --------- Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
sbylica-splunk
pushed a commit
to sbylica-splunk/opentelemetry-collector-contrib
that referenced
this issue
Dec 17, 2024
…dpoint (open-telemetry#36218) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Adding json handling for the `api/v2/series` endpoint. The datadog api client libraries use json messages, however only protobuf messages are currently supported in the` api/v2/series` endpoint, so requests fail with `proto: illegal wireType 6` If `Content-Type: application/json` is set, then we handle the json message. Otherwise, we handle the protobuf message. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#36079 <!--Describe what testing was performed and which tests were added.--> #### Testing Added test with a json metric payload that now passes. Additionally, I also tested these changes in my own image and confirmed that the datadog api client libraries can now successfully ship metrics to the `api/v2/series` endpoint. I also confirmed with the following curl: ``` curl -X POST \ -H "Content-Type: application/json" \ -H "DD-API-KEY: your_api_key_here" \ -d '{ "series": [ { "resources": [ { "name": "dummyhost", "type": "host" } ], "tags": ["env:test"], "metric": "test.metric", "points": [ { "timestamp": 1730829575, "value": 1.0 } ], "type": 3 } ] }' \ https://datadog-receiver/api/v2/series {"errors":[]} ``` --------- Co-authored-by: Sean Marciniak <30928402+MovieStoreGuy@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
andproto: 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.
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
api/v2/series
endpoint using the datadog api client library. Here is an example using the python libraryExpected Result
The
api/v2/series
endpoint can accept json requests from the datadog api client librariesActual 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
Additional context
No response
The text was updated successfully, but these errors were encountered: