Skip to content

Commit

Permalink
[exporter/datadog] Fix canceling on createTracesExporter (open-tele…
Browse files Browse the repository at this point in the history
  • Loading branch information
mx-psi committed May 9, 2022
1 parent 0cd0ee5 commit 613c9ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exporter/datadogexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ func (f *factory) createTracesExporter(
}

ctx, cancel := context.WithCancel(ctx)
defer cancel()
var pushTracesFn consumer.ConsumeTracesFunc

if cfg.OnlyMetadata {
Expand All @@ -216,6 +215,7 @@ func (f *factory) createTracesExporter(
} else {
exporter, err := newTracesExporter(ctx, set, cfg, &f.onceMetadata)
if err != nil {
cancel()
return nil, err
}
pushTracesFn = exporter.pushTraceDataScrubbed
Expand Down

0 comments on commit 613c9ed

Please sign in to comment.