Skip to content

Conversation

@adinauer
Copy link
Member

📜 Description

Add addFeatureFlag method to span and transaction.

It'll allow setting a max of 10 feature flag evaluations per span.
Spans do not inherit or share flags, so each span is separate.
When the limit has been reached new values are rejected but existing values may be updated.

💡 Motivation and Context

Another part of #4763

💚 How did you test it?

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 39dbf57

@cursor
Copy link

cursor bot commented Oct 23, 2025

Bug: Feature Flag Data Handling Causes Unintended Mutations

The feature flag logic in the SentrySpan constructor directly modifies the data map parameter. This results in feature flags being silently dropped if data is null, and it mutates the original Span's data map if data is not null, which can cause unintended side effects.

Fix in Cursor Fix in Web

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 367.76 ms 460.02 ms 92.26 ms
Size 1.58 MiB 2.12 MiB 549.76 KiB

Previous results on branch: feat/feature-flags-on-spans

Startup times

Revision Plain With Sentry Diff
8a5f7d1 322.31 ms 431.93 ms 109.63 ms
cb9cf5e 313.21 ms 359.20 ms 46.00 ms

App size

Revision Plain With Sentry Diff
8a5f7d1 1.58 MiB 2.12 MiB 549.68 KiB
cb9cf5e 1.58 MiB 2.12 MiB 549.76 KiB

@adinauer adinauer marked this pull request as draft October 23, 2025 17:04
@adinauer adinauer marked this pull request as ready for review October 24, 2025 09:53
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

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