Skip to content

Commit cc0a999

Browse files
authored
Remove the confusing package-level variable (#2152)
This is unncessarily a package level variable and at the same time, the name is confusing. It should be called "empty" instead of dummy. But no need to have it as a package-level variable, hence this change removes it.
1 parent 8ceddba commit cc0a999

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

receiver/prometheusreceiver/internal/metricsbuilder.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ var (
4242
errNoDataToBuild = errors.New("there's no data to build")
4343
errNoBoundaryLabel = errors.New("given metricType has no BucketLabel or QuantileLabel")
4444
errEmptyBoundaryLabel = errors.New("BucketLabel or QuantileLabel is empty")
45-
46-
dummyMetrics = make([]*metricspb.Metric, 0)
4745
)
4846

4947
type metricBuilder struct {
@@ -140,7 +138,7 @@ func (b *metricBuilder) AddDataPoint(ls labels.Labels, t int64, v float64) error
140138
func (b *metricBuilder) Build() ([]*metricspb.Metric, int, int, error) {
141139
if !b.hasData {
142140
if b.hasInternalMetric {
143-
return dummyMetrics, 0, 0, nil
141+
return make([]*metricspb.Metric, 0), 0, 0, nil
144142
}
145143
return nil, 0, 0, errNoDataToBuild
146144
}

0 commit comments

Comments
 (0)