diff --git a/pkg/exporter/exporter.go b/pkg/exporter/exporter.go index ae73353..0ee0b36 100644 --- a/pkg/exporter/exporter.go +++ b/pkg/exporter/exporter.go @@ -20,6 +20,7 @@ import ( "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/statsd_exporter/pkg/clock" "github.com/prometheus/statsd_exporter/pkg/event" "github.com/prometheus/statsd_exporter/pkg/mapper" diff --git a/pkg/mapper/mapper_defaults.go b/pkg/mapper/mapper_defaults.go index b0f9bec..291aeee 100644 --- a/pkg/mapper/mapper_defaults.go +++ b/pkg/mapper/mapper_defaults.go @@ -17,9 +17,19 @@ import "time" type mapperConfigDefaults struct { ObserverType ObserverType `yaml:"observer_type"` - TimerType ObserverType `yaml:"timer_type,omitempty"` // DEPRECATED - field only present to preserve backwards compatibility in configs. Always empty - Buckets []float64 `yaml:"buckets"` // DEPRECATED - field only present to preserve backwards compatibility in configs. Always empty - Quantiles []metricObjective `yaml:"quantiles"` // DEPRECATED - field only present to preserve backwards compatibility in configs. Always empty + MatchType MatchType `yaml:"match_type"` + GlobDisableOrdering bool `yaml:"glob_disable_ordering"` + 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"` GlobDisableOrdering bool `yaml:"glob_disable_ordering"` 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 // observer_type will override timer_type func (d *mapperConfigDefaults) UnmarshalYAML(unmarshal func(interface{}) error) error { - type mapperConfigDefaultsAlias mapperConfigDefaults var tmp mapperConfigDefaultsAlias if err := unmarshal(&tmp); err != nil { return err