Categorygithub.com/theckman/godspeed
repositorypackage
0.0.0-20180224001232-122876cde329
Repository: https://github.com/theckman/godspeed.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Godspeed

TravisCI Build Status GoDoc License

Deprecation Notice

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:

Overview

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 <[email protected]>.

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/PagerDuty/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)
}