Skip to content

Commit 5259f76

Browse files
committed
Move browser-build identity from ddtags to snapshot payload
Move applicationId and version off ddtags onto a structured field at debugger.snapshot.build so the web UI reads browser-build identity from an unambiguous payload path instead of tags that can collide with downstream enrichment. Drop the top-level application_id field and the application_id/version ddtag entries that are now redundant.
1 parent d9173e0 commit 5259f76

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

packages/debugger/src/domain/api.spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,9 @@ describe('api', () => {
321321
expect(snapshot.duration).toBeGreaterThanOrEqual(10000000) // Should be in nanoseconds (>= 10ms)
322322
})
323323

324-
it('should include applicationId in snapshot payload and tags', () => {
324+
it('should include build identity inside the snapshot payload', () => {
325325
initDebuggerTransport(
326-
{ service: 'test-service', env: 'test-env', applicationId: 'app-123' } as any,
326+
{ service: 'test-service', env: 'test-env', applicationId: 'app-123', version: '1.2.3' } as any,
327327
{ add: mockBatchAdd } as any
328328
)
329329

@@ -345,8 +345,10 @@ describe('api', () => {
345345
onReturn(probes, null, {}, {}, {})
346346

347347
const payload = mockBatchAdd.calls.mostRecent().args[0]
348-
expect(payload.application_id).toBe('app-123')
349-
expect(payload.ddtags).toContain('application_id:app-123')
348+
expect(payload.debugger.snapshot.build).toEqual({
349+
applicationId: 'app-123',
350+
version: '1.2.3',
351+
})
350352
})
351353

352354
it('should omit trace correlation when no active span context is available', () => {

packages/debugger/src/domain/api.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ function sendDebuggerSnapshot(probe: InitializedProbe, result: ActiveEntry): voi
276276
return: result.return,
277277
}
278278
: undefined,
279+
build: {
280+
applicationId: debuggerConfig.applicationId,
281+
version: debuggerConfig.version,
282+
},
279283
}
280284

281285
const debuggerApi = globalObj.DD_DEBUGGER!
@@ -296,17 +300,14 @@ function sendDebuggerSnapshot(probe: InitializedProbe, result: ActiveEntry): voi
296300
buildTag('sdk_version', debuggerApi.version),
297301
buildTag('env', debuggerConfig.env),
298302
buildTag('service', debuggerConfig.service),
299-
buildTag('version', debuggerConfig.version),
300303
buildTag('debugger_version', debuggerApi.version),
301304
buildTag('host_name', hostname),
302-
buildTag('application_id', debuggerConfig.applicationId),
303305
]
304306

305307
const payload: Context = {
306308
message: result.message || '',
307309
hostname,
308310
service: debuggerConfig.service,
309-
application_id: debuggerConfig.applicationId,
310311
ddtags: ddtags.join(','),
311312
logger,
312313
...(dd ? { dd } : {}),

0 commit comments

Comments
 (0)