Skip to content

api

f07c6d1
Select commit
Loading
Failed to load commit list.
Merged

Add span based feature flags #4831

api
f07c6d1
Select commit
Loading
Failed to load commit list.
Cursor / Cursor Bugbot completed Nov 11, 2025 in 4m 0s

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

*/
public SpanContext(final @NotNull SpanContext spanContext) {
this.traceId = spanContext.traceId;
this.spanId = spanContext.spanId;
this.parentSpanId = spanContext.parentSpanId;
setSamplingDecision(spanContext.samplingDecision);
this.op = spanContext.op;
this.description = spanContext.description;
this.status = spanContext.status;
final Map<String, String> copiedTags = CollectionUtils.newConcurrentHashMap(spanContext.tags);
if (copiedTags != null) {
this.tags = copiedTags;
}
final Map<String, Object> copiedUnknown =
CollectionUtils.newConcurrentHashMap(spanContext.unknown);
if (copiedUnknown != null) {
this.unknown = copiedUnknown;
}
this.baggage = spanContext.baggage;
final Map<String, Object> copiedData = CollectionUtils.newConcurrentHashMap(spanContext.data);
if (copiedData != null) {
this.data = copiedData;
}
}

Fix in Cursor Fix in Web