File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -149,15 +149,19 @@ export const generateTracePartialId = () => {
149
149
export const generateW3CHeader = ( networkStartTime : number ) => {
150
150
const { hexStringPartialId, numberPartilId } = generateTracePartialId ( ) ;
151
151
152
+ const TRACESTATE = '4942472d' ;
153
+ const VERSION = '00' ;
154
+ const TRACE_FLAG = '01' ;
155
+
152
156
const timestampInSeconds = Math . floor ( networkStartTime . valueOf ( ) / 1000 ) ;
153
157
const hexaDigitsTimestamp = timestampInSeconds . toString ( 16 ) . toLowerCase ( ) ;
154
158
const traceId = `${ hexaDigitsTimestamp } ${ hexStringPartialId } ${ hexaDigitsTimestamp } ${ hexStringPartialId } ` ;
155
- const parentId = `4942472d ${ hexStringPartialId } ` ;
159
+ const parentId = `${ TRACESTATE } ${ hexStringPartialId } ` ;
156
160
157
161
return {
158
162
timestampInSeconds,
159
163
partialId : numberPartilId ,
160
- w3cHeader : `00 -${ traceId } -${ parentId } -01 ` ,
164
+ w3cHeader : `${ VERSION } -${ traceId } -${ parentId } -${ TRACE_FLAG } ` ,
161
165
} ;
162
166
} ;
163
167
You can’t perform that action at this time.
0 commit comments