MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getSpanOptions

Function getSpanOptions

packages/opentelemetry/src/trace.ts:196–213  ·  view source on GitHub ↗
(options: OpenTelemetrySpanContext)

Source from the content-addressed store, hash-verified

194}
195
196function getSpanOptions(options: OpenTelemetrySpanContext): SpanOptions {
197 const { startTime, attributes, kind, op, links } = options;
198
199 // OTEL expects timestamps in ms, not seconds
200 const fixedStartTime = typeof startTime === 'number' ? ensureTimestampInMilliseconds(startTime) : startTime;
201
202 return {
203 attributes: op
204 ? {
205 [SEMANTIC_ATTRIBUTE_SENTRY_OP]: op,
206 ...attributes,
207 }
208 : attributes,
209 kind,
210 links,
211 startTime: fixedStartTime,
212 };
213}
214
215function ensureTimestampInMilliseconds(timestamp: number): number {
216 const isMs = timestamp < 9999999999;

Callers 2

_startSpanFunction · 0.85
startInactiveSpanFunction · 0.85

Calls 1

Tested by

no test coverage detected