Skip to content

Commit

Permalink
[chore] fix exhaustive lint for statsd receiver (open-telemetry#24046)
Browse files Browse the repository at this point in the history
**Description:** 
related open-telemetry#23266

Signed-off-by: Ziqi Zhao <[email protected]>
  • Loading branch information
fatsheep9146 committed Jul 10, 2023
1 parent 6f40800 commit 4341e10
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,6 @@ issues:
- path: prometheusreceiver
linters:
- exhaustive
- path: statsdreceiver
linters:
- exhaustive
- path: deltatorateprocessor
linters:
- exhaustive
Expand Down
4 changes: 2 additions & 2 deletions receiver/statsdreceiver/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (c *Config) Validate() error {
}

switch eachMap.StatsdType {
case protocol.TimingTypeName, protocol.TimingAltTypeName, protocol.HistogramTypeName:
case protocol.TimingTypeName, protocol.TimingAltTypeName, protocol.HistogramTypeName, protocol.CounterTypeName, protocol.GaugeTypeName:
default:
errs = multierr.Append(errs, fmt.Errorf("statsd_type is not a supported mapping: %s", eachMap.StatsdType))
}
Expand All @@ -50,7 +50,7 @@ func (c *Config) Validate() error {
}

switch eachMap.ObserverType {
case protocol.GaugeObserver, protocol.SummaryObserver, protocol.HistogramObserver:
case protocol.GaugeObserver, protocol.SummaryObserver, protocol.HistogramObserver, protocol.DisableObserver:
default:
errs = multierr.Append(errs, fmt.Errorf("observer_type is not supported: %s", eachMap.ObserverType))
}
Expand Down
2 changes: 2 additions & 0 deletions receiver/statsdreceiver/protocol/statsd_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (p *StatsDParser) Initialize(enableMetricType bool, isMonotonicCounter bool
case TimingTypeName, TimingAltTypeName:
p.timerEvents.method = eachMap.ObserverType
p.timerEvents.histogramConfig = expoHistogramConfig(eachMap.Histogram)
case CounterTypeName, GaugeTypeName:
}
}
return nil
Expand Down Expand Up @@ -258,6 +259,7 @@ func (p *StatsDParser) observerCategoryFor(t MetricType) ObserverCategory {
return p.histogramEvents
case TimingType:
return p.timerEvents
case CounterType, GaugeType:
}
return defaultObserverCategory
}
Expand Down

0 comments on commit 4341e10

Please sign in to comment.