Skip to content

Commit 6a83a99

Browse files
dougqhclaude
andcommitted
Drop unused source field; give git.* trace slots
`source` (core|inst) only ever served the trace-level proxy, which the explicit `trace_level` section superseded — nothing in the generator reads it now, so remove it from the YAML + the model. Also bump `_dd.git.commit.sha`/`_dd.git.repository_url` optional -> recommended so they get trace slots. Regenerated KnownTags (output unchanged except the two git slots); KnownTagsTest passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 3154732 commit 6a83a99

5 files changed

Lines changed: 36 additions & 41 deletions

File tree

buildSrc/src/main/kotlin/datadog/gradle/plugin/tags/GenerateKnownTagsTask.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,13 @@ abstract class GenerateKnownTagsTask @Inject constructor(objects: ObjectFactory)
6969
a.appendLine(
7070
"# Tag id assignment. slotCount=${reg.slotCount} stored=${reg.stored.size} virtual=${reg.virtuals.size}")
7171
a.appendLine()
72-
a.appendLine("# STORED serial slot int src id required name")
72+
a.appendLine("# STORED serial slot int id required name")
7373
for (t in reg.stored) {
7474
a.appendLine(
75-
" %6d %4s %s %-4s %-18s %-12s %s".format(
75+
" %6d %4s %s %-18s %-12s %s".format(
7676
t.serial,
7777
if (t.slotted) t.slot.toString() else "-",
7878
if (t.intercepted) "I" else "-",
79-
t.source ?: "inst",
8079
"0x%016X".format(t.id),
8180
t.required,
8281
t.name))

buildSrc/src/main/kotlin/datadog/gradle/plugin/tags/TagConventions.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ private constructor(
1616
val name: String,
1717
val type: String,
1818
val required: String,
19-
val source: String?,
2019
)
2120

2221
data class SpanType(
@@ -145,7 +144,6 @@ private constructor(
145144
name = m["tag"].toString(),
146145
type = (m["type"] as? String) ?: "string",
147146
required = (m["required"] as? String) ?: "optional",
148-
source = m["source"] as? String,
149147
)
150148
} ?: emptyList()
151149
}

buildSrc/src/main/kotlin/datadog/gradle/plugin/tags/TagRegistry.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ private constructor(
2121
val name: String,
2222
val type: String,
2323
val required: String,
24-
val source: String?,
2524
val serial: Int,
2625
val intercepted: Boolean,
2726
val slot: Int,
@@ -116,7 +115,7 @@ private constructor(
116115
val serial = FIRST_STORED_SERIAL + i
117116
val intercepted = t.name in overlay.intercepted
118117
val slot = color[t.name] ?: NO_SLOT
119-
StoredTag(t.name, t.type, t.required, t.source, serial, intercepted, slot,
118+
StoredTag(t.name, t.type, t.required, serial, intercepted, slot,
120119
traceLevel = t.name in traceNames, id = encode(serial, intercepted, slot))
121120
}
122121

internal-api/src/main/java/datadog/trace/api/KnownTags.java

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,12 @@ public final class KnownTags {
5757
// tagId(serial=260, intercepted=false, slot=4) <recommended, trace-level> "_dd.dsm.enabled"
5858
public static final long DD_DSM_ENABLED = 0x0104000400000000L;
5959
static final int DD_GIT_COMMIT_SHA_SERIAL = 261;
60-
// tagId(serial=261, intercepted=false, slot=NO_SLOT) <optional, trace-level>
61-
// "_dd.git.commit.sha"
62-
public static final long DD_GIT_COMMIT_SHA = 0x0105FFFF00000000L;
60+
// tagId(serial=261, intercepted=false, slot=5) <recommended, trace-level> "_dd.git.commit.sha"
61+
public static final long DD_GIT_COMMIT_SHA = 0x0105000500000000L;
6362
static final int DD_GIT_REPOSITORY_URL_SERIAL = 262;
64-
// tagId(serial=262, intercepted=false, slot=NO_SLOT) <optional, trace-level>
63+
// tagId(serial=262, intercepted=false, slot=6) <recommended, trace-level>
6564
// "_dd.git.repository_url"
66-
public static final long DD_GIT_REPOSITORY_URL = 0x0106FFFF00000000L;
65+
public static final long DD_GIT_REPOSITORY_URL = 0x0106000600000000L;
6766
static final int DD_INTEGRATION_SERIAL = 263;
6867
// tagId(serial=263, intercepted=false, slot=0) <recommended> "_dd.integration"
6968
public static final long DD_INTEGRATION = 0x0107000000000000L;
@@ -77,15 +76,15 @@ public final class KnownTags {
7776
// tagId(serial=266, intercepted=false, slot=8) <recommended> "_dd.peer.service.source"
7877
public static final long DD_PEER_SERVICE_SOURCE = 0x010A000800000000L;
7978
static final int DD_PROFILING_ENABLED_SERIAL = 267;
80-
// tagId(serial=267, intercepted=false, slot=5) <recommended, trace-level>
79+
// tagId(serial=267, intercepted=false, slot=7) <recommended, trace-level>
8180
// "_dd.profiling.enabled"
82-
public static final long DD_PROFILING_ENABLED = 0x010B000500000000L;
81+
public static final long DD_PROFILING_ENABLED = 0x010B000700000000L;
8382
static final int DD_SVC_SRC_SERIAL = 268;
8483
// tagId(serial=268, intercepted=false, slot=NO_SLOT) <optional> "_dd.svc_src"
8584
public static final long DD_SVC_SRC = 0x010CFFFF00000000L;
8685
static final int DD_TRACER_HOST_SERIAL = 269;
87-
// tagId(serial=269, intercepted=false, slot=6) <recommended, trace-level> "_dd.tracer_host"
88-
public static final long DD_TRACER_HOST = 0x010D000600000000L;
86+
// tagId(serial=269, intercepted=false, slot=8) <recommended, trace-level> "_dd.tracer_host"
87+
public static final long DD_TRACER_HOST = 0x010D000800000000L;
8988
static final int COMPONENT_SERIAL = 270;
9089
// tagId(serial=270, intercepted=false, slot=2) <required> "component"
9190
public static final long COMPONENT = 0x010E000200000000L;
@@ -108,8 +107,8 @@ public final class KnownTags {
108107
// tagId(serial=276, intercepted=false, slot=15) <recommended> "db.user"
109108
public static final long DB_USER = 0x0114000F00000000L;
110109
static final int ENV_SERIAL = 277;
111-
// tagId(serial=277, intercepted=false, slot=7) <recommended, trace-level> "env"
112-
public static final long ENV = 0x0115000700000000L;
110+
// tagId(serial=277, intercepted=false, slot=9) <recommended, trace-level> "env"
111+
public static final long ENV = 0x0115000900000000L;
113112
static final int ERROR_MESSAGE_SERIAL = 278;
114113
// tagId(serial=278, intercepted=false, slot=3) <recommended> "error.message"
115114
public static final long ERROR_MESSAGE = 0x0116000300000000L;
@@ -144,8 +143,8 @@ public final class KnownTags {
144143
// tagId(serial=288, intercepted=false, slot=14) <recommended> "http.useragent"
145144
public static final long HTTP_USERAGENT = 0x0120000E00000000L;
146145
static final int LANGUAGE_SERIAL = 289;
147-
// tagId(serial=289, intercepted=false, slot=8) <required, trace-level> "language"
148-
public static final long LANGUAGE = 0x0121000800000000L;
146+
// tagId(serial=289, intercepted=false, slot=10) <required, trace-level> "language"
147+
public static final long LANGUAGE = 0x0121000A00000000L;
149148
static final int NETWORK_PROTOCOL_VERSION_SERIAL = 290;
150149
// tagId(serial=290, intercepted=false, slot=12) <recommended> "network.protocol.version"
151150
public static final long NETWORK_PROTOCOL_VERSION = 0x0122000C00000000L;
@@ -165,8 +164,8 @@ public final class KnownTags {
165164
// tagId(serial=295, intercepted=true, slot=14) <recommended> "peer.service"
166165
public static final long PEER_SERVICE = 0x8127000E00000000L;
167166
static final int RUNTIME_ID_SERIAL = 296;
168-
// tagId(serial=296, intercepted=false, slot=9) <required, trace-level> "runtime-id"
169-
public static final long RUNTIME_ID = 0x0128000900000000L;
167+
// tagId(serial=296, intercepted=false, slot=11) <required, trace-level> "runtime-id"
168+
public static final long RUNTIME_ID = 0x0128000B00000000L;
170169
static final int SERVLET_CONTEXT_SERIAL = 297;
171170
// tagId(serial=297, intercepted=true, slot=NO_SLOT) <optional> "servlet.context"
172171
public static final long SERVLET_CONTEXT = 0x8129FFFF00000000L;
@@ -177,8 +176,8 @@ public final class KnownTags {
177176
// tagId(serial=299, intercepted=true, slot=6) <required> "span.kind"
178177
public static final long SPAN_KIND = 0x812B000600000000L;
179178
static final int VERSION_SERIAL = 300;
180-
// tagId(serial=300, intercepted=false, slot=10) <recommended, trace-level> "version"
181-
public static final long VERSION = 0x012C000A00000000L;
179+
// tagId(serial=300, intercepted=false, slot=12) <recommended, trace-level> "version"
180+
public static final long VERSION = 0x012C000C00000000L;
182181
static final int VIEW_NAME_SERIAL = 301;
183182
// tagId(serial=301, intercepted=false, slot=7) <recommended> "view.name"
184183
public static final long VIEW_NAME = 0x012D000700000000L;

tag-conventions.yaml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,41 @@
1717
# resolved_tags(type) = own + extends-chain (incl base) + included mixins + applied mixins (de-duped).
1818
#
1919
# tag fields (DOMAIN only): tag | type (string|int|long|boolean|double)
20-
# | required (required|conditional|recommended|optional|opt_in) | aliases | source (core|inst).
20+
# | required (required|conditional|recommended|optional|opt_in) | aliases.
2121
# Slot/bit is NOT authored here — the generator assigns it via graph coloring; colorability derives
2222
# from `required` (required/conditional/recommended packed; else bucketed). See the design doc.
2323
# ---------------------------------------------------------------------------
2424

2525
# Trace-level tier: its own TagMap on the TraceSegment. Set once per trace, not per span.
2626
trace_level:
2727
tags:
28-
- { tag: _dd.base_service, type: string, required: required, source: core }
29-
- { tag: version, type: string, required: recommended, source: core }
30-
- { tag: env, type: string, required: recommended, source: core }
31-
- { tag: language, type: string, required: required, source: core }
32-
- { tag: runtime-id, type: string, required: required, source: core }
33-
- { tag: _dd.tracer_host, type: string, required: recommended, source: core }
34-
- { tag: _dd.git.commit.sha, type: string, required: optional, source: core }
35-
- { tag: _dd.git.repository_url, type: string, required: optional, source: core }
28+
- { tag: _dd.base_service, type: string, required: required }
29+
- { tag: version, type: string, required: recommended }
30+
- { tag: env, type: string, required: recommended }
31+
- { tag: language, type: string, required: required }
32+
- { tag: runtime-id, type: string, required: required }
33+
- { tag: _dd.tracer_host, type: string, required: recommended }
34+
- { tag: _dd.git.commit.sha, type: string, required: recommended }
35+
- { tag: _dd.git.repository_url, type: string, required: recommended }
3636
# product .enabled flags — process-constant; present on the trace segment regardless of whether
3737
# the product is enabled (the flag carries the state), so always-present => recommended.
38-
- { tag: _dd.profiling.enabled, type: boolean, required: recommended, source: core }
39-
- { tag: _dd.dsm.enabled, type: boolean, required: recommended, source: core }
40-
- { tag: _dd.appsec.enabled, type: boolean, required: recommended, source: core }
41-
- { tag: _dd.djm.enabled, type: boolean, required: recommended, source: core }
42-
- { tag: _dd.civisibility.enabled, type: boolean, required: recommended, source: core }
38+
- { tag: _dd.profiling.enabled, type: boolean, required: recommended }
39+
- { tag: _dd.dsm.enabled, type: boolean, required: recommended }
40+
- { tag: _dd.appsec.enabled, type: boolean, required: recommended }
41+
- { tag: _dd.djm.enabled, type: boolean, required: recommended }
42+
- { tag: _dd.civisibility.enabled, type: boolean, required: recommended }
4343

4444
span_types:
4545
# root: per-span tags every span has (incl. the per-span core tags parent_id / integration / svc_src
4646
# — core-set but per-span, so NOT trace-level).
4747
base:
4848
abstract: true
4949
tags:
50-
- { tag: _dd.parent_id, type: string, required: required, source: core }
50+
- { tag: _dd.parent_id, type: string, required: required }
5151
- { tag: component, type: string, required: required }
5252
- { tag: span.kind, type: string, required: required }
53-
- { tag: _dd.integration, type: string, required: recommended, source: core }
54-
- { tag: _dd.svc_src, type: string, required: optional, source: core }
53+
- { tag: _dd.integration, type: string, required: recommended }
54+
- { tag: _dd.svc_src, type: string, required: optional }
5555
- { tag: error.type, type: string, required: recommended }
5656
- { tag: error.message, type: string, required: recommended }
5757
- { tag: error.stack, type: string, required: recommended }

0 commit comments

Comments
 (0)