Documentation
¶
Index ¶
Constants ¶
const ( // OutputNull is the selection for no metrics. OutputNull = "NULL" // OutputDatadog selects the datadog/extended-statsd driver. OutputDatadog = "DATADOG" )
Variables ¶
var StatFromContext = xstats.FromContext
StatFromContext is the concrete implementation of StatFn that should be used at runtime.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component struct {
NullStat *NullComponent
Datadog *DatadogComponent
}
Component enables creating configured loggers.
func NewComponent ¶
func NewComponent() *Component
NewComponent populates an StatComponent with defaults.
type Config ¶
type Config struct {
Output string `description:"Destination stream of the stats. One of NULLSTAT, DATADOG."`
NullStat *NullConfig
Datadog *DatadogConfig
}
Config contains all configuration values for creating a system stat client.
type DatadogComponent ¶
type DatadogComponent struct{}
DatadogComponent implements the settings.Component interface for a datadog stats client.
func (*DatadogComponent) New ¶
func (*DatadogComponent) New(_ context.Context, conf *DatadogConfig) (Stat, error)
New creates a configured stats client.
func (*DatadogComponent) Settings ¶
func (*DatadogComponent) Settings() *DatadogConfig
Settings generates a config with default values applied.
type DatadogConfig ¶
type DatadogConfig struct {
Address string `description:"Listener address to use when sending metrics."`
FlushInterval time.Duration `description:"Frequencing of sending metrics to listener."`
Tags []string `description:"Any static tags for all metrics."`
PacketSize int `description:"Max packet size to send."`
}
DatadogConfig is for configuration a datadog client.
func (*DatadogConfig) Name ¶
func (*DatadogConfig) Name() string
Name of the configuration as it might appear in config files.
type NullComponent ¶
type NullComponent struct{}
NullComponent implements the settings.Component interface for a NOP stat client.
func (*NullComponent) New ¶
func (*NullComponent) New(_ context.Context, conf *NullConfig) (Stat, error)
New creates a configured stats client.
func (*NullComponent) Settings ¶
func (*NullComponent) Settings() *NullConfig
Settings generates a config with default values applied.
type NullConfig ¶
type NullConfig struct{}
NullConfig is empty. There are no options for NULL.
func (*NullConfig) Name ¶
func (*NullConfig) Name() string
Name of the configuration as it might appear in config files.