statsd

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MaxPacketSize defaults to the smallest value known to work
	// across all cloud providers.  If the packets are too large,
	// you will see "write: message too long" errors.
	MaxPacketSize = 1432
)

Variables

View Source
var (
	ErrInvalidScheme = fmt.Errorf("invalid statsd transport")
)

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	AppendName(export.Record, *bytes.Buffer)
	AppendTags(export.Record, *resource.Resource, *bytes.Buffer)
}

Adapter supports statsd syntax variations, primarily plain statsd vs. dogstatsd.

type Config

type Config struct {
	// URL describes the destination for exporting statsd data.
	// e.g., udp://host:port
	//       tcp://host:port
	//       unix:///socket/path
	URL string

	// Writer is an alternate to providing a URL.  When Writer is
	// non-nil, URL will be ignored and the exporter will write to
	// the configured Writer interface.
	Writer io.Writer

	// MaxPacketSize this limits the packet size for packet-oriented transports.
	MaxPacketSize int

	// Prefix will be prepended to every metric name.
	Prefix string
}

Config supports common configuration that applies to statsd exporters.

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter is common type meant to implement concrete statsd exporters.

func NewExporter

func NewExporter(config Config, adapter Adapter) (*Exporter, error)

NewExporter returns a common implementation for exporters that Export statsd syntax.

func (*Exporter) Export

func (e *Exporter) Export(_ context.Context, checkpointSet export.CheckpointSet) error

Export is common code for any statsd-based metric.Exporter implementation.

func (*Exporter) ExportKindFor added in v0.7.0

ExportKindFor returns export.DeltaExporter for statsd-derived exporters

Jump to

Keyboard shortcuts

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