-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(otel): ensure OTEL sends final span when -o opt is used (#6505)
* fix(otel): ensure OTEL sends final span when -o opt is used Before this fix, when the -o/--output option was used, Garden would call the `shutdown` function early which prevented the final OTEL span to be emitted. Now we only run the shutdown logic and (wait for output flush) at the very end of the command run. This also means that the `Cli.run()` method no longer has hard-to-predict side effects, depending on what flags were passed. * refactor(cli): remove `exitOnAbort` option This option didn't appear to have any real meaning after we moved the call to the `shutdown` function to the parent caller (i.e. the `runCli()` function) as opposed to the `Cli.run()` method so we're removing it here. * fix(otel): do not attempt to shutdown if target exporter not set Before this fix, attempting to shutdown the OTEL SDK would hang if called before a target exporter is set. The target exporter is set in the Garden class so this would e.g. happen when running 'garden help' and cause a delay before the attempt to shutdown OTEL times out. With this commit we now check whether an exporter is configured, either via env vars or the ReconfigurableExporter, and only attempt to shut down if that's the case. Note that we need to handle this in the enclosing context as opposed to having the ReconfigurableExporter handle it itself because the exporter doesn't "know" if a target exporter will be set later or not.
- Loading branch information
Showing
12 changed files
with
5,611 additions
and
4,897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.