File tree Expand file tree Collapse file tree 6 files changed +14
-9
lines changed
integration-tests/profiler Expand file tree Collapse file tree 6 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -389,8 +389,8 @@ describe('profiler', () => {
389
389
for ( const label of sample . label ) {
390
390
switch ( label . key ) {
391
391
case tsKey : ts = label . num ; break
392
- case spanKey : spanId = label . str ; break
393
- case rootSpanKey : rootSpanId = label . str ; break
392
+ case spanKey : spanId = label . num ; break
393
+ case rootSpanKey : rootSpanId = label . num ; break
394
394
case endpointKey : endpoint = label . str ; break
395
395
case threadNameKey : threadName = label . str ; break
396
396
case threadIdKey : threadId = label . str ; break
Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ class DatadogSpanContext {
59
59
return this . _spanId . toString ( 10 )
60
60
}
61
61
62
+ toBigIntSpanId ( ) {
63
+ return this . _spanId . toBigInt ( )
64
+ }
65
+
62
66
toTraceparent ( ) {
63
67
const flags = this . _sampling . priority >= AUTO_KEEP ? '01' : '00'
64
68
const traceId = this . toTraceId ( true )
Original file line number Diff line number Diff line change @@ -52,8 +52,8 @@ class EventPlugin extends TracingPlugin {
52
52
}
53
53
54
54
const context = ( ctx . currentStore ?. span || this . activeSpan ) ?. context ( )
55
- event . _ddSpanId = context ?. toSpanId ( )
56
- event . _ddRootSpanId = context ?. _trace . started [ 0 ] ?. context ( ) . toSpanId ( ) || event . _ddSpanId
55
+ event . _ddSpanId = context ?. toBigIntSpanId ( )
56
+ event . _ddRootSpanId = context ?. _trace . started [ 0 ] ?. context ( ) . toBigIntSpanId ( ) || event . _ddSpanId
57
57
58
58
this . #eventHandler( this . extendEvent ( event , ctx ) )
59
59
}
Original file line number Diff line number Diff line change @@ -273,10 +273,11 @@ class EventSerializer {
273
273
new Label ( { key : this . timestampLabelKey , num : dateOffset + BigInt ( Math . round ( endTime * MS_TO_NS ) ) } )
274
274
]
275
275
if ( _ddSpanId ) {
276
- label . push ( labelFromStr ( this . stringTable , this . spanIdKey , _ddSpanId ) )
276
+ label . push (
277
+ new Label ( { key : this . spanIdKey , num : _ddSpanId } ) )
277
278
}
278
279
if ( _ddRootSpanId ) {
279
- label . push ( labelFromStr ( this . stringTable , this . rootSpanIdKey , _ddRootSpanId ) )
280
+ label . push ( new Label ( { key : this . rootSpanIdKey , num : _ddRootSpanId } ) )
280
281
}
281
282
282
283
const sampleInput = {
Original file line number Diff line number Diff line change @@ -215,10 +215,10 @@ class NativeWallProfiler {
215
215
216
216
_updateContext ( context ) {
217
217
if ( context . spanId !== null && typeof context . spanId === 'object' ) {
218
- context . spanId = context . spanId . toString ( 10 )
218
+ context . spanId = context . spanId . toBigInt ( )
219
219
}
220
220
if ( context . rootSpanId !== null && typeof context . rootSpanId === 'object' ) {
221
- context . rootSpanId = context . rootSpanId . toString ( 10 )
221
+ context . rootSpanId = context . rootSpanId . toBigInt ( )
222
222
}
223
223
if ( context . webTags !== undefined && context . endpoint === undefined ) {
224
224
// endpoint may not be determined yet, but keep it as fallback
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ describe('profilers/events', () => {
17
17
// Set up a mock span to simulate tracing context
18
18
const span = {
19
19
context : ( ) => ( {
20
- toSpanId : ( ) => '1234' ,
20
+ toBigIntSpanId : ( ) => 1234n ,
21
21
_trace : {
22
22
started : [ span ]
23
23
}
You can’t perform that action at this time.
0 commit comments