dogstatsd

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

README

package dogstatsd

This package is responsible for receiving metrics from external software over UDP or UDS. Every package has to follow the Dogstatsd format: http://docs.datadoghq.com/guides/dogstatsd/.

Metrics will be sent to the aggregator just like regular metrics from checks. This mean that aggregator and forwarder configuration will also inpact Dogstatsd.

Usage example:

// you must first initialize the aggregator, see aggregator.InitAggregator

// This will return an already running statd server ready to receive metrics
statsd, err := dogstatsd.NewServer(aggregatorInstance.GetBufferedChannels())

// ...

statsd.Stop()

Dogstatsd implementation documentation (PacketsBuffer, StringInterner, ...) is available in docs/dogstatsd/internals.md.

Details on existing Dogstatsd internals tuning fields are available in docs/dogstatsd/configuration.md.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDebugStats

func FormatDebugStats(stats []byte) (string, error)

FormatDebugStats returns a printable version of debug stats.

Types

type Server

type Server struct {
	Statistics *util.Stats
	Started    bool

	Debug *dsdServerDebug
	// contains filtered or unexported fields
}

Server represent a Dogstatsd server

func NewServer

func NewServer(aggregator *aggregator.BufferedAggregator) (*Server, error)

NewServer returns a running Dogstatsd server

func (*Server) DisableMetricsStats

func (s *Server) DisableMetricsStats()

DisableMetricsStats disables the debug mode of the DogStatsD server and stops the debug mainloop.

func (*Server) EnableMetricsStats

func (s *Server) EnableMetricsStats()

EnableMetricsStats enables the debug mode of the DogStatsD server and start the debug mainloop collecting the amount of metrics received.

func (*Server) GetJSONDebugStats

func (s *Server) GetJSONDebugStats() ([]byte, error)

GetJSONDebugStats returns jsonified debug statistics.

func (*Server) Stop

func (s *Server) Stop()

Stop stops a running Dogstatsd server

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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