Skip to content

Name KnownTags ids after their tags and fail on constant clashes (tag registry rollout) - #13061

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 8 commits into
masterfrom
dougqh/known-tags-full-suffix
Nov 6, 2026
Merged

gh-worker-dd-mergequeue-cf854d[bot] merged 8 commits into
masterfrom
dougqh/known-tags-full-suffix

Conversation

@dougqh

@dougqh dougqh commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Does This Do

Changes how the KnownTags generator names constants: an id is named after its tag with no suffix, and the other constants always carry their full suffix. A naming clash now fails generation with instructions instead of getting a silent _2 (APMLP-2123).

  • Ids are bare. An id is what instrumentation sets, so span.setTag(DB_POOL_NAME, …) reads like the string-keyed call it replaces. The per-direction aliases are bare too (Outbound.SERVER_ADDRESS).

  • Other constants keep the full suffix, even when the name already ends with it:

    tag id (long) name (String)
    http.method HTTP_METHOD HTTP_METHOD_NAME
    db.pool.name DB_POOL_NAME DB_POOL_NAME_NAME
    messaging.kafka.cluster.id MESSAGING_KAFKA_CLUSTER_ID MESSAGING_KAFKA_CLUSTER_ID_NAME

    _SERIAL_NUM and _OTEL_NAME work the same way.

  • A clash fails generation and says how to fix it. It used to get a silent _2, which depended on registration order. A clash is two names that sanitize alike, or a tag x.name (id X_NAME) next to a tag x (name X_NAME). The error names both tags and the overlay entry that resolves it:

    Tags 'aws.service' and 'aws_service' both generate the constant AWS_SERVICE_NAME.
    Give one of them its own constant base in tag-conventions-java.yaml, for example:
      java_names:
        aws_service: <UPPER_CASE_BASE>
    
  • java_names in tag-conventions-java.yaml. It maps a Datadog tag name, or an OpenTelemetry name for the per-direction aliases, to its own constant base.

    • The registry has exactly one clash: aws.service and aws_service.
    • aws_service gets TOP_LEVEL_AWS_SERVICE, the name InstrumentationTags already uses.

Motivation

The old naming had three problems:

  • Collapsing. Dropping a doubled suffix let two tags map to one constant (db.operation.name's name and db.operation's name), and the reader can't tell an id from a name.
  • Order-dependent names. A clash got a silent _2.
  • Instability. Registering a tag later could silently change what an existing constant means.

Bare ids keep the call sites readable as instrumentation moves onto ids (APMLP-1570). Settling the names before that spreads keeps the renames cheap.

Additional Notes

  • Renames. Every id constant loses its _ID suffix: 330 ids plus 34 per-direction aliases. On master, 554 references in 44 files are updated, mostly in core, internal-api and the decorators.
    • Most master ids keep their names: what was collapsed before (RUNTIME_ID) is now the bare form.
    • The string names that change are the doubled ones (DB_POOL_NAME → DB_POOL_NAME_NAME) and aws_service's.
  • A missed reference fails to compile. An old X_ID no longer exists. A bare X that used to be a name is now a long, so it can't be passed silently where a String is expected.
  • Static-import ambiguity. A file that static-imports both Tags.X (string) and KnownTags.X (id) won't compile ("reference is ambiguous"), so one has to be qualified. TagStoreTest was the only such file; it now names the string Tags.HTTP_ROUTE. The generator plugin test's fixture registered foo and foo.name, exactly that clash, so its second tag is now foo.bar.
  • Generated values are unchanged. Only names change.
  • Testing:
    • tag-registry generator tests: 99 pass, including a clash that preserves the previous output.
    • internal-api: all 5,705 tests pass.
    • agent-bootstrap: 693 pass.
    • dd-trace-core: tag tests pass (284), and its main and test sources compile.
    • otel-shim and axway compile.
    • A repo-wide scan finds no unresolved KnownTags reference.

🤖 Generated with Claude Code

@dougqh dougqh added comp: core Tracer core tag: no release notes Changes to exclude from release notes type: refactoring tag: ai generated Largely based on code generated by an AI or LLM labels Oct 26, 2026
@datadog-prod-us1-3

datadog-prod-us1-3 Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

