package statsd
import "go.opentelemetry.io/otel/exporters/metric/internal/statsd"
Index ¶
- Constants
- Variables
- type Adapter
- type Config
- type Exporter
- func NewExporter(config Config, adapter Adapter) (*Exporter, error)
- func (e *Exporter) Export(_ context.Context, checkpointSet export.CheckpointSet) error
- type LabelEncoder
Constants ¶
const (
MaxPacketSize = 1 << 16
)
Variables ¶
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.
func (*Exporter) Export ¶
Export is common code for any statsd-based metric.Exporter implementation.
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(iter export.LabelIterator) 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.
Source Files ¶
conn.go labels.go
- Version
- v0.3.0
- Published
- Mar 21, 2020
- Platform
- linux/amd64
- Imports
- 12 packages
- Last checked
- 2 minutes ago –
Tools for package owners.