-
Notifications
You must be signed in to change notification settings - Fork 38
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
Error submitting metrics with async api client #951
Comments
Thanks for the report, reproduced. We're indeed missing the serialization step in the async case. I'll fix it, sorry for the troubles. |
My original bug report had a small mistake, for the body I used a plan dictionary, but if I follow the examples for the non-async client I should be sending a
But for some reason the |
Ok, I found the problem looks like I needed to call |
* Serialiaze body in async client Closes #951 * Support compression as well
Describe the bug
When using the Datadog API async client, an error occurs when submitting metrics data:
HTTP response body: Payload is not in the expected format: invalid character 's' looking for beginning of value
Exact same metrics data can be successfully submitted using the non-async client.
To Reproduce
The following code (adapted from the async example in the README) will reproduce the error:
Error response:
Expected behavior
Request should succeed and metrics data should be available in the DataDog metrics explorer. (Like it is when making the request with the non-async client.)
Screenshots
If applicable, add screenshots to help explain your problem.
Environment and Versions (please complete the following information):
Linux with Python v3.8.10 and
datadog-api-client = {extras = ["async"], version = "^1.10.0"}
Additional context
After looking at the differences between the non-async and async API clients, I noticed that it appears the async client never actually serializes the provided body data.
For reference, the non-async client does it here, but I did not see similar code for the async client.
The text was updated successfully, but these errors were encountered: