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

Improve documentation for posting metrics #39

Open
ctoto93 opened this issue Mar 10, 2016 · 3 comments
Open

Improve documentation for posting metrics #39

ctoto93 opened this issue Mar 10, 2016 · 3 comments

Comments

@ctoto93
Copy link

ctoto93 commented Mar 10, 2016

Here is my code to post metrics. Metrics explorer could not find the sent metrics.
But there is no error shown

    datadogClient := datadog.NewClient(config.API_KEY,config.APP_KEY)

    data := []datadog.DataPoint{datadog.DataPoint{1.0,15.0}}

    test:= datadog.Metric{}
    test.Metric = "order"
    test.Host = "golife"
    test.Points = data

    fmt.Println(test)

    err = datadogClient.PostMetrics([]datadog.Metric{test})
    if err != nil{
        panic(err)
    }

@seiffert
Copy link
Contributor

@ctoto93 the first value you pass into a datadog.DataPoint needs to be a UNIX timestamp which is documented here: https://github.com/zorkian/go-datadog-api/blob/master/series.go#L13-L15

Please try something like datadog.DataPoint{float64(time.Now().Unix()), 15.0} and let us know whether that works for you.

@thdxr
Copy link

thdxr commented Jun 7, 2016

Follow up on this, I couldn't find any docs for the list of Types you can specify with a metric. Any idea?

@ojongerius
Copy link
Collaborator

@seiffert care to raise a PR with an example in the Readme?

@zorkian zorkian changed the title How to post metrics? Improve documentation for posting metrics Jan 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants