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] add json handling for the api/v2/series endpoint #36218

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jdgeisler
Copy link
Contributor

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.

Link to tracking issue

Fixes #36079

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":[]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/datadogreceiver] api/v2/series does not seem to support the datadog api client libraries
2 participants