Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[exporter/datadog] Add api.fail_on_invalid_key to fail fast if API Key is invalid #9426

Merged
merged 11 commits into from
May 5, 2022
1 change: 1 addition & 0 deletions exporter/datadogexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ func (f *factory) createTracesExporter(
}

ctx, cancel := context.WithCancel(ctx)
defer cancel()
mx-psi marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this cancels the exporter prematurely after the function exits. The cancel is only meant to be called on shutdown (it is part of shutdown, so technically it does get called on all paths).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(it is part of shutdown, so technically it does get called on all paths).

the lint was failing because it was not called when the traces exporter fails to get created. I opened #9797 to fix this, thanks for spotting that!

var pushTracesFn consumer.ConsumeTracesFunc

if cfg.OnlyMetadata {
Expand Down