datadog

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2021 License: MIT Imports: 9 Imported by: 6

README

DataDog

Test Go Report Card Go Reference

go-datadog-metrics defines a DataDog reporter for rcrowley/go-metrics.

Getting started

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

Usage

Check out the example implementation for the base implementation.

License

This project is open source available under the MIT license

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 wraps a metrics registry with a given statsd client.

func NewReporter

func NewReporter(r metrics.Registry, addr string, options ...ReporterOption) (*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.

type ReporterOption

type ReporterOption func(*Reporter) error

ReporterOption is function-option used during the construction of a *Reporter

func UseFlushInterval

func UseFlushInterval(d time.Duration) ReporterOption

UseFlushInterval configures the flush tick interval to use with `Flush`

func UsePercentiles

func UsePercentiles(percentiles []float64) ReporterOption

UsePercentiles builds a *Reporter that reports the specified percentiles for Histograms and TimedMetrics

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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