Add prefix to datadog metrics

This commit is contained in:
Huan Wang 2021-10-06 09:34:07 -06:00 committed by GitHub
parent 32340252b2
commit 85dd45cb81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 90 additions and 34 deletions

View file

@ -41,6 +41,7 @@ type Datadog struct {
AddEntryPointsLabels bool `description:"Enable metrics on entry points." json:"addEntryPointsLabels,omitempty" toml:"addEntryPointsLabels,omitempty" yaml:"addEntryPointsLabels,omitempty" export:"true"`
AddRoutersLabels bool `description:"Enable metrics on routers." json:"addRoutersLabels,omitempty" toml:"addRoutersLabels,omitempty" yaml:"addRoutersLabels,omitempty" export:"true"`
AddServicesLabels bool `description:"Enable metrics on services." json:"addServicesLabels,omitempty" toml:"addServicesLabels,omitempty" yaml:"addServicesLabels,omitempty" export:"true"`
Prefix string `description:"Prefix to use for metrics collection." json:"prefix,omitempty" toml:"prefix,omitempty" yaml:"prefix,omitempty" export:"true"`
}
// SetDefaults sets the default values.
@ -58,6 +59,7 @@ func (d *Datadog) SetDefaults() {
d.PushInterval = types.Duration(10 * time.Second)
d.AddEntryPointsLabels = true
d.AddServicesLabels = true
d.Prefix = "traefik"
}
// Statsd contains address and metrics pushing interval configuration.