Repository navigation
cli-plugins/plugin: add PersistentPostRunE for shutting down otel providers - #7433
Open
jsternberg wants to merge 1 commit into
Open
jsternberg wants to merge 1 commit into
jsternberg wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
docker-agent
left a comment
Contributor
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
…viders OTEL providers provided by this library to plugins were not properly shut down. Metrics from the CLI were forcibly flushed in a separate area and the `buildx` command does its own flushing, but this didn't apply to traces. Add shutdown on post run for plugins. This will allow compose to use the tracer provider from this library rather than roll its own custom one. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
jsternberg
force-pushed
the
trace-and-metrics-shutdown
branch
from
October 23, 2026 18:52
bcd15ee to
f2a66e4
Compare
vvoland
reviewed
Oct 26, 2026
Comment on lines
+83
to
+84
| PersistentPostRunE = func(cmd *cobra.Command, _ []string) error { | ||
| persistentPostRunOnce.Do(func() { |
Collaborator
There was a problem hiding this comment.
This will only run for commands that succeed - is this what we want here?
vvoland
reviewed
Oct 26, 2026
| } | ||
| }) | ||
| } | ||
| wg.Wait() |
Collaborator
There was a problem hiding this comment.
Do these Shutdown methods have a guarantee to finish in the given timeout?
If not, perhaps we should run this in a goroutine which we would only wait for the ExportTimeout and if they dont manage to return in that time, just continue with shutdown
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OTEL providers provided by this library to plugins were not properly
shut down. Metrics from the CLI were forcibly flushed in a separate area
and the
buildxcommand does its own flushing, but this didn't apply totraces.
Add shutdown on post run for plugins. This will allow compose to use the
tracer provider from this library rather than roll its own custom one.