-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix OpenTelemetry graceful shutdown. #6738
Fix OpenTelemetry graceful shutdown. #6738
Conversation
10a5921
to
a802c52
Compare
a802c52
to
1092a10
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@David-Wobrock the change looks good. Just one comment on the test.
When running OPA with the distributed tracing option enabled, the OpenTelemetry trace exporter is not gracefully shut down when the server is stopped. This PR fixes that issues by moving the trace exporter shutdown in the gracefulServerShutdown function. Fixes: open-policy-agent#6651 Signed-off-by: Nicolas Chotard <[email protected]> Signed-off-by: David Wobrock <[email protected]>
1092a10
to
de44f77
Compare
Thanks for the review @ashutosh-narkar 🙏 I pushed the edits. Let me know if I can do further changes :) |
}() | ||
<-done | ||
|
||
expected := "Failed to shutdown OpenTelemetry trace exporter gracefully." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also have a test where the trace exporter does not shutdown gracefully?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the variable is misnamed, since we don't expected this message to be present in the logs - and thus test that the trace exporter did shutdown gracefully.
But anyway, I wouldn't know how to write a test where the trace exporter doesn't shutdown gracefully 😕
I'd need some help here :)
Or we could add such a test in a later PR, and start with this fix for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure we can do that.
Why the changes in this PR are needed?
When running OPA with the distributed tracing option enabled, the OpenTelemetry trace exporter is not gracefully shut down when the server is stopped.
What are the changes in this PR?
This PR fixes that issues by moving the trace exporter shutdown in the gracefulServerShutdown function.
Notes to assist PR review:
Picked up from #6664
Further comments:
Fixes #6651.
This bug seems to have been introduced by this commit.