Version: v0.29.0 Latest Latest

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

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




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


View Source
var (

	//nolint:revive // ignoring missing comments for unexported sentinel errors in an internal package.
	ErrInvalidScheme = fmt.Errorf("invalid statsd transport")


This section is empty.


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

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

func (*Exporter) TemporalityFor added in v0.27.0

TemporalityFor returns export.DeltaExporter for statsd-derived exporters

Source Files

Jump to

Keyboard shortcuts

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