Skip to content

Commit

Permalink
remove unneccessary variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Oct 18, 2022
1 parent 1a6843c commit ba437f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions exporters/prometheus/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand All @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit ba437f1

Please sign in to comment.