Documentation
¶
Overview ¶
Package statsdexporter is a helper for embedded statsd_exporter in other projects.
Index ¶
- Variables
- type Option
- func WithAddress(network string, addr string) Option
- func WithCacheSize(size uint) Option
- func WithCacheType(cacheType string) Option
- func WithDogstatsdTagsEnabled(enabled bool) Option
- func WithEventFlushInterval(interval time.Duration) Option
- func WithEventFlushThreshold(size uint) Option
- func WithEventQueueSize(size uint) Option
- func WithInfluxdbTagsEnabled(enabled bool) Option
- func WithLibratoTagsEnabled(enabled bool) Option
- func WithLogger(logger log.Logger) Option
- func WithMappingConfig(configFile string) Option
- func WithReadBuffer(size uint) Option
- func WithRegWithGathereristerer(gatherer prometheus.Gatherer) Option
- func WithRegisterer(registerer prometheus.Registerer) Option
- func WithSignalFXTagsEnabled(enabled bool) Option
- func WithUnixSocketMode(mode os.FileMode) Option
- type Server
Constants ¶
This section is empty.
Variables ¶
var ( // Metrics can be used to register metrics about the exporter itself Metrics = []prometheus.Collector{ eventStats, eventsFlushed, eventsUnmapped, udpPackets, tcpConnections, tcpErrors, tcpLineTooLong, unixgramPackets, linesReceived, samplesReceived, sampleErrors, tagsReceived, tagErrors, conflictingEventStats, errorEventStats, eventsActions, metricsCount, } )
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option is used when creating a new exporter.
func WithAddress ¶
WithAddress sets the address for the listener. Default is a random UDP port on localhost.
func WithCacheSize ¶
WithCacheSize sets the maximum size of your metric mapping cache.
Default is 1000.
func WithCacheType ¶
WithCacheType sets metric mapping cache type. Valid options are "lru" and "random".
Default is "lru".
func WithDogstatsdTagsEnabled ¶
WithDogstatsdTagsEnabled sets whether to parse DogStatsd style tags.
Default is true.
func WithEventFlushInterval ¶
WithEventFlushInterval sets the maximum time between event queue flushes.
Default is 200ms
func WithEventFlushThreshold ¶
WithEventFlushThreshold sets the number of events to hold in queue before flushing.
Default is 1000.
func WithEventQueueSize ¶
WithEventQueueSize sets the size of internal queue for processing events.
Default is 10000.
func WithInfluxdbTagsEnabled ¶
WithInfluxdbTagsEnabled sets whether to parse InfluxDB style tags.
Default is true.
func WithLibratoTagsEnabled ¶
WithInfluxdbTagsEnabled sets whether to parse Librato style tags.
Default is true.
func WithLogger ¶
WithLogger sets the logger to use. A nop is used by default.
func WithMappingConfig ¶
WithMappingConfig sets the metric mapping configuration file name.
func WithReadBuffer ¶
WithReadBuffer sets the read buffer size (in bytes) of the operating system's transmit read buffer associated with the UDP or Unixgram connection. Please make sure the kernel parameters net.core.rmem_max is set to a value greater than the value specified.
func WithRegWithGathereristerer ¶
func WithRegWithGathereristerer(gatherer prometheus.Gatherer) Option
WithGatherer sets the Gatherer to sue for registering metrics. The gatherer and register should use the same underlying prometheus registry for metrics to work as expected.
Default is prometheus.DefaultGathererer.
func WithRegisterer ¶
func WithRegisterer(registerer prometheus.Registerer) Option
WithRegisterer sets the Registerer to sue for registering metrics.
Default is prometheus.DefaultRegisterer.
func WithSignalFXTagsEnabled ¶
WithInfluxdbTagsEnabled sets whether to parse SignalFX style tags.
Default is true.
func WithUnixSocketMode ¶
WithUnixSocketMode sets the file mode when using a unix socket. Default is 0o755
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a statsd server