From ba437f1d77a20ffbcd07692c0c5256cbbec489b1 Mon Sep 17 00:00:00 2001 From: David Ashpole Date: Tue, 18 Oct 2022 15:57:43 +0000 Subject: [PATCH] remove unneccessary variable --- exporters/prometheus/exporter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exporters/prometheus/exporter.go b/exporters/prometheus/exporter.go index 33677326916..2c0aed18043 100644 --- a/exporters/prometheus/exporter.go +++ b/exporters/prometheus/exporter.go @@ -76,7 +76,7 @@ func (c *collector) Describe(ch chan<- *prometheus.Desc) { if err != nil { otel.Handle(err) } - for _, metricData := range c.getMetricData(metrics, c.withoutUnits) { + for _, metricData := range c.getMetricData(metrics) { ch <- metricData.description } } @@ -90,7 +90,7 @@ func (c *collector) Collect(ch chan<- prometheus.Metric) { // TODO(#3166): convert otel resource to target_info // see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#resource-attributes-1 - for _, metricData := range c.getMetricData(metrics, c.withoutUnits) { + for _, metricData := range c.getMetricData(metrics) { if metricData.valueType == prometheus.UntypedValue { m, err := prometheus.NewConstHistogram(metricData.description, metricData.histogramCount, metricData.histogramSum, metricData.histogramBuckets, metricData.attributeValues...) if err != nil { @@ -123,7 +123,7 @@ type metricData struct { histogramBuckets map[float64]uint64 } -func (c *collector) getMetricData(metrics metricdata.ResourceMetrics, withoutUnits bool) []*metricData { +func (c *collector) getMetricData(metrics metricdata.ResourceMetrics) []*metricData { allMetrics := make([]*metricData, 0) for _, scopeMetrics := range metrics.ScopeMetrics { for _, m := range scopeMetrics.Metrics {