Add span based feature flags #4831
Bugbot Review
Bugbot Analysis Progress (4m 2s elapsed)
✅ Gathered PR context (2s)
✅ Analyzed code changes (1s)
✅ Completed bug detection — 1 potential bug found (3m 26s)
✅ Validation and filtering completed (0s)
✅ Posted analysis results — 1 bug reported (33s)
✅ Analysis completed successfully (0s)
Final Result: Bugbot completed review and found 1 potential issue
Request ID: serverGenReqId_753a8966-ce71-4133-b54c-6e8f96ac1af6
Details
Bug: Flags Lost in Context Duplication
The SpanContext copy constructor doesn't copy the featureFlags field, causing feature flags to be lost when contexts are cloned (e.g., via Contexts or MonitorContexts copy constructors). The field should be cloned similar to how tags and data are copied.
sentry/src/main/java/io/sentry/SpanContext.java#L120-L144
sentry-java/sentry/src/main/java/io/sentry/SpanContext.java
Lines 120 to 144 in f07c6d1