forked from mirrors/statsd_exporter
remove deprecated fields from mapper defaults config
Signed-off-by: glightfoot <glightfoot@rsglab.com>
This commit is contained in:
parent
06411336c7
commit
58aed41ff2
2 changed files with 14 additions and 4 deletions
|
@ -20,6 +20,7 @@ import (
|
||||||
"github.com/go-kit/kit/log"
|
"github.com/go-kit/kit/log"
|
||||||
"github.com/go-kit/kit/log/level"
|
"github.com/go-kit/kit/log/level"
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
|
|
||||||
"github.com/prometheus/statsd_exporter/pkg/clock"
|
"github.com/prometheus/statsd_exporter/pkg/clock"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/event"
|
"github.com/prometheus/statsd_exporter/pkg/event"
|
||||||
"github.com/prometheus/statsd_exporter/pkg/mapper"
|
"github.com/prometheus/statsd_exporter/pkg/mapper"
|
||||||
|
|
|
@ -17,9 +17,19 @@ import "time"
|
||||||
|
|
||||||
type mapperConfigDefaults struct {
|
type mapperConfigDefaults struct {
|
||||||
ObserverType ObserverType `yaml:"observer_type"`
|
ObserverType ObserverType `yaml:"observer_type"`
|
||||||
TimerType ObserverType `yaml:"timer_type,omitempty"` // DEPRECATED - field only present to preserve backwards compatibility in configs. Always empty
|
MatchType MatchType `yaml:"match_type"`
|
||||||
Buckets []float64 `yaml:"buckets"` // DEPRECATED - field only present to preserve backwards compatibility in configs. Always empty
|
GlobDisableOrdering bool `yaml:"glob_disable_ordering"`
|
||||||
Quantiles []metricObjective `yaml:"quantiles"` // DEPRECATED - field only present to preserve backwards compatibility in configs. Always empty
|
Ttl time.Duration `yaml:"ttl"`
|
||||||
|
SummaryOptions SummaryOptions `yaml:"summary_options"`
|
||||||
|
HistogramOptions HistogramOptions `yaml:"histogram_options"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// mapperConfigDefaultsAlias is used to allow deprecated fields
|
||||||
|
type mapperConfigDefaultsAlias struct {
|
||||||
|
ObserverType ObserverType `yaml:"observer_type"`
|
||||||
|
TimerType ObserverType `yaml:"timer_type,omitempty"` // DEPRECATED - field only present to preserve backwards compatibility in configs
|
||||||
|
Buckets []float64 `yaml:"buckets"` // DEPRECATED - field only present to preserve backwards compatibility in configs
|
||||||
|
Quantiles []metricObjective `yaml:"quantiles"` // DEPRECATED - field only present to preserve backwards compatibility in configs
|
||||||
MatchType MatchType `yaml:"match_type"`
|
MatchType MatchType `yaml:"match_type"`
|
||||||
GlobDisableOrdering bool `yaml:"glob_disable_ordering"`
|
GlobDisableOrdering bool `yaml:"glob_disable_ordering"`
|
||||||
Ttl time.Duration `yaml:"ttl"`
|
Ttl time.Duration `yaml:"ttl"`
|
||||||
|
@ -30,7 +40,6 @@ type mapperConfigDefaults struct {
|
||||||
// UnmarshalYAML is a custom unmarshal function to allow use of deprecated config keys
|
// UnmarshalYAML is a custom unmarshal function to allow use of deprecated config keys
|
||||||
// observer_type will override timer_type
|
// observer_type will override timer_type
|
||||||
func (d *mapperConfigDefaults) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
func (d *mapperConfigDefaults) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
type mapperConfigDefaultsAlias mapperConfigDefaults
|
|
||||||
var tmp mapperConfigDefaultsAlias
|
var tmp mapperConfigDefaultsAlias
|
||||||
if err := unmarshal(&tmp); err != nil {
|
if err := unmarshal(&tmp); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue