Documentation ¶
Index ¶
Constants ¶
const (
MaxPacketSize = 1 << 16
)
Variables ¶
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, *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 }
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 ¶
NewExport returns a common implementation for exporters that Export statsd syntax.
type LabelEncoder ¶
type LabelEncoder struct {
// contains filtered or unexported fields
}
LabelEncoder encodes metric labels in the dogstatsd syntax.
TODO: find a link for this syntax. It's been copied out of code, not a specification:
https://github.com/stripe/veneur/blob/master/sinks/datadog/datadog.go
func NewLabelEncoder ¶
func NewLabelEncoder() *LabelEncoder
NewLabelEncoder returns a new encoder for dogstatsd-syntax metric labels.
func (*LabelEncoder) Encode ¶
func (e *LabelEncoder) Encode(labels []core.KeyValue) string
Encode emits a string like "|#key1:value1,key2:value2".
func (*LabelEncoder) ForceEncode ¶
func (e *LabelEncoder) ForceEncode(labels export.Labels) (string, bool)
ForceEncode returns a statsd label encoding, even if the exported labels were encoded by a different type of encoder. Returns a boolean to indicate whether the labels were in fact re-encoded, to test for (and warn about) efficiency.