statsd

package
v3.0.0-...-7237cd1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UDPMaxPacketSize int = 64 * 1024
)

Variables

This section is empty.

Functions

func RandomString

func RandomString(n int) string

Types

type Config

type Config struct {
	Enable                 bool
	Port                   int
	DB                     string
	User                   string
	Password               string
	Worker                 int
	GatherInterval         time.Duration
	Protocol               string
	MaxTCPConnections      int
	TCPKeepAlive           bool
	AllowedPendingMessages int
	DeleteCounters         bool
	DeleteGauges           bool
	DeleteSets             bool
	DeleteTimings          bool
	TTL                    int
}

type MetricMaker

type MetricMaker struct {
	// contains filtered or unexported fields
}

func (*MetricMaker) Log

func (m *MetricMaker) Log() telegraf.Logger

func (*MetricMaker) LogName

func (m *MetricMaker) LogName() string

func (*MetricMaker) MakeMetric

func (m *MetricMaker) MakeMetric(metric telegraf.Metric) telegraf.Metric

type Number

type Number float64

Number will get parsed as an int or float depending on what is passed

func (*Number) UnmarshalTOML

func (n *Number) UnmarshalTOML(b []byte) error

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

func (*Plugin) HandleMetrics

func (p *Plugin) HandleMetrics(serializer *influx.Serializer, metric telegraf.Metric)

func (*Plugin) Init

func (p *Plugin) Init(_ gin.IRouter) error

func (*Plugin) Start

func (p *Plugin) Start() error

func (*Plugin) Stop

func (p *Plugin) Stop() error

func (*Plugin) String

func (p *Plugin) String() string

func (*Plugin) Version

func (p *Plugin) Version() string

type RunningStats

type RunningStats struct {
	PercLimit int
	// contains filtered or unexported fields
}

RunningStats calculates a running mean, variance, standard deviation, lower bound, upper bound, count, and can calculate estimated percentiles. It is based on the incremental algorithm described here:

https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance

func (*RunningStats) AddValue

func (rs *RunningStats) AddValue(v float64)

func (*RunningStats) Count

func (rs *RunningStats) Count() int64

func (*RunningStats) Lower

func (rs *RunningStats) Lower() float64

func (*RunningStats) Mean

func (rs *RunningStats) Mean() float64

func (*RunningStats) Percentile

func (rs *RunningStats) Percentile(n float64) float64

func (*RunningStats) Stddev

func (rs *RunningStats) Stddev() float64

func (*RunningStats) Sum

func (rs *RunningStats) Sum() float64

func (*RunningStats) Upper

func (rs *RunningStats) Upper() float64

func (*RunningStats) Variance

func (rs *RunningStats) Variance() float64

type Statsd

type Statsd struct {
	User     string
	Password string
	// Protocol used on listener - udp or tcp
	Protocol string `toml:"protocol"`

	// Address & Port to serve from
	ServiceAddress string

	// Number of messages allowed to queue up in between calls to Gather. If this
	// fills up, packets will get dropped until the next Gather interval is ran.
	AllowedPendingMessages int

	// Percentiles specifies the percentiles that will be calculated for timing
	// and histogram stats.
	Percentiles     []Number
	PercentileLimit int

	DeleteGauges   bool
	DeleteCounters bool
	DeleteSets     bool
	DeleteTimings  bool
	ConvertNames   bool `toml:"convert_names" deprecated:"0.12.0;2.0.0;use 'metric_separator' instead"`

	// MetricSeparator is the separator between parts of the metric name.
	MetricSeparator string
	// This flag enables parsing of tags in the dogstatsd extension to the
	// statsd protocol (http://docs.datadoghq.com/guides/dogstatsd/)
	ParseDataDogTags bool `toml:"parse_data_dog_tags" deprecated:"1.10.0;use 'datadog_extensions' instead"`

	// Parses extensions to statsd in the datadog statsd format
	// currently supports metrics and datadog tags.
	// http://docs.datadoghq.com/guides/dogstatsd/
	DataDogExtensions bool `toml:"datadog_extensions"`

	// Parses distribution metrics in the datadog statsd format.
	// Requires the DataDogExtension flag to be enabled.
	// https://docs.datadoghq.com/developers/metrics/types/?tab=distribution#definition
	DataDogDistributions bool `toml:"datadog_distributions"`

	// UDPPacketSize is deprecated, it's only here for legacy support
	// we now always create 1 max size buffer and then copy only what we need
	// into the in channel
	// see https://github.com/influxdata/telegraf/pull/992
	UDPPacketSize int `toml:"udp_packet_size" deprecated:"0.12.1;2.0.0;option is ignored"`

	ReadBufferSize int `toml:"read_buffer_size"`

	SanitizeNamesMethod string `toml:"sanitize_name_method"`

	sync.Mutex

	// bucket -> influx templates
	Templates []string

	// Protocol listeners
	UDPlistener *net.UDPConn
	TCPlistener *net.TCPListener

	MaxTCPConnections int `toml:"max_tcp_connections"`

	TCPKeepAlive       bool           `toml:"tcp_keep_alive"`
	TCPKeepAlivePeriod *time.Duration `toml:"tcp_keep_alive_period"`

	// Max duration for each metric to stay cached without being updated.
	MaxTTL time.Duration `toml:"max_ttl"`

	Log telegraf.Logger `toml:"-"`
	// contains filtered or unexported fields
}

Statsd allows the importing of statsd and dogstatsd data.

func (*Statsd) Gather

func (s *Statsd) Gather(acc telegraf.Accumulator) error

func (*Statsd) SampleConfig

func (*Statsd) SampleConfig() string

func (*Statsd) Start

func (s *Statsd) Start(ac telegraf.Accumulator) error

func (*Statsd) Stop

func (s *Statsd) Stop()

Jump to

Keyboard shortcuts

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