Documentation ¶
Overview ¶
Package graphite provides a bridge to push Prometheus metrics to a Graphite server.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bridge ¶
type Bridge struct {
// contains filtered or unexported fields
}
Bridge pushes metrics to the configured Graphite server.
type Config ¶
type Config struct { // The url to push data to. Required. URL string // The prefix for the pushed Graphite metrics. Defaults to empty string. Prefix string // The interval to use for pushing data to Graphite. Defaults to 15 seconds. Interval time.Duration // The timeout for pushing metrics to Graphite. Defaults to 15 seconds. Timeout time.Duration // The Gatherer to use for metrics. Defaults to prometheus.DefaultGatherer. Gatherer prometheus.Gatherer // The logger that messages are written to. Defaults to no logging. Logger Logger // ErrorHandling defines how errors are handled. Note that errors are // logged regardless of the configured ErrorHandling provided Logger // is not nil. ErrorHandling HandlerErrorHandling // Graphite does not support ever increasing counter the same way // prometheus does. Rollups and ingestion might cannot handle ever // increasing counters. This option allows enabled the caller to // calculate the delta by saving the last sent counter in memory // and subtraction it from the collected value before sending. CountersAsDelta bool }
Config defines the Graphite bridge config.
type HandlerErrorHandling ¶
type HandlerErrorHandling int
HandlerErrorHandling defines how a Handler serving metrics will handle errors.
const ( // Ignore errors and try to push as many metrics to Graphite as possible. ContinueOnError HandlerErrorHandling = iota // Abort the push to Graphite upon the first error encountered. AbortOnError )
These constants cause handlers serving metrics to behave as described if errors are encountered.
Click to show internal directories.
Click to hide internal directories.