Skip to content

Commit

Permalink
[chore] fix exhaustive lint for splunkhec exporter (#23882)
Browse files Browse the repository at this point in the history
**Description:** 
related #23266

Signed-off-by: Ziqi Zhao <[email protected]>
  • Loading branch information
fatsheep9146 authored Aug 1, 2023
1 parent d4146f5 commit 9e17996
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions exporter/splunkhecexporter/metricdata_to_splunk.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func mapMetricToSplunkEvent(res pcommon.Resource, m pmetric.Metric, config *Conf
return true
})
metricFieldName := splunkMetricValue + ":" + m.Name()
//exhaustive:enforce
switch m.Type() {
case pmetric.MetricTypeGauge:
pts := m.Gauge().DataPoints()
Expand Down Expand Up @@ -204,6 +205,11 @@ func mapMetricToSplunkEvent(res pcommon.Resource, m pmetric.Metric, config *Conf
}
}
return splunkMetrics
case pmetric.MetricTypeExponentialHistogram:
logger.Warn(
"Point with unsupported type ExponentialHistogram",
zap.Any("metric", m))
return nil
case pmetric.MetricTypeEmpty:
return nil
default:
Expand Down

0 comments on commit 9e17996

Please sign in to comment.