🎯 Code Coverage (details)
• Patch Coverage: 89.06%
• Overall Coverage: 59.98% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e93737a | Docs | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.04 s 14.01 s [-0.5%; +0.8%] (no difference)
startup:insecure-bank:tracing:Agent 12.85 s 12.98 s [-1.5%; -0.4%] (maybe better)
startup:petclinic:appsec:Agent 17.72 s 17.63 s [-0.2%; +1.2%] (no difference)
startup:petclinic:iast:Agent 17.61 s 17.75 s [-1.7%; +0.2%] (no difference)
startup:petclinic:profiling:Agent 17.56 s 17.25 s [+0.7%; +2.9%] (maybe worse)
startup:petclinic:sca:Agent 17.86 s 17.18 s [-0.5%; +8.4%] (no difference)
startup:petclinic:tracing:Agent 16.77 s 16.84 s [-1.4%; +0.6%] (no difference)

Commit: e93737ab · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

@dougqh
dougqh marked this pull request as ready for review November 3, 2026 21:40
@dougqh
dougqh requested review from a team as code owners November 3, 2026 21:40
@dougqh
dougqh requested review from AlexeyKuznetsov-DD and mcculls and removed request for a team November 3, 2026 21:40
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T21:44:17.433942Z fc3c6a5 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dougqh dougqh changed the title Never collapse the suffix of a generated KnownTags constant Never collapse the suffix of a generated KnownTags constant (tag registry rollout) Nov 3, 2026
@dougqh
dougqh force-pushed the dougqh/known-tags-full-suffix branch from fc3c6a5 to 66be8a1 Compare November 3, 2026 21:45

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: FAIL

Validation of tag naming/constant clashes in KnownTagsEmitter occurs only after TagRegistryGenerator has already deleted the previous output, meaning a failed regeneration permanently destroys the last valid KnownTags.java. The fix is to compute and fully validate the generated source (including collision checks) before clearing the destination directory.

Open Bits AI session

🤖 Bits Code Review · Commit fc3c6a5

@AlexeyKuznetsov-DD AlexeyKuznetsov-DD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left a suggestion about suffixes, to avoid potential ugly _NAME_NAME or _ID_ID, since name and id is very common in naming.

@mcculls mcculls left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bruce's suggestion of using DB_POOL_NAME for the tag-id, and DB_POOL_NAME_TAG or similar for the tag-name also makes sense.

@dougqh

dougqh commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Bruce's suggestion of using DB_POOL_NAME for the tag-id, and DB_POOL_NAME_TAG or similar for the tag-name also makes sense.

@mcculls Yes, I think that's my preference, too. I'm just waiting a bit to see what others think.

@dougqh
dougqh requested review from a team as code owners November 5, 2026 20:29
dougqh and others added 3 commits November 5, 2026 15:38
JAVA_CONSTANT_BASE had landed between them and parse, taking both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The clash check runs while emitting KnownTags, which happened after the
output directory was cleared, so a clash lost the last valid output.
Render all outputs before touching the directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An id is what instrumentation sets, so it takes the tag's bare name:
span.setTag(DB_POOL_NAME, ...) reads like the name it replaces. The
string name keeps its full suffix (DB_POOL_NAME_NAME), as do the
serial and OpenTelemetry-name constants, and the per-direction aliases
are bare too (Outbound.SERVER_ADDRESS). The clash check now also covers
a tag x.name (id X_NAME) against a tag x (name X_NAME).

Every KnownTags.*_ID reference is renamed to match. TagStoreTest, which
static-imported Tags.HTTP_ROUTE alongside the id, names the string as
Tags.HTTP_ROUTE.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@datadog-prod-us1-3 datadog-prod-us1-3 Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bits Code Review: FAIL

Bare ID naming makes the existing foo/foo.name plugin fixture collide at FOO_NAME, breaking generation-dependent tests. A remaining _ID reflection filter also silently excludes most tags from bucket-hash checks.

Open Bits AI session

🤖 Bits Code Review · Commit d983320

Tags foo and foo.name both claim FOO_NAME now that ids are bare (foo's
name, foo.name's id), so the fixture's second tag is foo.bar. Also
TagStoreTest's import order under Spotless 8.11.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dougqh
dougqh force-pushed the dougqh/known-tags-full-suffix branch from d983320 to 7e702ac Compare November 5, 2026 20:44
dougqh added a commit that referenced this pull request Nov 5, 2026
#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh added a commit that referenced this pull request Nov 5, 2026
#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh added a commit that referenced this pull request Nov 5, 2026
#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh added a commit that referenced this pull request Nov 5, 2026
#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
knownTagIds() picked long fields ending in _ID, so once ids went bare it
selected only the 16 tags whose names end in id and the bucket-hash and
slot checks quietly shrank. It now takes every static long, and a new
test asserts there is one per serial.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dougqh

dougqh commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351

gh-worker-devflow-routing-ef8351 Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

View all feedbacks in Devflow UI.

2026-11-06 16:13:14 UTC ℹ️ Start processing command /merge


2026-11-06 16:13:18 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in master is approximately 1h (p90).


2026-11-06 17:24:44 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 7fe3d4d into master Nov 6, 2026
683 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the dougqh/known-tags-full-suffix branch November 6, 2026 17:24
@github-actions github-actions Bot added this to the 1.69.0 milestone Nov 6, 2026
dougqh added a commit that referenced this pull request Nov 6, 2026
#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh added a commit that referenced this pull request Nov 6, 2026
#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh added a commit that referenced this pull request Nov 6, 2026
#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh added a commit that referenced this pull request Nov 6, 2026
#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh added a commit that referenced this pull request Nov 6, 2026
#13061 named an id after its tag with no _ID suffix. Rename only; the
ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dougqh added a commit that referenced this pull request Nov 6, 2026
#13061 named an id after its tag with no _ID suffix. Rename only; the
ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 6, 2026
…13193)

