Skip to content

Commit

Permalink
Upgrade Exporter to match new API (#46)
Browse files Browse the repository at this point in the history
* Upgrade Exporter to match new API

* Update datadog.go

Address feedback to have labels override resource attributes.

* go mod tidy

Co-authored-by: Joshua MacDonald <[email protected]>
Co-authored-by: Tyler Yahn <[email protected]>
Co-authored-by: Tyler Yahn <[email protected]>
  • Loading branch information
4 people authored Jun 23, 2020
1 parent 64e2183 commit 6c478fe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion exporters/metric/datadog/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/DataDog/datadog-go/statsd"

"go.opentelemetry.io/otel/api/label"
"go.opentelemetry.io/otel/api/metric"
export "go.opentelemetry.io/otel/sdk/export/metric"
"go.opentelemetry.io/otel/sdk/export/metric/aggregator"
Expand Down Expand Up @@ -73,7 +74,7 @@ func (e *Exporter) Export(ctx context.Context, cs export.CheckpointSet) error {
// TODO: Use the Resource() method
agg := r.Aggregator()
name := e.sanitizeMetricName(r.Descriptor().LibraryName(), r.Descriptor().Name())
itr := r.Labels().Iter()
itr := label.NewMergeIterator(r.Labels(), r.Resource().LabelSet())
tags := append([]string{}, e.opts.Tags...)
for itr.Next() {
label := itr.Label()
Expand Down

0 comments on commit 6c478fe

Please sign in to comment.