@@ -15,14 +15,14 @@ import {
15
15
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE ,
16
16
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ,
17
17
getStatusMessage ,
18
+ spanTimeInputToSeconds ,
18
19
} from '@sentry/core' ;
19
20
import type { SpanJSON , SpanOrigin , TraceContext , TransactionEvent , TransactionSource } from '@sentry/types' ;
20
21
import { dropUndefinedKeys , logger } from '@sentry/utils' ;
21
22
import { SENTRY_TRACE_STATE_PARENT_SPAN_ID } from './constants' ;
22
23
23
24
import { DEBUG_BUILD } from './debug-build' ;
24
25
import { SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE } from './semanticAttributes' ;
25
- import { convertOtelTimeToSeconds } from './utils/convertOtelTimeToSeconds' ;
26
26
import { getRequestSpanData } from './utils/getRequestSpanData' ;
27
27
import type { SpanNode } from './utils/groupSpansWithParents' ;
28
28
import { getLocalParentId } from './utils/groupSpansWithParents' ;
@@ -176,7 +176,7 @@ function getCompletedRootNodes(nodes: SpanNode[]): SpanNodeCompleted[] {
176
176
177
177
function shouldCleanupSpan ( span : ReadableSpan , maxStartTimeOffsetSeconds : number ) : boolean {
178
178
const cutoff = Date . now ( ) / 1000 - maxStartTimeOffsetSeconds ;
179
- return convertOtelTimeToSeconds ( span . startTime ) < cutoff ;
179
+ return spanTimeInputToSeconds ( span . startTime ) < cutoff ;
180
180
}
181
181
182
182
function parseSpan ( span : ReadableSpan ) : { op ?: string ; origin ?: SpanOrigin ; source ?: TransactionSource } {
@@ -236,8 +236,8 @@ function createTransactionForOtelSpan(span: ReadableSpan): TransactionEvent {
236
236
} ,
237
237
} ,
238
238
spans : [ ] ,
239
- start_timestamp : convertOtelTimeToSeconds ( span . startTime ) ,
240
- timestamp : convertOtelTimeToSeconds ( span . endTime ) ,
239
+ start_timestamp : spanTimeInputToSeconds ( span . startTime ) ,
240
+ timestamp : spanTimeInputToSeconds ( span . endTime ) ,
241
241
transaction : description ,
242
242
type : 'transaction' ,
243
243
sdkProcessingMetadata : {
@@ -294,9 +294,9 @@ function createAndFinishSpanForOtelSpan(node: SpanNode, spans: SpanJSON[], remai
294
294
data : allData ,
295
295
description,
296
296
parent_span_id : parentSpanId ,
297
- start_timestamp : convertOtelTimeToSeconds ( startTime ) ,
297
+ start_timestamp : spanTimeInputToSeconds ( startTime ) ,
298
298
// This is [0,0] by default in OTEL, in which case we want to interpret this as no end time
299
- timestamp : convertOtelTimeToSeconds ( endTime ) || undefined ,
299
+ timestamp : spanTimeInputToSeconds ( endTime ) || undefined ,
300
300
status : getStatusMessage ( status ) , // As per protocol, span status is allowed to be undefined
301
301
op,
302
302
origin,
0 commit comments