Refactor OpenTelemetry context propagation and cleanup specs#47
Merged
KirIgor merged 4 commits intoJul 8, 2026
Merged
Conversation
Contributor
|
Thank you! 🔥 |
KirIgor
added a commit
that referenced
this pull request
Jul 8, 2026
* propagate OpenTelemetry context to async thread pool workers Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix rubocop offenses Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * use real opentelemetry-api gem in tests instead of stubs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * drop Ruby < 3.3 support, add 3.4 to CI matrix Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * bump TargetRubyVersion to 3.3, apply new style cops Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Refactor OpenTelemetry context propagation and cleanup specs (#47) * Refactor async_run to properly handle OpenTelemetry context propagation in async jobs * Refactor rspec by isolating OpenTelemetry context propagation logic * Update upsert method documentation to clarify parameters and usage example * Bump umbrellio-sequel-plugins version to 0.19.0 * add release workflow * fix release workflow * style fix --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: avoleba <52998202+avoleba@users.noreply.github.com>
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.
Hi @tycooon and @KirIgor! 👋
I noticed the review comments in PR #46 regarding the OpenTelemetry integration. I decided to help out and implement the requested fixes to unblock the feature.
This PR addresses the following points from the review:
Narrowed the guard: Changed defined?(OpenTelemetry) to defined?(OpenTelemetry::Context) to prevent NameError when only the API is loaded.
Zero-overhead short-circuit: Added a fallback to the plain path if otel_context.equal?(OpenTelemetry::Context::ROOT), avoiding unnecessary Proc creation when tracing is inactive.
Cleaner API usage: Replaced manual attach/detach token dance with OpenTelemetry::Context.with_current in the code and with_value in the specs.
Regarding the longer-term thought about a generic job-wrapper hook in opts — I agree it's a better architectural approach. I can open a separate follow-up PR for that if you'll to approve these fixes.
Let me know if any adjustments are needed!