Documentation ¶
Index ¶
- Constants
- func OnConfigurationUpdate(configurations types.Configurations)
- func StopDatadog()
- func StopInfluxDB()
- func StopStatsd()
- type PrometheusHandler
- type Registry
- func NewMultiRegistry(registries []Registry) Registry
- func NewVoidRegistry() Registry
- func RegisterDatadog(config *types.Datadog) Registry
- func RegisterInfluxDB(config *types.InfluxDB) Registry
- func RegisterPrometheus(config *types.Prometheus) Registry
- func RegisterStatsd(config *types.Statsd) Registry
Constants ¶
const ( // MetricNamePrefix prefix of all metric names MetricNamePrefix = "traefik_" // MetricBackendPrefix prefix of all backend metric names MetricBackendPrefix = MetricNamePrefix + "backend_" )
Variables ¶
This section is empty.
Functions ¶
func OnConfigurationUpdate ¶ added in v1.7.0
func OnConfigurationUpdate(configurations types.Configurations)
OnConfigurationUpdate receives the current configuration from Traefik. It then converts the configuration to the optimized package internal format and sets it to the promState.
func StopDatadog ¶
func StopDatadog()
StopDatadog stops internal datadogTicker which controls the pushing of metrics to DD Agent and resets it to `nil`.
func StopInfluxDB ¶ added in v1.7.0
func StopInfluxDB()
StopInfluxDB stops internal influxDBTicker which controls the pushing of metrics to InfluxDB Agent and resets it to `nil`
func StopStatsd ¶
func StopStatsd()
StopStatsd stops internal statsdTicker which controls the pushing of metrics to StatsD Agent and resets it to `nil`
Types ¶
type PrometheusHandler ¶ added in v1.7.0
type PrometheusHandler struct{}
PrometheusHandler exposes Prometheus routes.
func (PrometheusHandler) AddRoutes ¶ added in v1.7.0
func (h PrometheusHandler) AddRoutes(router *mux.Router)
AddRoutes adds Prometheus routes on a router.
type Registry ¶
type Registry interface { // IsEnabled shows whether metrics instrumentation is enabled. IsEnabled() bool // server metrics ConfigReloadsCounter() metrics.Counter ConfigReloadsFailureCounter() metrics.Counter LastConfigReloadSuccessGauge() metrics.Gauge LastConfigReloadFailureGauge() metrics.Gauge // entry point metrics EntrypointReqsCounter() metrics.Counter EntrypointReqDurationHistogram() metrics.Histogram EntrypointOpenConnsGauge() metrics.Gauge // backend metrics BackendReqsCounter() metrics.Counter BackendReqDurationHistogram() metrics.Histogram BackendOpenConnsGauge() metrics.Gauge BackendRetriesCounter() metrics.Counter BackendServerUpGauge() metrics.Gauge }
Registry has to implemented by any system that wants to monitor and expose metrics.
func NewMultiRegistry ¶
NewMultiRegistry is an implementation of metrics.Registry that wraps multiple registries. It handles the case when a registry hasn't registered some metric and returns nil. This allows for feature imparity between the different metric implementations.
func NewVoidRegistry ¶
func NewVoidRegistry() Registry
NewVoidRegistry is a noop implementation of metrics.Registry. It is used to avoid nil checking in components that do metric collections.
func RegisterDatadog ¶
RegisterDatadog registers the metrics pusher if this didn't happen yet and creates a datadog Registry instance.
func RegisterInfluxDB ¶ added in v1.7.0
RegisterInfluxDB registers the metrics pusher if this didn't happen yet and creates a InfluxDB Registry instance.
func RegisterPrometheus ¶
func RegisterPrometheus(config *types.Prometheus) Registry
RegisterPrometheus registers all Prometheus metrics. It must be called only once and failing to register the metrics will lead to a panic.
func RegisterStatsd ¶
RegisterStatsd registers the metrics pusher if this didn't happen yet and creates a statsd Registry instance.