From 9e17996df1db3271512fc043386a553803b2fbcb Mon Sep 17 00:00:00 2001 From: Ziqi Zhao Date: Wed, 2 Aug 2023 07:04:54 +0800 Subject: [PATCH] [chore] fix exhaustive lint for splunkhec exporter (#23882) **Description:** related #23266 Signed-off-by: Ziqi Zhao --- exporter/splunkhecexporter/metricdata_to_splunk.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exporter/splunkhecexporter/metricdata_to_splunk.go b/exporter/splunkhecexporter/metricdata_to_splunk.go index 01bf25e9b274..b0798078d017 100644 --- a/exporter/splunkhecexporter/metricdata_to_splunk.go +++ b/exporter/splunkhecexporter/metricdata_to_splunk.go @@ -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() @@ -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: