Skip to content

Finish OTel span before forcing finish#3454

Merged
hannahramadan merged 2 commits intodevfrom
otel_bridge_bugfix_unfinished_segment
Feb 17, 2026
Merged

Finish OTel span before forcing finish#3454
hannahramadan merged 2 commits intodevfrom
otel_bridge_bugfix_unfinished_segment

Conversation

@hannahramadan
Copy link
Contributor

@hannahramadan hannahramadan commented Feb 13, 2026

When replacing agent instrumentation with OTel's, we'd sometimes see a race condition where OTel spans finished asynchronously after New Relic transactions completed:

DEBUG : Segment: HTTP POST was unfinished at the end of transaction. Timing information for this segment's parent Middleware/Rack/Rack::Events/call in Controller/articles/create may be inaccurate.

This PR introduces a patch on Abstract Segment when the hybrid agent is enabled to finish OTel spans before forcing the NR segments to end.

closes #3140

@github-actions
Copy link
Contributor

SimpleCov Report

Coverage Threshold
Line 93.33% 93%

@hannahramadan hannahramadan marked this pull request as ready for review February 13, 2026 21:19
@hannahramadan hannahramadan requested a review from a team as a code owner February 13, 2026 21:19
@hannahramadan hannahramadan merged commit 9954488 into dev Feb 17, 2026
44 checks passed
@hannahramadan hannahramadan deleted the otel_bridge_bugfix_unfinished_segment branch February 17, 2026 16:16
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.

Verify behavior when both the opentelemetry-sdk and newrelic_rpm gem are installed and enabled

2 participants

Comments