Skip to content

Conversation

samuel-williams-shopify
Copy link
Contributor

@samuel-williams-shopify samuel-williams-shopify commented Aug 26, 2025

  • Fix Traces.active? to return false when there is no active trace (previously always returned true even for INVALID spans).
  • Fix Traces.trace_context to return nil when there is no active trace (previously returned invalid Context objects with zero trace_ids).
  • Both methods now use OpenTelemetry::Trace::Span::INVALID for proper detection of inactive traces instead of manual trace_id checking.
  • Add test case to ensure trace_context returns nil in clean Fiber context.
  • Resolves issues with Async incorrectly detecting active traces.

Types of Changes

  • Bug fix.

Contribution

@samuel-williams-shopify samuel-williams-shopify force-pushed the fix-active-and-trace-context-methods branch 5 times, most recently from 067d07c to 62970dd Compare August 26, 2025 08:29
- Fix Traces.active? to return false when there is no active trace
  (previously always returned true even for INVALID spans)
- Fix Traces.trace_context to return nil when there is no active trace
  (previously returned invalid Context objects with zero trace_ids)
- Both methods now use OpenTelemetry::Trace::Span::INVALID for proper
  detection of inactive traces instead of manual trace_id checking
- Add test case to ensure trace_context returns nil in clean Fiber context
- Resolves issues with Async incorrectly detecting active traces
@samuel-williams-shopify samuel-williams-shopify force-pushed the fix-active-and-trace-context-methods branch from 62970dd to 28e9e50 Compare August 26, 2025 08:34
@samuel-williams-shopify samuel-williams-shopify merged commit 4c88db3 into main Aug 26, 2025
36 of 40 checks passed
@samuel-williams-shopify samuel-williams-shopify deleted the fix-active-and-trace-context-methods branch August 26, 2025 08:37
gem "covered"
gem "decode"

Copy link

Choose a reason for hiding this comment

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

✂️

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