Set database client and JDBC span tags by id

DatabaseClientDecorator, which every database client's spans go
through, and the JDBC instrumentation now set their tags with KnownTags
ids instead of names. All of them were already registered; the
"_dd.dbm_trace_injected" literal becomes the same id as its constant.
JDBCDecorator's setTagIfPresent takes the id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Use the bare KnownTags id names

#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Co-authored-by: douglas.hawkins <douglas.hawkins@datadoghq.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 6, 2026
Set Kafka span tags by id

Kafka's producer, consumer and Streams spans now set their tags with
KnownTags ids instead of names, skipping the name lookup on every set.
All of them were already registered (the kafka mixin, plus
kafka.records_count and record.queue_time_ms), so this is a mechanical
swap; the core span stores and intercepts an id exactly as it did the
name it resolved to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Use the bare KnownTags id names

#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Co-authored-by: douglas.hawkins <douglas.hawkins@datadoghq.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 6, 2026
Set servlet and JSP span tags by id

The javax and jakarta servlet instrumentations and JSP set their tags
(servlet.context, servlet.path, user.principal, timeout, jsp.*) with
KnownTags ids instead of names or string literals. All were already
registered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Use the bare KnownTags id names

#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Co-authored-by: douglas.hawkins <douglas.hawkins@datadoghq.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 6, 2026
Set Spring web span tags by id

Spring Web MVC (3.1 and 6.0) and Spring WebFlux set view.name,
view.type, handler.type, request.predicate, and the WebFlux client's
cancellation event and message with KnownTags ids instead of string
literals. All were already registered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Use the bare KnownTags id names

#13061 now names an id after its tag with no _ID suffix. Rename only;
the ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Co-authored-by: douglas.hawkins <douglas.hawkins@datadoghq.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 17, 2026
)

Have the span own its tag stores directly

DDSpanContext holds its IdStore (also its tag lock) and its HashStore
instead of one TagMap, and routes each write to the store that holds the
tag: a name is resolved once and routed, and a write by id goes straight
to the id store. The custom store is borrowed read-only from the
read-through parent until the span's first custom write.

The eager post-processors already read and write the span through
TagStore. The lazy post-processors and the serializer still take a
TagMap: the span builds a view over its stores once, at serialization,
and caches it (about 32 B per span until they move to TagStore).

TagMap.Internals, the core's trusted side door, is gone: the stores are
the direct path. The constructors drop the unused tagsSize parameter.

Allocation, 7-span web-request trace: +104 B (+1.3%), from the new
DDSpanContext fields (8 B per span) and the first custom store.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Use the bare KnownTags id names

#13061 named an id after its tag with no _ID suffix. Rename only; the
ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Remove the tag when a map write carries a null value

setAllTags and unsafeSetTag passed null values straight to the stores, which
take none, leaving a null-valued entry: the tag still showed in getTags() and
could break serialization. TagMap.set removed the tag on null, as setTag does;
route a null to removal again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Keep copying root-span tags locally when exporting OTLP

With builder-tag precedence, root spans read their trace-level tags through a
shared parent. The OTLP span writer emits only a span's own tags, so root-only
tags (process_id, runtime-id, language, profiling) dropped out of OTLP exports.
Turn the read-through off when OTLP export is on, decided once at startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copy root-span tags into root spans again instead of reading them through

With builder-tag precedence, root spans read their root-span tags through a
shared frozen parent. A parent is always the lowest layer, which is the same as
applying it first, but root tags used to be applied after the inbound request's
tags: a request header mapped onto a root-tag name (process_id, runtime-id,
language, ...) now overrode it. The OTLP span writer also emits only local
tags, so it lost them.

Copy root tags into root spans again, as on master. Only the merged tracer
tags, which were already applied first, stay in the read-through parent. That
also makes the OTLP-export exception unnecessary. Root spans keep about 5-7
more tags locally.

