@@ -15,14 +15,14 @@ import {
1515 SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE ,
1616 SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ,
1717 getStatusMessage ,
18+ spanTimeInputToSeconds ,
1819} from '@sentry/core' ;
1920import type { SpanJSON , SpanOrigin , TraceContext , TransactionEvent , TransactionSource } from '@sentry/types' ;
2021import { dropUndefinedKeys , logger } from '@sentry/utils' ;
2122import { SENTRY_TRACE_STATE_PARENT_SPAN_ID } from './constants' ;
2223
2324import { DEBUG_BUILD } from './debug-build' ;
2425import { SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE } from './semanticAttributes' ;
25- import { convertOtelTimeToSeconds } from './utils/convertOtelTimeToSeconds' ;
2626import { getRequestSpanData } from './utils/getRequestSpanData' ;
2727import type { SpanNode } from './utils/groupSpansWithParents' ;
2828import { getLocalParentId } from './utils/groupSpansWithParents' ;
@@ -176,7 +176,7 @@ function getCompletedRootNodes(nodes: SpanNode[]): SpanNodeCompleted[] {
176176
177177function shouldCleanupSpan ( span : ReadableSpan , maxStartTimeOffsetSeconds : number ) : boolean {
178178 const cutoff = Date . now ( ) / 1000 - maxStartTimeOffsetSeconds ;
179- return convertOtelTimeToSeconds ( span . startTime ) < cutoff ;
179+ return spanTimeInputToSeconds ( span . startTime ) < cutoff ;
180180}
181181
182182function parseSpan ( span : ReadableSpan ) : { op ?: string ; origin ?: SpanOrigin ; source ?: TransactionSource } {
@@ -236,8 +236,8 @@ function createTransactionForOtelSpan(span: ReadableSpan): TransactionEvent {
236236 } ,
237237 } ,
238238 spans : [ ] ,
239- start_timestamp : convertOtelTimeToSeconds ( span . startTime ) ,
240- timestamp : convertOtelTimeToSeconds ( span . endTime ) ,
239+ start_timestamp : spanTimeInputToSeconds ( span . startTime ) ,
240+ timestamp : spanTimeInputToSeconds ( span . endTime ) ,
241241 transaction : description ,
242242 type : 'transaction' ,
243243 sdkProcessingMetadata : {
@@ -294,9 +294,9 @@ function createAndFinishSpanForOtelSpan(node: SpanNode, spans: SpanJSON[], remai
294294 data : allData ,
295295 description,
296296 parent_span_id : parentSpanId ,
297- start_timestamp : convertOtelTimeToSeconds ( startTime ) ,
297+ start_timestamp : spanTimeInputToSeconds ( startTime ) ,
298298 // 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 ,
300300 status : getStatusMessage ( status ) , // As per protocol, span status is allowed to be undefined
301301 op,
302302 origin,
0 commit comments