Repository navigation
feat!(opentelemetry): Bump opentelemetry support to 0.32 - #1262
Merged
Merged
Conversation
Increase our opentelemetry support to the latest 0.32.x line. BREAKING CHANGE: The opentelemetry integration is no longer compatible with 0.29.x versions of opentelemetry. Resolves [#1261](#1261) Resolves [RUST-269](https://linear.app/getsentry/issue/RUST-269)
szokeasaurusrex
force-pushed
the
szokeasaurusrex/bump-otel
branch
from
July 24, 2026 11:49
f0deecb to
04e995f
Compare
szokeasaurusrex
marked this pull request as ready for review
July 24, 2026 11:50
giortzisg
approved these changes
Jul 24, 2026
Also, replace the dependency snippet (which contained an outdated sentry version) with a prose statement about which crates to install
Comment on lines
189
to
198
| Ok(()) | ||
| } | ||
|
|
||
| fn shutdown_with_timeout(&self, _timeout: Duration) -> OTelSdkResult { | ||
| Ok(()) | ||
| } | ||
|
|
||
| fn set_resource(&mut self, resource: &Resource) { | ||
| sentry_core::configure_scope(|scope| { | ||
| let otel_context = sentry_core::protocol::OtelContext { |
There was a problem hiding this comment.
Bug: The shutdown_with_timeout method is a no-op and doesn't flush pending spans from the SPAN_MAP, leading to data loss for unfinished spans on application termination.
Severity: HIGH
Suggested Fix
Implement the shutdown_with_timeout method to drain the SPAN_MAP. It should iterate over any remaining spans, finalize them, and ensure they are sent to Sentry before the timeout expires. This will prevent data loss for spans that are still in-flight during application shutdown.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: sentry-opentelemetry/src/processor.rs#L189-L198
Potential issue: The `shutdown_with_timeout` method is currently a no-op. According to
the OpenTelemetry specification, the shutdown process should include flushing any
pending telemetry data. In this implementation, spans are stored in a static `SPAN_MAP`
and are only removed and sent to Sentry when their `on_end()` method is called. If the
application terminates and `shutdown_with_timeout` is invoked while there are still
active spans in `SPAN_MAP`, these spans will be lost because the shutdown implementation
does not drain the map and finalize them. The OTel spec also notes that `on_end`
callbacks are not guaranteed after shutdown, meaning these spans will never be
processed.
This was referenced Jul 28, 2026
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.
Increase our opentelemetry support to the latest 0.32.x line.
BREAKING CHANGE: The opentelemetry integration is no longer compatible with 0.29.x versions of opentelemetry.
Resolves #1261
Resolves RUST-269