Documentation ¶
Overview ¶
Package statsd_exporter embeds https://github.com/prometheus/statsd_exporter
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{ ListenUDP: ":9125", ListenTCP: ":9125", UnixSocketMode: "755", CacheSize: 1000, CacheType: "lru", EventQueueSize: 10000, EventFlushThreshold: 1000, EventFlushInterval: 200 * time.Millisecond, ParseDogStatsd: true, ParseInfluxDB: true, ParseLibrato: true, ParseSignalFX: true, RelayPacketLength: 1400, }
DefaultConfig holds the default settings for the statsd_exporter integration.
Functions ¶
func New ¶
func New(log log.Logger, c *Config) (integrations.Integration, error)
New creates a new statsd_exporter integration. The integration scrapes metrics from a statsd process.
Types ¶
type Config ¶
type Config struct { ListenUDP string `yaml:"listen_udp,omitempty"` ListenTCP string `yaml:"listen_tcp,omitempty"` ListenUnixgram string `yaml:"listen_unixgram,omitempty"` UnixSocketMode string `yaml:"unix_socket_mode,omitempty"` MappingConfig any `yaml:"mapping_config,omitempty"` ReadBuffer int `yaml:"read_buffer,omitempty"` CacheSize int `yaml:"cache_size,omitempty"` CacheType string `yaml:"cache_type,omitempty"` EventQueueSize int `yaml:"event_queue_size,omitempty"` EventFlushThreshold int `yaml:"event_flush_threshold,omitempty"` EventFlushInterval time.Duration `yaml:"event_flush_interval,omitempty"` ParseDogStatsd bool `yaml:"parse_dogstatsd_tags,omitempty"` ParseInfluxDB bool `yaml:"parse_influxdb_tags,omitempty"` ParseLibrato bool `yaml:"parse_librato_tags,omitempty"` ParseSignalFX bool `yaml:"parse_signalfx_tags,omitempty"` RelayAddr string `yaml:"relay_addr,omitempty"` RelayPacketLength int `yaml:"relay_packet_length,omitempty"` }
Config controls the statsd_exporter integration.
func (*Config) InstanceKey ¶
InstanceKey returns the hostname:port of the agent.
func (*Config) NewIntegration ¶
func (c *Config) NewIntegration(l log.Logger) (integrations.Integration, error)
NewIntegration converts this config into an instance of an integration.
func (*Config) UnmarshalYAML ¶
UnmarshalYAML implements yaml.Unmarshaler for Config.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
Exporter defines the statsd_exporter integration.
func (*Exporter) MetricsHandler ¶
MetricsHandler returns the HTTP handler for the integration.
func (*Exporter) ScrapeConfigs ¶
func (e *Exporter) ScrapeConfigs() []config.ScrapeConfig
ScrapeConfigs satisfies Integration.ScrapeConfigs.
type Metrics ¶
type Metrics struct { EventStats *prometheus.CounterVec EventsFlushed prometheus.Counter EventsUnmapped prometheus.Counter UDPPackets prometheus.Counter TCPConnections prometheus.Counter TCPErrors prometheus.Counter TCPLineTooLong prometheus.Counter UnixgramPackets prometheus.Counter LinesReceived prometheus.Counter SamplesReceived prometheus.Counter SampleErrors *prometheus.CounterVec TagsReceived prometheus.Counter TagErrors prometheus.Counter MappingsCount prometheus.Gauge ConflictingEventStats *prometheus.CounterVec ErrorEventStats *prometheus.CounterVec EventsActions *prometheus.CounterVec MetricsCount *prometheus.GaugeVec }
Metrics holds metrics used by the statsd_exporter integration. These metrics are distinct from the set of metrics used by the exporter itself, and are just used to monitor the stats of the listeners that forward data to the exporter.
func NewMetrics ¶
func NewMetrics(r prometheus.Registerer) (*Metrics, error)
NewMetrics initializes Metrics and registers them to the given Registerer.