Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Host string `toml:"host" yaml:"host" json:"host"` // Network address to connect to FlushInterval time.Duration `toml:"interval" yaml:"interval" json:"interval"` // Flush interval DurationUnit time.Duration `toml:"duration" yaml:"duration" json:"duration"` // Time conversion unit for durations Prefix string `toml:"prefix" yaml:"prefix" json:"prefix"` // Prefix to be prepended to metric names TagPrefix string `toml:"tag_prefix" yaml:"tag_prefix" json:"tag_prefix"` // Prefix to be prepended to metric name tag ConnectTimeout time.Duration `toml:"connect_timeout" yaml:"connect_timeout" json:"connect_timeout"` // Connect timeout Timeout time.Duration `toml:"timeout" yaml:"timeout" json:"timeout"` // Write timeout Retry int `toml:"retry" yaml:"retry" json:"retry"` // Reconnect retry count BufSize int `toml:"buffer" yaml:"buffer" json:"buffer"` // Buffer size MinLock bool `toml:"min_lock" yaml:"min_lock" json:"min_lock"` // Minimize time of read-locking of metric registry (but with some costs), set if application do dynamic metrics register/unregister Percentiles []float64 `toml:"percentiles" yaml:"percentiles" json:"percentiles"` // Percentiles to export from timers and histograms Tags map[string]string `toml:"tags" yaml:"tags" json:"tags"` // Tags for sended metrics (not used directky in graphite client, merge it with metric individual tags) // contains filtered or unexported fields }
Config provides a container with configuration parameters for the Graphite exporter
type Graphite ¶
type Graphite struct {
// contains filtered or unexported fields
}
Example ¶
g := New(1*time.Second, "some.prefix", "127.0.0.1:2003", time.Second) g.Start(metrics.DefaultRegistry) g.Stop()
Output:
func New ¶
Graphite is a blocking exporter function which reports metrics in r to a graphite server located at addr, flushing them every d duration and prepending metric names with prefix.
func WithConfig ¶
WithConfig is a blocking exporter function just like Graphite, but it takes a GraphiteConfig instead.
Example ¶
g := WithConfig(&Config{ Host: "127.0.0.1:2003", FlushInterval: 1 * time.Second, DurationUnit: time.Millisecond, Percentiles: []float64{0.5, 0.75, 0.99, 0.999}, }) g.Start(metrics.DefaultRegistry) g.Stop()
Output:
func (*Graphite) SetLoggerError ¶
func (*Graphite) SetLoggerSucces ¶
func (g *Graphite) SetLoggerSucces(f func())
Click to show internal directories.
Click to hide internal directories.