Skip to content

Commit

Permalink
[receiver/statsd] fix linting changes
Browse files Browse the repository at this point in the history
There were changes in behaviour introduced in open-telemetry#24046 which
needed to be fixed to maintain current receiver behaviour.

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten committed Jul 10, 2023
1 parent 11134b0 commit 8c1092f
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions receiver/statsdreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ func (c *Config) Validate() error {
}

switch eachMap.StatsdType {
case protocol.TimingTypeName, protocol.TimingAltTypeName, protocol.HistogramTypeName, protocol.CounterTypeName, protocol.GaugeTypeName:
case protocol.TimingTypeName, protocol.TimingAltTypeName, protocol.HistogramTypeName:
// do nothing
case protocol.CounterTypeName, protocol.GaugeTypeName:
fallthrough
default:
errs = multierr.Append(errs, fmt.Errorf("statsd_type is not a supported mapping: %s", eachMap.StatsdType))
errs = multierr.Append(errs, fmt.Errorf("statsd_type is not a supported mapping for histogram and timing metrics: %s", eachMap.StatsdType))
}

if eachMap.ObserverType == "" {
Expand All @@ -50,9 +53,12 @@ func (c *Config) Validate() error {
}

switch eachMap.ObserverType {
case protocol.GaugeObserver, protocol.SummaryObserver, protocol.HistogramObserver, protocol.DisableObserver:
case protocol.GaugeObserver, protocol.SummaryObserver, protocol.HistogramObserver:
// do nothing
case protocol.DisableObserver:
fallthrough
default:
errs = multierr.Append(errs, fmt.Errorf("observer_type is not supported: %s", eachMap.ObserverType))
errs = multierr.Append(errs, fmt.Errorf("observer_type is not supported for histogram and timing metrics: %s", eachMap.ObserverType))
}

if eachMap.ObserverType == protocol.HistogramObserver {
Expand Down

0 comments on commit 8c1092f

Please sign in to comment.