statsd_exporter

package
v1.4.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package statsd_exporter embeds https://github.com/prometheus/statsd_exporter

Index

Constants

This section is empty.

Variables

View Source
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

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

func (c *Config) InstanceKey(agentKey string) (string, error)

InstanceKey returns the hostname:port of the agent.

func (*Config) Name

func (c *Config) Name() string

Name returns the name of the integration that this config represents.

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

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

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

func (e *Exporter) MetricsHandler() (http.Handler, error)

MetricsHandler returns the HTTP handler for the integration.

func (*Exporter) Run

func (e *Exporter) Run(ctx context.Context) error

Run satisfies Run.

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.

Jump to

Keyboard shortcuts

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