You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[receiver/datadogreceiver] add json handling for the api/v2/series endpoint (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
Fixesopen-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>
0 commit comments