Skip to content

Commit 06bac77

Browse files
dougqhclaude
andcommitted
Say a slot bit is only a may-be-present signal
A span can still hold two tags that share a slot, so slotOf's presence bit is exact only when it is clear. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent b78f5bb commit 06bac77

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎internal-api/src/main/java/datadog/trace/api/KnownTagCodec.java‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ public static boolean isIntercepted(long tagId) {
7373

7474
/**
7575
* The tag's slot, or {@link #NO_SLOT}. The generator colors tags that appear together on a span
76-
* type with distinct slots, so a span's slotted tags never collide: {@code 1L << slotOf(id)} is
77-
* an exact presence bit for them. Every tag without a slot shares bit 63, which no real slot
78-
* uses.
76+
* type with distinct slots, so when instrumentation follows its span type, {@code 1L <<
77+
* slotOf(id)} gives each of a span's tags its own presence bit. A span can still hold two tags
78+
* that share a slot, so a clear bit means the tag is absent, but a set bit only means it may be
79+
* present. Every tag without a slot shares bit 63, which no real slot uses.
7980
*/
8081
public static int slotOf(long tagId) {
8182
return (int) (tagId >>> SLOT_SHIFT) & 0xFFFF;

0 commit comments

Comments
 (0)