RootSpanTagsReadThroughTest becomes RootSpanTagsTest, which checks root and
child spans in both precedence modes and that root tags win over same-named
inbound tags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Merge remote-tracking branch 'origin/master' into dougqh/tagmap-split-known-custom

Store setAllTags entries with the id already looked up

setAllTags resolved each name to choose the interceptor, then stored the
tag through unsafeSetTag, which resolved it again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Drop the name-only routeSet overloads

Each hid a KnownTagCodec.keyOf call, which is how setAllTags came to look
a name up twice. Callers now resolve the id themselves, so every lookup is
visible where it happens; setMetric does it before taking the lock. The
comment introducing the route methods moves to where they start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Set the by-name map's db.pool.name by name again

A rename turned DB_POOL_NAME_NAME into the id constant, so the test's
by-name map set that tag by id, and still passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Trim the knownTags Javadoc to what the field needs; use SPAN_KIND_NAME

The Storage section repeated what customTags and tagView say, and the
rest is now the lock's scope, why it is reentrant, and who skips it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Trim the tag storage comments; post-processors don't call span setters

The knownTags Javadoc said post-processors call back into the span's
setters while the lock is held. None does: they write through the view.
If one did, a custom tag written through the view could miss the span,
so tagView now states the rule, and the rest of the comments are trimmed
or dropped where the code says it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Merge remote-tracking branch 'origin/master' into dougqh/tagmap-split-known-custom

Resolves #12998's package move (datadog.contract.Restricted) and adapts
master's #13452 and SpanKind changes to the split stores: the new
DDSpanContext constructor drops the removed tagsSize parameter, and
seedAbsentSpanKind checks and stores span.kind through knownTags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Co-authored-by: douglas.hawkins <douglas.hawkins@datadoghq.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 17, 2026
#13061 named an id after its tag with no _ID suffix. Rename only; the
ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gh-worker-dd-mergequeue-cf854d Bot pushed a commit that referenced this pull request Nov 17, 2026
…- part 8) (#13004)

Add the dense id store behind an experimental flag

DenseIdStore keeps a span's known tags in two parallel arrays, each
tag's 16-bit serial and its value, with no Entry per tag. It reads
through to the frozen parent's store like HashIdStore. A lookup scans
the serials and is skipped when the slot and level masks rule the tag
out; the full id is rebuilt from the serial (KnownTagCodec.idOf, backed
by the generated IDS_BY_SERIAL table) only where a reader asks for it.

The masks live in DenseIdStore, which needs them to index its arrays.
HashIdStore's buckets are the exact state, so it stays without them and
dense-off spans keep their current size.

IdStoreFactory picks the store once per JVM from
trace.experimental.dense.tags.enabled (off by default), so only one
IdStore subclass is loaded and calls on it stay devirtualized.

TraceShape probe, 7-span trace: 8,040 B with the flag off (unchanged),
5,504 B with it on (-30% vs master).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Read dense-stored tags with Entry's type and coercion rules

The dense reader classifies and coerces through TagValueConversions,
which had drifted from Entry while nothing used it: it typed Short and
Byte as INT, said every value is(OBJECT), and coerced an OBJECT through
Number (BigDecimal("12") read as 12) or to false ("GET"). So the dense
flag could change what a tag read returned.

TagValueConversions now encodes Entry's rules for a boxed value: only
Boolean, Integer, Long, Float and Double are typed; anything else is an
OBJECT, which is true when present and 0 as a number. Its tests check
every conversion against an Entry of the same value, and the shared
IdStore contract test checks both stores' readers against Entry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Use the bare KnownTags id names

#13061 named an id after its tag with no _ID suffix. Rename only; the
ids are the same values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Stop the dense store keeping values a write replaced or removed

DenseIdStore answered put, getAndPut and remove with one reused reader
pointed at the prior value. A caller that discarded the result, as the span's
removal paths do, left that value reachable from the store until a later write
with a prior value replaced it: a removed error.stack could stay attached to a
long-lived span.

- remove and put now return nothing, as TagMap's naming suggests; callers that
  need the prior value use getAndRemove (new) and getAndPut. The span's
  removal and put paths build no reader at all.
- getAndPut and getAndRemove return a fresh reader instead of the reused one.
  That costs one 32-byte reader when there is a prior value; TagMap, their only
  caller, turns it into an Entry anyway.

IdStoreContractTest checks, for both stores, that a removed or replaced value
is collectable once the caller drops it; it fails with a reused reader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Co-authored-by: douglas.hawkins <douglas.hawkins@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: core Tracer core tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants