Skip to content
DogStatsD-compliant statsd client written in Go - http://docs.datadoghq.com/guides/dogstatsd/
Branch: master
Clone or download
Pull request Compare This branch is 16 commits ahead, 2 commits behind PagerDuty:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gspdtest
.gitignore
.travis.yml
LICENSE
README.md
async.go
async_example_test.go
async_test.go
events.go
events_example_test.go
events_test.go
example_test.go
godspeed.go
godspeed_example_test.go
godspeed_test.go
service_checks.go
service_checks_example_test.go
service_checks_test.go
shared.go
shared_test.go
stats.go
stats_example_test.go
stats_test.go

README.md

Godspeed

TravisCI Build Status GoDoc License

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>.

License

Godspeed is released under the BSD 3-Clause License. See the LICENSE file for the full contents of the license.

Installation

go get -u github.com/theckman/godspeed

Usage

For more details either look at the _example_test.go files directly or view the examples on GoDoc.

Emitting a gauge

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
}

Emitting an event

// 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)
}
You can’t perform that action at this time.