Skip to content

Refactor OpenTelemetry context propagation and cleanup specs#47

Merged
KirIgor merged 4 commits into
umbrellio:async-pass-otelfrom
avoleba:async-pass-otel-refactor
Jul 8, 2026
Merged

Refactor OpenTelemetry context propagation and cleanup specs#47
KirIgor merged 4 commits into
umbrellio:async-pass-otelfrom
avoleba:async-pass-otel-refactor

Conversation

@avoleba

@avoleba avoleba commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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!

@avoleba avoleba changed the base branch from master to async-pass-otel July 5, 2026 06:45
@KirIgor KirIgor merged commit a81812e into umbrellio:async-pass-otel Jul 8, 2026
3 checks passed
@KirIgor

KirIgor commented Jul 8, 2026

Copy link
Copy Markdown
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants