Skip to content

Commit b037ef9

Browse files
mtoffl01claude
andcommitted
chore(tracer): log when baggage extract limits are hit
Split the combined limit check so we can emit a distinct warning for the items vs. bytes case when entries are dropped. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent f5aa1d6 commit b037ef9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ddtrace/tracer/textmap.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,12 @@ func (*propagatorBaggage) extractTextMap(reader TextMapReader) (*SpanContext, er
14491449
if ctr > 0 {
14501450
itemBytes++ // comma separator
14511451
}
1452-
if ctr >= baggageMaxItems || byteCount+itemBytes > baggageMaxBytes {
1452+
if ctr >= baggageMaxItems {
1453+
log.Warn("baggage item count exceeded limit (%d), dropping remaining items", baggageMaxItems)
1454+
break
1455+
}
1456+
if byteCount+itemBytes > baggageMaxBytes {
1457+
log.Warn("baggage byte limit exceeded (%d), dropping remaining items", baggageMaxBytes)
14531458
break
14541459
}
14551460
k, v, ok := strings.Cut(kv, "=")

0 commit comments

Comments
 (0)