This repository is deprecated. No further Issues or Pull Requests will be considered or approved.
Further interest should be directed to the new godspeed
repository. If you'd like to check out the latest version of the source code, report any issues, contribute any improvements, or download the latest release, please do so at:
Godspeed is a statsd client for the Datadog extension of statsd (DogStatsD).
The name godspeed
is a bit of a rhyming slang twist on DogStatsD. It's also a
poke at the fact that the statsd protocol's transport mechanism is UDP...
Check out GoDoc for the docs as well as some examples.
DogStatsD is a copyright of Datadog <info@datadoghq.com>
.
Godspeed is released under the BSD 3-Clause License. See the LICENSE
file for
the full contents of the license.
go get -u github.com/PagerDuty/godspeed
For more details either look at the _example_test.go
files directly or view
the examples on GoDoc.
g, err := godspeed.NewDefault()
if err != nil {
// handle error
}
defer g.Conn.Close()
err = g.Gauge("example.stat", 1, nil)
if err != nil {
// handle error
}
// make sure to handle the error
g, _ := godspeed.NewDefault()
defer g.Conn.Close()
title := "Nginx service restart"
text := "The Nginx service has been restarted"
// the optionals are for the optional arguments available for an event
// http://docs.datadoghq.com/guides/dogstatsd/#fields
optionals := make(map[string]string)
optionals["alert_type"] = "info"
optionals["source_type_name"] = "nginx"
addlTags := []string{"source_type:nginx"}
err := g.Event(title, text, optionals, addlTags)
if err != nil {
fmt.Println("err:", err)
}