datadog-api-client-ruby icon indicating copy to clipboard operation
datadog-api-client-ruby copied to clipboard

Fix SubmitDistributionPoints examples

Open timlkelly opened this issue 5 months ago • 0 comments

What does this PR do?

The Ruby examples to submit distribution metrics fail because the timestamp is not submitted as posix timestamp.

❯ ruby example.rb
/Users/tim/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/datadog_api_client-2.26.1/lib/datadog_api_client/api_client.rb:118:in `block in call_api': Error message: the server returns an error (DatadogAPIClient::APIError)
HTTP status code: 400
Response headers: {"date"=>["Fri, 13 Sep 2024 20:39:25 GMT"], "content-type"=>["text/plain; charset=utf-8"], "content-length"=>["98"], "connection"=>["close"], "x-content-type-options"=>["nosniff"], "strict-transport-security"=>["max-age=31536000; includeSubDomains; preload"]}
Response body: Payload is not in the expected format: json: cannot unmarshal string into Go value of type float64
        from /Users/tim/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/datadog_api_client-2.26.1/lib/datadog_api_client/api_client.rb:59:in `loop'
        from /Users/tim/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/datadog_api_client-2.26.1/lib/datadog_api_client/api_client.rb:59:in `call_api'
        from /Users/tim/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/datadog_api_client-2.26.1/lib/datadog_api_client/v1/api/metrics_api.rb:371:in `submit_distribution_points_with_http_info'
        from /Users/tim/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/datadog_api_client-2.26.1/lib/datadog_api_client/v1/api/metrics_api.rb:309:in `submit_distribution_points'
        from example.rb:32:in `<main>'

Additional Notes

Review checklist

Please check relevant items below:

  • [ ] This PR includes all newly recorded cassettes for any modified tests.

  • [x] This PR does not rely on API client schema changes.

    • [ ] The CI should be fully passing.
  • [ ] Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

timlkelly avatar Sep 13 '24 20:09 timlkelly