Skip to content

Conversation

@buenaflor
Copy link
Contributor

@buenaflor buenaflor commented Nov 24, 2025

📜 Description

Span First initiative

💡 Motivation and Context

Part of #3331

This is only basic API scaffolding

💚 How did you test it?

No tests yet since there is no specific logic yet

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

🔮 Next steps

#skip-changelog

@buenaflor buenaflor changed the title [Span First #1]: Add simple span protocol [Span First #1]: Add simple span API Nov 24, 2025
@codecov
Copy link

codecov bot commented Nov 24, 2025

Codecov Report

❌ Patch coverage is 5.88235% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.91%. Comparing base (bbdbcb9) to head (9219c7b).
⚠️ Report is 1 commits behind head on feat/span-first.

Files with missing lines Patch % Lines
packages/dart/lib/src/protocol/unset_span.dart 7.69% 12 Missing ⚠️
packages/dart/lib/src/protocol/noop_span.dart 0.00% 8 Missing ⚠️
packages/dart/lib/src/hub.dart 0.00% 6 Missing ⚠️
packages/dart/lib/src/hub_adapter.dart 0.00% 2 Missing ⚠️
packages/dart/lib/src/noop_hub.dart 0.00% 2 Missing ⚠️
packages/dart/lib/src/sentry.dart 0.00% 2 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           feat/span-first    #3360      +/-   ##
===================================================
- Coverage            88.31%   87.91%   -0.41%     
===================================================
  Files                  291      294       +3     
  Lines                 9957     9991      +34     
===================================================
- Hits                  8794     8784      -10     
- Misses                1163     1207      +44     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

import 'span.dart';
import 'span_v2_status.dart';

class SimpleSpan implements Span {
Copy link
Contributor Author

@buenaflor buenaflor Nov 25, 2025

Choose a reason for hiding this comment

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

Also open to calling this SpanImpl or something different. The gist is that this is the default span impl

@buenaflor buenaflor marked this pull request as ready for review November 25, 2025 16:09
@buenaflor
Copy link
Contributor Author

As discussed we will change this to using an internal UnsetSpan which should serve as a marker for not provided span

}

return NoOpSpan();
}
Copy link

Choose a reason for hiding this comment

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

Bug: Redundant conditional logic, both branches return same value

The startSpan method contains redundant conditional logic where all code paths return NoOpSpan(), making the if (!_isEnabled) and else if (_options.isTracingEnabled()) checks meaningless. When tracing is enabled, the method should perform actual implementation logic (as indicated by the TODO), but currently just returns the same no-op as disabled paths. Either the conditional branches are unnecessary, or the enabled branch should contain actual implementation.

Fix in Cursor Fix in Web

Copy link
Contributor Author

@buenaflor buenaflor Nov 26, 2025

Choose a reason for hiding this comment

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

This is just scaffolding, real impl will follow in the next PR

@buenaflor buenaflor requested a review from denrase November 26, 2025 15:48
@buenaflor buenaflor merged commit de96551 into feat/span-first Nov 26, 2025
132 of 134 checks passed
@buenaflor buenaflor deleted the feat/span-protocol branch November 26, 2025 16:27
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.

3 participants