metrics

package
v0.36.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package metrics exposes utilities for setting up and using a sub-set of Datadog's dogstatsd client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Configure

func Configure(conf *config.AgentConfig, tags []string) error

Configure creates a statsd client for the given agent's configuration, using the specified global tags.

func Count

func Count(name string, value int64, tags []string, rate float64) error

Count calls Count on the global Client, if set.

func Flush

func Flush() error

Flush flushes any pending metrics to the agent.

func Gauge

func Gauge(name string, value float64, tags []string, rate float64) error

Gauge calls Gauge on the global Client, if set.

func Histogram

func Histogram(name string, value float64, tags []string, rate float64) error

Histogram calls Histogram on the global Client, if set.

func Timing

func Timing(name string, value time.Duration, tags []string, rate float64) error

Timing calls Timing on the global Client, if set.

Types

type StatsClient

type StatsClient interface {
	Gauge(name string, value float64, tags []string, rate float64) error
	Count(name string, value int64, tags []string, rate float64) error
	Histogram(name string, value float64, tags []string, rate float64) error
	Timing(name string, value time.Duration, tags []string, rate float64) error
	Flush() error
}

StatsClient represents a client capable of sending stats to some stat endpoint.

var Client StatsClient = (*statsd.Client)(nil)

Client is a global Statsd client. When a client is configured via Configure, that becomes the new global Statsd client in the package.

Directories

Path Synopsis
client module
Package timing is used to aggregate timing calls within hotpaths to avoid using repeated statsd calls.
Package timing is used to aggregate timing calls within hotpaths to avoid using repeated statsd calls.

Jump to

Keyboard shortcuts

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