Skip to content

feat!(opentelemetry): Bump opentelemetry support to 0.32 - #1262

Merged
szokeasaurusrex merged 2 commits into
masterfrom
szokeasaurusrex/bump-otel
Jul 24, 2026
Merged

szokeasaurusrex merged 2 commits into
masterfrom
szokeasaurusrex/bump-otel

Conversation

@szokeasaurusrex

Copy link
Copy Markdown
Member

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

@linear-code

linear-code Bot commented Jul 24, 2026

Copy link
Copy Markdown

RUST-269

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
szokeasaurusrex force-pushed the szokeasaurusrex/bump-otel branch from f0deecb to 04e995f Compare July 24, 2026 11:49
@szokeasaurusrex
szokeasaurusrex marked this pull request as ready for review July 24, 2026 11:50
@szokeasaurusrex
szokeasaurusrex requested a review from a team as a code owner July 24, 2026 11:50
Comment thread sentry-opentelemetry/src/processor.rs Resolved
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 {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@szokeasaurusrex
szokeasaurusrex merged commit 10fc0be into master Jul 24, 2026
28 checks passed
@szokeasaurusrex
szokeasaurusrex deleted the szokeasaurusrex/bump-otel branch July 24, 2026 14:05
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.

Support the newest OpenTelemetry

2 participants