Skip to content

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented Nov 25, 2025

Problem

HTTP fetch spans from automatic instrumentation weren't appearing as children of custom spans (e.g., "execute search"). They were appearing as siblings instead.

Solution

Refactored traceSpan() helper to use startActiveSpan() instead of startSpan(). This automatically sets the span as the active context, allowing automatic instrumentation to properly create child spans.

Result

  • Fetch calls now appear as children of their parent spans
  • Proper trace hierarchy in telemetry
  • Cleaner, more idiomatic OpenTelemetry code

@reakaleek reakaleek requested a review from a team as a code owner November 25, 2025 09:30
@reakaleek reakaleek requested a review from Mpdreamz November 25, 2025 09:30
@reakaleek reakaleek merged commit fad1045 into main Nov 25, 2025
28 of 29 checks passed
@reakaleek reakaleek deleted the feature/fix-active-span branch November 25, 2025 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants