Skip to content

Commit

Permalink
removed the use of deprecated go.opentelemetry.io/collector/model
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-shopify committed May 12, 2022
1 parent f6ac807 commit d16e3b9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions exporter/prometheusexporter/collector.go
Expand Up @@ -20,7 +20,6 @@ import (

"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/model"
"go.opentelemetry.io/collector/model/pdata"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/pmetric"
conventions "go.opentelemetry.io/collector/semconv/v1.6.1"
Expand Down Expand Up @@ -223,7 +222,7 @@ func (c *collector) convertDoubleHistogram(metric pmetric.Metric, resourceAttrs
e := ip.Exemplars().At(i)

labels := make(prometheus.Labels, e.FilteredAttributes().Len())
e.FilteredAttributes().Range(func(k string, v pdata.Value) bool {
e.FilteredAttributes().Range(func(k string, v pcommon.Value) bool {
labels[k] = v.AsString()
return true
})
Expand Down
3 changes: 1 addition & 2 deletions exporter/prometheusexporter/collector_test.go
Expand Up @@ -21,7 +21,6 @@ import (
"github.com/prometheus/client_golang/prometheus"
io_prometheus_client "github.com/prometheus/client_model/go"
"github.com/stretchr/testify/require"
"go.opentelemetry.io/collector/model/pdata"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/pmetric"
conventions "go.opentelemetry.io/collector/semconv/v1.6.1"
Expand Down Expand Up @@ -139,7 +138,7 @@ func TestConvertDoubleHistogramExemplar(t *testing.T) {
for k, v := range e.Labels {
pde.FilteredAttributes().InsertString(k, v)
}
pde.SetTimestamp(pdata.NewTimestampFromTime(e.Timestamp))
pde.SetTimestamp(pcommon.NewTimestampFromTime(e.Timestamp))
}

pMap := pcommon.NewMap()
Expand Down
1 change: 0 additions & 1 deletion exporter/prometheusexporter/go.mod
Expand Up @@ -12,7 +12,6 @@ require (
github.com/prometheus/prometheus v0.35.1-0.20220503184552-2381d7be5731
github.com/stretchr/testify v1.7.1
go.opentelemetry.io/collector v0.50.1-0.20220429151328-041f39835df7
go.opentelemetry.io/collector/model v0.50.0
go.opentelemetry.io/collector/pdata v0.50.1-0.20220429151328-041f39835df7
go.opentelemetry.io/collector/semconv v0.50.1-0.20220429151328-041f39835df7
go.uber.org/zap v1.21.0
Expand Down
2 changes: 0 additions & 2 deletions exporter/prometheusexporter/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d16e3b9

Please sign in to comment.