graphite

package
v0.0.0-...-b0852c1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// BackendName is the name of this backend.
	BackendName = "graphite"
	// DefaultAddress is the default address of Graphite server.
	DefaultAddress = "localhost:2003"
	// DefaultDialTimeout is the default net.Dial timeout.
	DefaultDialTimeout = 5 * time.Second
	// DefaultWriteTimeout is the default socket write timeout.
	DefaultWriteTimeout = 30 * time.Second
	// DefaultGlobalPrefix is the default global prefix.
	DefaultGlobalPrefix = "stats"
	// DefaultPrefixCounter is the default counters prefix.
	DefaultPrefixCounter = "counters"
	// DefaultPrefixTimer is the default timers prefix.
	DefaultPrefixTimer = "timers"
	// DefaultPrefixGauge is the default gauges prefix.
	DefaultPrefixGauge = "gauges"
	// DefaultPrefixSet is the default sets prefix.
	DefaultPrefixSet = "sets"
	// DefaultGlobalSuffix is the default global suffix.
	DefaultGlobalSuffix = ""
	// DefaultMode controls whether to use legacy namespace, no tags, or tags
	DefaultMode = "tags"
)

Variables

This section is empty.

Functions

func NewClientFromViper

func NewClientFromViper(v *viper.Viper, logger logrus.FieldLogger, pool *transport.TransportPool) (gostatsd.Backend, error)

NewClientFromViper constructs a Client object using configuration provided by Viper

Types

type Client

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

Client is an object that is used to send messages to a Graphite server's TCP interface.

func NewClient

func NewClient(
	address string,
	dialTimeout time.Duration,
	writeTimeout time.Duration,
	globalPrefix string,
	prefixCounter string,
	prefixTimer string,
	prefixGauge string,
	prefixSet string,
	globalSuffix string,
	mode string,
	disabled gostatsd.TimerSubtypes,
	logger logrus.FieldLogger,
) (*Client, error)

NewClient constructs a Graphite backend object.

func (*Client) Name

func (client *Client) Name() string

Name returns the name of the backend.

func (*Client) Run

func (client *Client) Run(ctx context.Context)

func (*Client) SendEvent

func (client *Client) SendEvent(ctx context.Context, e *gostatsd.Event) error

SendEvent discards events.

func (*Client) SendMetricsAsync

func (client *Client) SendMetricsAsync(ctx context.Context, metrics *gostatsd.MetricMap, cb gostatsd.SendCallback)

SendMetricsAsync flushes the metrics to the Graphite server, preparing payload synchronously but doing the send asynchronously.

Jump to

Keyboard shortcuts

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