Skip to content

Help with PostMetrics #249

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

Open
EArbeitman opened this issue Jul 3, 2019 · 1 comment
Open

Help with PostMetrics #249

EArbeitman opened this issue Jul 3, 2019 · 1 comment

Comments

@EArbeitman
Copy link

Hi,

Can you provide an example of how to init a DataPoint struct for PostMetrics call?

@bkabrda
Copy link
Collaborator

bkabrda commented Feb 3, 2020

So an example of this is dd.DataPoint{{dd.Float64(1.0), dd.Float64(2.0)}} from integration/series_test.go. The semantics of the two items in the inner slice is:

  • The first one is UNIX timestamp
  • The second one is the actual value of the metric at that time

Based on the above, the example would mean "Submit a metric with a single datapoint - time is 1970-01-01 00:00:01 (one second after midnight of first January 1970) and the value of the metric is 2.0.

This corresponds directly to what the endpoint accepts as documented in the API docs [1]. Is this unclear in the code? If so, what of the above information do you think would be useful to have in the docstring for the structure?

[1] https://docs.datadoghq.com/api/?lang=bash#post-timeseries-points

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

No branches or pull requests

2 participants