Skip to content

Commit

Permalink
receiver/prometheus: add ToMetricPdata method
Browse files Browse the repository at this point in the history
This change wires together the logic to convert
the pdata converters into a method ToMetricPdata
that appends converted metrics. The next change or two,
will then hook everything up directly and will
allow us to delete all the prior code!!

Updates #3137
Updates PR open-telemetry#3674
Requires PR open-telemetry#3694
Updates open-telemetry#3691
  • Loading branch information
odeke-em committed Jul 30, 2021
1 parent 0b8fd4a commit d5f4f03
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions receiver/prometheusreceiver/internal/otlp_metricsbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/pkg/textparse"
"github.com/prometheus/prometheus/pkg/value"
"go.uber.org/zap"

"go.opentelemetry.io/collector/model/pdata"
"go.uber.org/zap"
)

func isUsefulLabelPdata(mType pdata.MetricDataType, labelKey string) bool {
Expand Down Expand Up @@ -110,10 +110,6 @@ func newMetricBuilderPdata(mc MetadataCache, useStartTimeMetric bool, startTimeM
}
}

// This code is used in follow-up changes but golangci-lint is so pedantic.
var _ = newMetricBuilderPdata
var _ = (*metricBuilderPdata)(nil).AddDataPoint

// AddDataPoint is for feeding prometheus data complexValue in its processing order
func (b *metricBuilderPdata) AddDataPoint(ls labels.Labels, t int64, v float64) (rerr error) {
// Any datapoint with duplicate labels MUST be rejected per:
Expand Down

0 comments on commit d5f4f03

Please sign in to comment.