datadog

package module
v0.0.0-...-c0dea9d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2018 License: MIT Imports: 7 Imported by: 0

README

DataDog

Build Status Go Report Card GoDoc license

This package provides a reporter for the go-metrics library that will post the metrics to datadog-go.

Installation

go get -u github.com/syntaqx/go-metrics-datadog
go get -u github.com/DataDog/datadog-go/...

Usage

Simply check out the example file for implementation details.

License

Distributed under the MIT license. See LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reporter

type Reporter struct {
	// Registry matrices that need to be reported to the Client
	Registry metrics.Registry

	// Client is the configured statsd instance
	Client *statsd.Client
	// contains filtered or unexported fields
}

Reporter represents a metrics registry, and the statsd client the metrics will be flushed to

func NewReporter

func NewReporter(r metrics.Registry, addr string, d time.Duration) (*Reporter, error)

NewReporter creates a new Reporter with a pre-configured statsd client.

func (*Reporter) Flush

func (r *Reporter) Flush()

Flush is a blocking exporter function which reports metrics in the registry to the statsd client, flushing every d duration

func (*Reporter) FlushOnce

func (r *Reporter) FlushOnce() error

FlushOnce submits a snapshot submission of the registry to DataDog. This can be used in a loop similarly to FlushWithInterval for custom error handling or data submission variations.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL