@sentry/opentelemetry 7.89.0 → 7.91.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/asyncContextStrategy.js.map +1 -1
- package/cjs/constants.js.map +1 -1
- package/cjs/contextManager.js.map +1 -1
- package/cjs/custom/client.js +6 -1
- package/cjs/custom/client.js.map +1 -1
- package/cjs/custom/hub.js.map +1 -1
- package/cjs/custom/hubextensions.js.map +1 -1
- package/cjs/custom/scope.js +9 -0
- package/cjs/custom/scope.js.map +1 -1
- package/cjs/custom/transaction.js.map +1 -1
- package/cjs/debug-build.js.map +1 -1
- package/cjs/index.js.map +1 -1
- package/cjs/propagator.js.map +1 -1
- package/cjs/sampler.js.map +1 -1
- package/cjs/semanticAttributes.js.map +1 -1
- package/cjs/setupEventContextTrace.js.map +1 -1
- package/cjs/spanExporter.js +1 -1
- package/cjs/spanExporter.js.map +1 -1
- package/cjs/spanProcessor.js.map +1 -1
- package/cjs/trace.js.map +1 -1
- package/cjs/utils/addOriginToSpan.js.map +1 -1
- package/cjs/utils/captureExceptionForTimedEvent.js.map +1 -1
- package/cjs/utils/contextData.js.map +1 -1
- package/cjs/utils/convertOtelTimeToSeconds.js.map +1 -1
- package/cjs/utils/getActiveSpan.js.map +1 -1
- package/cjs/utils/getRequestSpanData.js.map +1 -1
- package/cjs/utils/getSpanKind.js.map +1 -1
- package/cjs/utils/groupSpansWithParents.js.map +1 -1
- package/cjs/utils/isSentryRequest.js.map +1 -1
- package/cjs/utils/mapStatus.js.map +1 -1
- package/cjs/utils/parseSpanDescription.js.map +1 -1
- package/cjs/utils/spanData.js.map +1 -1
- package/cjs/utils/spanTypes.js.map +1 -1
- package/esm/asyncContextStrategy.js.map +1 -1
- package/esm/constants.js.map +1 -1
- package/esm/contextManager.js.map +1 -1
- package/esm/custom/client.js +6 -1
- package/esm/custom/client.js.map +1 -1
- package/esm/custom/hub.js.map +1 -1
- package/esm/custom/hubextensions.js.map +1 -1
- package/esm/custom/scope.js +9 -0
- package/esm/custom/scope.js.map +1 -1
- package/esm/custom/transaction.js.map +1 -1
- package/esm/debug-build.js.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/propagator.js.map +1 -1
- package/esm/sampler.js.map +1 -1
- package/esm/semanticAttributes.js.map +1 -1
- package/esm/setupEventContextTrace.js.map +1 -1
- package/esm/spanExporter.js +1 -1
- package/esm/spanExporter.js.map +1 -1
- package/esm/spanProcessor.js.map +1 -1
- package/esm/trace.js.map +1 -1
- package/esm/utils/addOriginToSpan.js.map +1 -1
- package/esm/utils/captureExceptionForTimedEvent.js.map +1 -1
- package/esm/utils/contextData.js.map +1 -1
- package/esm/utils/convertOtelTimeToSeconds.js.map +1 -1
- package/esm/utils/getActiveSpan.js.map +1 -1
- package/esm/utils/getRequestSpanData.js.map +1 -1
- package/esm/utils/getSpanKind.js.map +1 -1
- package/esm/utils/groupSpansWithParents.js.map +1 -1
- package/esm/utils/isSentryRequest.js.map +1 -1
- package/esm/utils/mapStatus.js.map +1 -1
- package/esm/utils/parseSpanDescription.js.map +1 -1
- package/esm/utils/spanData.js.map +1 -1
- package/esm/utils/spanTypes.js.map +1 -1
- package/package.json +4 -4
- package/types/custom/client.d.ts.map +1 -1
- package/types/custom/scope.d.ts +3 -1
- package/types/custom/scope.d.ts.map +1 -1
- package/types/spanExporter.d.ts.map +1 -1
- package/types-ts3.8/custom/scope.d.ts +3 -1
package/esm/spanProcessor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanProcessor.js","sources":["../../src/spanProcessor.ts"],"sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport { ROOT_CONTEXT, trace } from '@opentelemetry/api';\nimport type { Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';\nimport { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { logger } from '@sentry/utils';\n\nimport { getCurrentHub } from './custom/hub';\nimport { OpenTelemetryScope } from './custom/scope';\nimport { DEBUG_BUILD } from './debug-build';\nimport { SentrySpanExporter } from './spanExporter';\nimport { maybeCaptureExceptionForTimedEvent } from './utils/captureExceptionForTimedEvent';\nimport { getHubFromContext } from './utils/contextData';\nimport { getSpanHub, setSpanFinishScope, setSpanHub, setSpanParent, setSpanScope } from './utils/spanData';\n\nfunction onSpanStart(span: Span, parentContext: Context, ScopeClass: typeof OpenTelemetryScope): void {\n // This is a reliable way to get the parent span - because this is exactly how the parent is identified in the OTEL SDK\n const parentSpan = trace.getSpan(parentContext);\n const hub = getHubFromContext(parentContext);\n\n // We need access to the parent span in order to be able to move up the span tree for breadcrumbs\n if (parentSpan) {\n setSpanParent(span, parentSpan);\n }\n\n // The root context does not have a hub stored, so we check for this specifically\n // We do this instead of just falling back to `getCurrentHub` to avoid attaching the wrong hub\n let actualHub = hub;\n if (parentContext === ROOT_CONTEXT) {\n actualHub = getCurrentHub();\n }\n\n // We need the scope at time of span creation in order to apply it to the event when the span is finished\n if (actualHub) {\n const scope = actualHub.getScope();\n setSpanScope(span, actualHub.getScope());\n setSpanHub(span, actualHub);\n\n // Use this scope for finishing the span\n const finishScope = (scope as OpenTelemetryScope).clone();\n finishScope.activeSpan = span;\n setSpanFinishScope(span, finishScope);\n }\n}\n\nfunction onSpanEnd(span: Span): void {\n // Capture exceptions as events\n const hub = getSpanHub(span) || getCurrentHub();\n span.events.forEach(event => {\n maybeCaptureExceptionForTimedEvent(hub, event, span);\n });\n}\n\n/**\n * Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via\n * the Sentry SDK.\n */\nexport class SentrySpanProcessor extends BatchSpanProcessor implements SpanProcessorInterface {\n private _scopeClass: typeof OpenTelemetryScope;\n\n public constructor(options: { scopeClass?: typeof OpenTelemetryScope } = {}) {\n super(new SentrySpanExporter());\n\n this._scopeClass = options.scopeClass || OpenTelemetryScope;\n }\n\n /**\n * @inheritDoc\n */\n public onStart(span: Span, parentContext: Context): void {\n onSpanStart(span, parentContext, this._scopeClass);\n\n DEBUG_BUILD && logger.log(`[Tracing] Starting span \"${span.name}\" (${span.spanContext().spanId})`);\n\n return super.onStart(span, parentContext);\n }\n\n /** @inheritDoc */\n public onEnd(span: Span): void {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing span \"${span.name}\" (${span.spanContext().spanId})`);\n\n if (!this._shouldSendSpanToSentry(span)) {\n // Prevent this being called to super.onEnd(), which would pass this to the span exporter\n return;\n }\n\n onSpanEnd(span);\n\n return super.onEnd(span);\n }\n\n /**\n * You can overwrite this in a sub class to implement custom behavior for dropping spans.\n * If you return `false` here, the span will not be passed to the exporter and thus not be sent.\n */\n protected _shouldSendSpanToSentry(_span: Span): boolean {\n return true;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAcA,
|
|
1
|
+
{"version":3,"file":"spanProcessor.js","sources":["../../src/spanProcessor.ts"],"sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport { ROOT_CONTEXT, trace } from '@opentelemetry/api';\nimport type { Span, SpanProcessor as SpanProcessorInterface } from '@opentelemetry/sdk-trace-base';\nimport { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';\nimport { logger } from '@sentry/utils';\n\nimport { getCurrentHub } from './custom/hub';\nimport { OpenTelemetryScope } from './custom/scope';\nimport { DEBUG_BUILD } from './debug-build';\nimport { SentrySpanExporter } from './spanExporter';\nimport { maybeCaptureExceptionForTimedEvent } from './utils/captureExceptionForTimedEvent';\nimport { getHubFromContext } from './utils/contextData';\nimport { getSpanHub, setSpanFinishScope, setSpanHub, setSpanParent, setSpanScope } from './utils/spanData';\n\nfunction onSpanStart(span: Span, parentContext: Context, ScopeClass: typeof OpenTelemetryScope): void {\n // This is a reliable way to get the parent span - because this is exactly how the parent is identified in the OTEL SDK\n const parentSpan = trace.getSpan(parentContext);\n const hub = getHubFromContext(parentContext);\n\n // We need access to the parent span in order to be able to move up the span tree for breadcrumbs\n if (parentSpan) {\n setSpanParent(span, parentSpan);\n }\n\n // The root context does not have a hub stored, so we check for this specifically\n // We do this instead of just falling back to `getCurrentHub` to avoid attaching the wrong hub\n let actualHub = hub;\n if (parentContext === ROOT_CONTEXT) {\n actualHub = getCurrentHub();\n }\n\n // We need the scope at time of span creation in order to apply it to the event when the span is finished\n if (actualHub) {\n const scope = actualHub.getScope();\n setSpanScope(span, actualHub.getScope());\n setSpanHub(span, actualHub);\n\n // Use this scope for finishing the span\n const finishScope = (scope as OpenTelemetryScope).clone();\n finishScope.activeSpan = span;\n setSpanFinishScope(span, finishScope);\n }\n}\n\nfunction onSpanEnd(span: Span): void {\n // Capture exceptions as events\n const hub = getSpanHub(span) || getCurrentHub();\n span.events.forEach(event => {\n maybeCaptureExceptionForTimedEvent(hub, event, span);\n });\n}\n\n/**\n * Converts OpenTelemetry Spans to Sentry Spans and sends them to Sentry via\n * the Sentry SDK.\n */\nexport class SentrySpanProcessor extends BatchSpanProcessor implements SpanProcessorInterface {\n private _scopeClass: typeof OpenTelemetryScope;\n\n public constructor(options: { scopeClass?: typeof OpenTelemetryScope } = {}) {\n super(new SentrySpanExporter());\n\n this._scopeClass = options.scopeClass || OpenTelemetryScope;\n }\n\n /**\n * @inheritDoc\n */\n public onStart(span: Span, parentContext: Context): void {\n onSpanStart(span, parentContext, this._scopeClass);\n\n DEBUG_BUILD && logger.log(`[Tracing] Starting span \"${span.name}\" (${span.spanContext().spanId})`);\n\n return super.onStart(span, parentContext);\n }\n\n /** @inheritDoc */\n public onEnd(span: Span): void {\n DEBUG_BUILD && logger.log(`[Tracing] Finishing span \"${span.name}\" (${span.spanContext().spanId})`);\n\n if (!this._shouldSendSpanToSentry(span)) {\n // Prevent this being called to super.onEnd(), which would pass this to the span exporter\n return;\n }\n\n onSpanEnd(span);\n\n return super.onEnd(span);\n }\n\n /**\n * You can overwrite this in a sub class to implement custom behavior for dropping spans.\n * If you return `false` here, the span will not be passed to the exporter and thus not be sent.\n */\n protected _shouldSendSpanToSentry(_span: Span): boolean {\n return true;\n }\n}\n"],"names":[],"mappings":";;;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|
1
|
-
{"version":3,"file":"trace.js","sources":["../../src/trace.ts"],"sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport { SpanStatusCode, trace } from '@opentelemetry/api';\nimport { SDK_VERSION } from '@sentry/core';\nimport type { Client } from '@sentry/types';\nimport { isThenable } from '@sentry/utils';\n\nimport { getClient } from './custom/hub';\nimport { InternalSentrySemanticAttributes } from './semanticAttributes';\nimport type { OpenTelemetryClient, OpenTelemetrySpanContext } from './types';\nimport { setSpanMetadata } from './utils/spanData';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.\n */\nexport function startSpan<T>(spanContext: OpenTelemetrySpanContext, callback: (span: Span) => T): T {\n const tracer = getTracer();\n\n const { name } = spanContext;\n\n return tracer.startActiveSpan(name, span => {\n function finishSpan(): void {\n span.end();\n }\n\n _applySentryAttributesToSpan(span, spanContext);\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(span);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n finishSpan();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishSpan();\n },\n () => {\n span.setStatus({ code: SpanStatusCode.ERROR });\n finishSpan();\n },\n );\n } else {\n finishSpan();\n }\n\n return maybePromiseResult;\n });\n}\n\n/**\n * @deprecated Use {@link startSpan} instead.\n */\nexport const startActiveSpan = startSpan;\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startInactiveSpan(spanContext: OpenTelemetrySpanContext): Span {\n const tracer = getTracer();\n\n const { name } = spanContext;\n\n const span = tracer.startSpan(name);\n\n _applySentryAttributesToSpan(span, spanContext);\n\n return span;\n}\n\nfunction getTracer(): Tracer {\n const client = getClient<Client & OpenTelemetryClient>();\n return (client && client.tracer) || trace.getTracer('@sentry/opentelemetry', SDK_VERSION);\n}\n\nfunction _applySentryAttributesToSpan(span: Span, spanContext: OpenTelemetrySpanContext): void {\n const { origin, op, source, metadata } = spanContext;\n\n if (origin) {\n span.setAttribute(InternalSentrySemanticAttributes.ORIGIN, origin);\n }\n\n if (op) {\n span.setAttribute(InternalSentrySemanticAttributes.OP, op);\n }\n\n if (source) {\n span.setAttribute(InternalSentrySemanticAttributes.SOURCE, source);\n }\n\n if (metadata) {\n setSpanMetadata(span, metadata);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"trace.js","sources":["../../src/trace.ts"],"sourcesContent":["import type { Span, Tracer } from '@opentelemetry/api';\nimport { SpanStatusCode, trace } from '@opentelemetry/api';\nimport { SDK_VERSION } from '@sentry/core';\nimport type { Client } from '@sentry/types';\nimport { isThenable } from '@sentry/utils';\n\nimport { getClient } from './custom/hub';\nimport { InternalSentrySemanticAttributes } from './semanticAttributes';\nimport type { OpenTelemetryClient, OpenTelemetrySpanContext } from './types';\nimport { setSpanMetadata } from './utils/spanData';\n\n/**\n * Wraps a function with a transaction/span and finishes the span after the function is done.\n * The created span is the active span and will be used as parent by other spans created inside the function\n * and can be accessed via `Sentry.getSpan()`, as long as the function is executed while the scope is active.\n *\n * If you want to create a span that is not set as active, use {@link startInactiveSpan}.\n *\n * Note that you'll always get a span passed to the callback, it may just be a NonRecordingSpan if the span is not sampled.\n */\nexport function startSpan<T>(spanContext: OpenTelemetrySpanContext, callback: (span: Span) => T): T {\n const tracer = getTracer();\n\n const { name } = spanContext;\n\n return tracer.startActiveSpan(name, span => {\n function finishSpan(): void {\n span.end();\n }\n\n _applySentryAttributesToSpan(span, spanContext);\n\n let maybePromiseResult: T;\n try {\n maybePromiseResult = callback(span);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR });\n finishSpan();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishSpan();\n },\n () => {\n span.setStatus({ code: SpanStatusCode.ERROR });\n finishSpan();\n },\n );\n } else {\n finishSpan();\n }\n\n return maybePromiseResult;\n });\n}\n\n/**\n * @deprecated Use {@link startSpan} instead.\n */\nexport const startActiveSpan = startSpan;\n\n/**\n * Creates a span. This span is not set as active, so will not get automatic instrumentation spans\n * as children or be able to be accessed via `Sentry.getSpan()`.\n *\n * If you want to create a span that is set as active, use {@link startSpan}.\n *\n * Note that if you have not enabled tracing extensions via `addTracingExtensions`\n * or you didn't set `tracesSampleRate` or `tracesSampler`, this function will not generate spans\n * and the `span` returned from the callback will be undefined.\n */\nexport function startInactiveSpan(spanContext: OpenTelemetrySpanContext): Span {\n const tracer = getTracer();\n\n const { name } = spanContext;\n\n const span = tracer.startSpan(name);\n\n _applySentryAttributesToSpan(span, spanContext);\n\n return span;\n}\n\nfunction getTracer(): Tracer {\n const client = getClient<Client & OpenTelemetryClient>();\n return (client && client.tracer) || trace.getTracer('@sentry/opentelemetry', SDK_VERSION);\n}\n\nfunction _applySentryAttributesToSpan(span: Span, spanContext: OpenTelemetrySpanContext): void {\n const { origin, op, source, metadata } = spanContext;\n\n if (origin) {\n span.setAttribute(InternalSentrySemanticAttributes.ORIGIN, origin);\n }\n\n if (op) {\n span.setAttribute(InternalSentrySemanticAttributes.OP, op);\n }\n\n if (source) {\n span.setAttribute(InternalSentrySemanticAttributes.SOURCE, source);\n }\n\n if (metadata) {\n setSpanMetadata(span, metadata);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAWA;AACA;AACA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riginToSpan.js","sources":["../../../src/utils/addOriginToSpan.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { SpanOrigin } from '@sentry/types';\n\nimport { InternalSentrySemanticAttributes } from '../semanticAttributes';\n\n/** Adds an origin to an OTEL Span. */\nexport function addOriginToSpan(span: Span, origin: SpanOrigin): void {\n span.setAttribute(InternalSentrySemanticAttributes.ORIGIN, origin);\n}\n"],"names":[],"mappings":";;AAKA;
|
|
1
|
+
{"version":3,"file":"addOriginToSpan.js","sources":["../../../src/utils/addOriginToSpan.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { SpanOrigin } from '@sentry/types';\n\nimport { InternalSentrySemanticAttributes } from '../semanticAttributes';\n\n/** Adds an origin to an OTEL Span. */\nexport function addOriginToSpan(span: Span, origin: SpanOrigin): void {\n span.setAttribute(InternalSentrySemanticAttributes.ORIGIN, origin);\n}\n"],"names":[],"mappings":";;AAKA;AACO,SAAS,eAAe,CAAC,IAAI,EAAQ,MAAM,EAAoB;AACtE,EAAE,IAAI,CAAC,YAAY,CAAC,gCAAgC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AACpE;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"captureExceptionForTimedEvent.js","sources":["../../../src/utils/captureExceptionForTimedEvent.ts"],"sourcesContent":["import type { Span as OtelSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { Hub } from '@sentry/types';\nimport { isString } from '@sentry/utils';\n\n/**\n * Maybe capture a Sentry exception for an OTEL timed event.\n * This will check if the event is exception-like and in that case capture it as an exception.\n */\nexport function maybeCaptureExceptionForTimedEvent(hub: Hub, event: TimedEvent, otelSpan?: OtelSpan): void {\n if (event.name !== 'exception') {\n return;\n }\n\n const attributes = event.attributes;\n if (!attributes) {\n return;\n }\n\n const message = attributes[SemanticAttributes.EXCEPTION_MESSAGE];\n\n if (typeof message !== 'string') {\n return;\n }\n\n const syntheticError = new Error(message);\n\n const stack = attributes[SemanticAttributes.EXCEPTION_STACKTRACE];\n if (isString(stack)) {\n syntheticError.stack = stack;\n }\n\n const type = attributes[SemanticAttributes.EXCEPTION_TYPE];\n if (isString(type)) {\n syntheticError.name = type;\n }\n\n hub.captureException(syntheticError, {\n captureContext: otelSpan\n ? {\n contexts: {\n otel: {\n attributes: otelSpan.attributes,\n resource: otelSpan.resource.attributes,\n },\n trace: {\n trace_id: otelSpan.spanContext().traceId,\n span_id: otelSpan.spanContext().spanId,\n parent_span_id: otelSpan.parentSpanId,\n },\n },\n }\n : undefined,\n });\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"captureExceptionForTimedEvent.js","sources":["../../../src/utils/captureExceptionForTimedEvent.ts"],"sourcesContent":["import type { Span as OtelSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { Hub } from '@sentry/types';\nimport { isString } from '@sentry/utils';\n\n/**\n * Maybe capture a Sentry exception for an OTEL timed event.\n * This will check if the event is exception-like and in that case capture it as an exception.\n */\nexport function maybeCaptureExceptionForTimedEvent(hub: Hub, event: TimedEvent, otelSpan?: OtelSpan): void {\n if (event.name !== 'exception') {\n return;\n }\n\n const attributes = event.attributes;\n if (!attributes) {\n return;\n }\n\n const message = attributes[SemanticAttributes.EXCEPTION_MESSAGE];\n\n if (typeof message !== 'string') {\n return;\n }\n\n const syntheticError = new Error(message);\n\n const stack = attributes[SemanticAttributes.EXCEPTION_STACKTRACE];\n if (isString(stack)) {\n syntheticError.stack = stack;\n }\n\n const type = attributes[SemanticAttributes.EXCEPTION_TYPE];\n if (isString(type)) {\n syntheticError.name = type;\n }\n\n hub.captureException(syntheticError, {\n captureContext: otelSpan\n ? {\n contexts: {\n otel: {\n attributes: otelSpan.attributes,\n resource: otelSpan.resource.attributes,\n },\n trace: {\n trace_id: otelSpan.spanContext().traceId,\n span_id: otelSpan.spanContext().spanId,\n parent_span_id: otelSpan.parentSpanId,\n },\n },\n }\n : undefined,\n });\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA;AACO,SAAS,kCAAkC,CAAC,GAAG,EAAO,KAAK,EAAc,QAAQ,EAAmB;AAC3G,EAAE,IAAI,KAAK,CAAC,IAAK,KAAI,WAAW,EAAE;AAClC,IAAI,OAAM;AACV,GAAE;AACF;AACA,EAAE,MAAM,UAAA,GAAa,KAAK,CAAC,UAAU,CAAA;AACrC,EAAE,IAAI,CAAC,UAAU,EAAE;AACnB,IAAI,OAAM;AACV,GAAE;AACF;AACA,EAAE,MAAM,UAAU,UAAU,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AAClE;AACA,EAAE,IAAI,OAAO,OAAQ,KAAI,QAAQ,EAAE;AACnC,IAAI,OAAM;AACV,GAAE;AACF;AACA,EAAE,MAAM,cAAe,GAAE,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;AAC3C;AACA,EAAE,MAAM,QAAQ,UAAU,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAA;AACnE,EAAE,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;AACvB,IAAI,cAAc,CAAC,KAAM,GAAE,KAAK,CAAA;AAChC,GAAE;AACF;AACA,EAAE,MAAM,OAAO,UAAU,CAAC,kBAAkB,CAAC,cAAc,CAAC,CAAA;AAC5D,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,EAAE;AACtB,IAAI,cAAc,CAAC,IAAK,GAAE,IAAI,CAAA;AAC9B,GAAE;AACF;AACA,EAAE,GAAG,CAAC,gBAAgB,CAAC,cAAc,EAAE;AACvC,IAAI,cAAc,EAAE,QAAA;AACpB,QAAQ;AACR,UAAU,QAAQ,EAAE;AACpB,YAAY,IAAI,EAAE;AAClB,cAAc,UAAU,EAAE,QAAQ,CAAC,UAAU;AAC7C,cAAc,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU;AACpD,aAAa;AACb,YAAY,KAAK,EAAE;AACnB,cAAc,QAAQ,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,OAAO;AACtD,cAAc,OAAO,EAAE,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM;AACpD,cAAc,cAAc,EAAE,QAAQ,CAAC,YAAY;AACnD,aAAa;AACb,WAAW;AACX,SAAQ;AACR,QAAQ,SAAS;AACjB,GAAG,CAAC,CAAA;AACJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contextData.js","sources":["../../../src/utils/contextData.ts"],"sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport type { Hub, PropagationContext } from '@sentry/types';\n\nimport { SENTRY_HUB_CONTEXT_KEY, SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY } from '../constants';\n\n/**\n * Try to get the Propagation Context from the given OTEL context.\n * This requires the SentryPropagator to be registered.\n */\nexport function getPropagationContextFromContext(context: Context): PropagationContext | undefined {\n return context.getValue(SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY) as PropagationContext | undefined;\n}\n\n/**\n * Set a Propagation Context on an OTEL context..\n * This will return a forked context with the Propagation Context set.\n */\nexport function setPropagationContextOnContext(context: Context, propagationContext: PropagationContext): Context {\n return context.setValue(SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY, propagationContext);\n}\n\n/**\n * Try to get the Hub from the given OTEL context.\n * This requires a Context Manager that was wrapped with getWrappedContextManager.\n */\nexport function getHubFromContext(context: Context): Hub | undefined {\n return context.getValue(SENTRY_HUB_CONTEXT_KEY) as Hub | undefined;\n}\n\n/**\n * Set a Hub on an OTEL context..\n * This will return a forked context with the Propagation Context set.\n */\nexport function setHubOnContext(context: Context, hub: Hub): Context {\n return context.setValue(SENTRY_HUB_CONTEXT_KEY, hub);\n}\n"],"names":[],"mappings":";;AAKA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"contextData.js","sources":["../../../src/utils/contextData.ts"],"sourcesContent":["import type { Context } from '@opentelemetry/api';\nimport type { Hub, PropagationContext } from '@sentry/types';\n\nimport { SENTRY_HUB_CONTEXT_KEY, SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY } from '../constants';\n\n/**\n * Try to get the Propagation Context from the given OTEL context.\n * This requires the SentryPropagator to be registered.\n */\nexport function getPropagationContextFromContext(context: Context): PropagationContext | undefined {\n return context.getValue(SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY) as PropagationContext | undefined;\n}\n\n/**\n * Set a Propagation Context on an OTEL context..\n * This will return a forked context with the Propagation Context set.\n */\nexport function setPropagationContextOnContext(context: Context, propagationContext: PropagationContext): Context {\n return context.setValue(SENTRY_PROPAGATION_CONTEXT_CONTEXT_KEY, propagationContext);\n}\n\n/**\n * Try to get the Hub from the given OTEL context.\n * This requires a Context Manager that was wrapped with getWrappedContextManager.\n */\nexport function getHubFromContext(context: Context): Hub | undefined {\n return context.getValue(SENTRY_HUB_CONTEXT_KEY) as Hub | undefined;\n}\n\n/**\n * Set a Hub on an OTEL context..\n * This will return a forked context with the Propagation Context set.\n */\nexport function setHubOnContext(context: Context, hub: Hub): Context {\n return context.setValue(SENTRY_HUB_CONTEXT_KEY, hub);\n}\n"],"names":[],"mappings":";;AAKA;AACA;AACA;AACA;AACO,SAAS,gCAAgC,CAAC,OAAO,EAA2C;AACnG,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,sCAAsC,CAAE,EAAA;AAClE,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,8BAA8B,CAAC,OAAO,EAAW,kBAAkB,EAA+B;AAClH,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,sCAAsC,EAAE,kBAAkB,CAAC,CAAA;AACrF,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB,CAAC,OAAO,EAA4B;AACrE,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAE,EAAA;AAClD,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe,CAAC,OAAO,EAAW,GAAG,EAAgB;AACrE,EAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAA;AACtD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertOtelTimeToSeconds.js","sources":["../../../src/utils/convertOtelTimeToSeconds.ts"],"sourcesContent":["/** Convert an OTEL time to seconds */\nexport function convertOtelTimeToSeconds([seconds, nano]: [number, number]): number {\n return seconds + nano / 1_000_000_000;\n}\n"],"names":[],"mappings":"AAAA;
|
|
1
|
+
{"version":3,"file":"convertOtelTimeToSeconds.js","sources":["../../../src/utils/convertOtelTimeToSeconds.ts"],"sourcesContent":["/** Convert an OTEL time to seconds */\nexport function convertOtelTimeToSeconds([seconds, nano]: [number, number]): number {\n return seconds + nano / 1_000_000_000;\n}\n"],"names":[],"mappings":"AAAA;AACO,SAAS,wBAAwB,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,EAA4B;AACpF,EAAE,OAAO,OAAA,GAAU,IAAA,GAAO,UAAa,CAAA;AACvC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getActiveSpan.js","sources":["../../../src/utils/getActiveSpan.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\n\nimport { getSpanParent } from './spanData';\n\n/**\n * Returns the currently active span.\n */\nexport function getActiveSpan(): Span | undefined {\n return trace.getActiveSpan();\n}\n\n/**\n * Get the root span for the given span.\n * The given span may be the root span itself.\n */\nexport function getRootSpan(span: Span): Span {\n let parent: Span = span;\n\n while (getSpanParent(parent)) {\n parent = getSpanParent(parent) as Span;\n }\n\n return parent;\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"getActiveSpan.js","sources":["../../../src/utils/getActiveSpan.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport { trace } from '@opentelemetry/api';\n\nimport { getSpanParent } from './spanData';\n\n/**\n * Returns the currently active span.\n */\nexport function getActiveSpan(): Span | undefined {\n return trace.getActiveSpan();\n}\n\n/**\n * Get the root span for the given span.\n * The given span may be the root span itself.\n */\nexport function getRootSpan(span: Span): Span {\n let parent: Span = span;\n\n while (getSpanParent(parent)) {\n parent = getSpanParent(parent) as Span;\n }\n\n return parent;\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACO,SAAS,aAAa,GAAqB;AAClD,EAAE,OAAO,KAAK,CAAC,aAAa,EAAE,CAAA;AAC9B,CAAA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,IAAI,EAAc;AAC9C,EAAE,IAAI,MAAM,GAAS,IAAI,CAAA;AACzB;AACA,EAAE,OAAO,aAAa,CAAC,MAAM,CAAC,EAAE;AAChC,IAAI,MAAO,GAAE,aAAa,CAAC,MAAM,CAAE,EAAA;AACnC,GAAE;AACF;AACA,EAAE,OAAO,MAAM,CAAA;AACf;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRequestSpanData.js","sources":["../../../src/utils/getRequestSpanData.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { ReadableSpan } from '@opentelemetry/sdk-trace-base';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { SanitizedRequestData } from '@sentry/types';\nimport { getSanitizedUrlString, parseUrl } from '@sentry/utils';\n\nimport { spanHasAttributes } from './spanTypes';\n\n/**\n * Get sanitizied request data from an OTEL span.\n */\nexport function getRequestSpanData(span: Span | ReadableSpan): Partial<SanitizedRequestData> {\n // The base `Span` type has no `attributes`, so we need to guard here against that\n if (!spanHasAttributes(span)) {\n return {};\n }\n\n const data: Partial<SanitizedRequestData> = {\n url: span.attributes[SemanticAttributes.HTTP_URL] as string | undefined,\n 'http.method': span.attributes[SemanticAttributes.HTTP_METHOD] as string | undefined,\n };\n\n // Default to GET if URL is set but method is not\n if (!data['http.method'] && data.url) {\n data['http.method'] = 'GET';\n }\n\n try {\n const urlStr = span.attributes[SemanticAttributes.HTTP_URL];\n if (typeof urlStr === 'string') {\n const url = parseUrl(urlStr);\n\n data.url = getSanitizedUrlString(url);\n\n if (url.search) {\n data['http.query'] = url.search;\n }\n if (url.hash) {\n data['http.fragment'] = url.hash;\n }\n }\n } catch {\n // ignore\n }\n\n return data;\n}\n"],"names":[],"mappings":";;;;AAQA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"getRequestSpanData.js","sources":["../../../src/utils/getRequestSpanData.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { ReadableSpan } from '@opentelemetry/sdk-trace-base';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { SanitizedRequestData } from '@sentry/types';\nimport { getSanitizedUrlString, parseUrl } from '@sentry/utils';\n\nimport { spanHasAttributes } from './spanTypes';\n\n/**\n * Get sanitizied request data from an OTEL span.\n */\nexport function getRequestSpanData(span: Span | ReadableSpan): Partial<SanitizedRequestData> {\n // The base `Span` type has no `attributes`, so we need to guard here against that\n if (!spanHasAttributes(span)) {\n return {};\n }\n\n const data: Partial<SanitizedRequestData> = {\n url: span.attributes[SemanticAttributes.HTTP_URL] as string | undefined,\n 'http.method': span.attributes[SemanticAttributes.HTTP_METHOD] as string | undefined,\n };\n\n // Default to GET if URL is set but method is not\n if (!data['http.method'] && data.url) {\n data['http.method'] = 'GET';\n }\n\n try {\n const urlStr = span.attributes[SemanticAttributes.HTTP_URL];\n if (typeof urlStr === 'string') {\n const url = parseUrl(urlStr);\n\n data.url = getSanitizedUrlString(url);\n\n if (url.search) {\n data['http.query'] = url.search;\n }\n if (url.hash) {\n data['http.fragment'] = url.hash;\n }\n }\n } catch {\n // ignore\n }\n\n return data;\n}\n"],"names":[],"mappings":";;;;AAQA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,IAAI,EAAsD;AAC7F;AACA,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;AAChC,IAAI,OAAO,EAAE,CAAA;AACb,GAAE;AACF;AACA,EAAE,MAAM,IAAI,GAAkC;AAC9C,IAAI,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAE;AACtD,IAAI,aAAa,EAAE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,WAAW,CAAE;AACnE,GAAG,CAAA;AACH;AACA;AACA,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa,CAAA,IAAK,IAAI,CAAC,GAAG,EAAE;AACxC,IAAI,IAAI,CAAC,aAAa,CAAA,GAAI,KAAK,CAAA;AAC/B,GAAE;AACF;AACA,EAAE,IAAI;AACN,IAAI,MAAM,MAAO,GAAE,IAAI,CAAC,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;AAC/D,IAAI,IAAI,OAAO,MAAO,KAAI,QAAQ,EAAE;AACpC,MAAM,MAAM,GAAI,GAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;AAClC;AACA,MAAM,IAAI,CAAC,GAAA,GAAM,qBAAqB,CAAC,GAAG,CAAC,CAAA;AAC3C;AACA,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE;AACtB,QAAQ,IAAI,CAAC,YAAY,IAAI,GAAG,CAAC,MAAM,CAAA;AACvC,OAAM;AACN,MAAM,IAAI,GAAG,CAAC,IAAI,EAAE;AACpB,QAAQ,IAAI,CAAC,eAAe,IAAI,GAAG,CAAC,IAAI,CAAA;AACxC,OAAM;AACN,KAAI;AACJ,IAAI,OAAM,CAAA,EAAA;AACV;AACA,GAAE;AACF;AACA,EAAE,OAAO,IAAI,CAAA;AACb;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getSpanKind.js","sources":["../../../src/utils/getSpanKind.ts"],"sourcesContent":["import { SpanKind } from '@opentelemetry/api';\n\nimport type { AbstractSpan } from '../types';\nimport { spanHasKind } from './spanTypes';\n\n/**\n * Get the span kind from a span.\n * For whatever reason, this is not public API on the generic \"Span\" type,\n * so we need to check if we actually have a `SDKTraceBaseSpan` where we can fetch this from.\n * Otherwise, we fall back to `SpanKind.INTERNAL`.\n */\nexport function getSpanKind(span: AbstractSpan): SpanKind {\n if (spanHasKind(span)) {\n return span.kind;\n }\n\n return SpanKind.INTERNAL;\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"getSpanKind.js","sources":["../../../src/utils/getSpanKind.ts"],"sourcesContent":["import { SpanKind } from '@opentelemetry/api';\n\nimport type { AbstractSpan } from '../types';\nimport { spanHasKind } from './spanTypes';\n\n/**\n * Get the span kind from a span.\n * For whatever reason, this is not public API on the generic \"Span\" type,\n * so we need to check if we actually have a `SDKTraceBaseSpan` where we can fetch this from.\n * Otherwise, we fall back to `SpanKind.INTERNAL`.\n */\nexport function getSpanKind(span: AbstractSpan): SpanKind {\n if (spanHasKind(span)) {\n return span.kind;\n }\n\n return SpanKind.INTERNAL;\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,IAAI,EAA0B;AAC1D,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE;AACzB,IAAI,OAAO,IAAI,CAAC,IAAI,CAAA;AACpB,GAAE;AACF;AACA,EAAE,OAAO,QAAQ,CAAC,QAAQ,CAAA;AAC1B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupSpansWithParents.js","sources":["../../../src/utils/groupSpansWithParents.ts"],"sourcesContent":["import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';\n\nimport { getSpanParent } from './spanData';\n\nexport interface SpanNode {\n id: string;\n span?: ReadableSpan;\n parentNode?: SpanNode | undefined;\n children: SpanNode[];\n}\n\ntype SpanMap = Map<string, SpanNode>;\n\n/**\n * This function runs through a list of OTEL Spans, and wraps them in an `SpanNode`\n * where each node holds a reference to their parent node.\n */\nexport function groupSpansWithParents(spans: ReadableSpan[]): SpanNode[] {\n const nodeMap: SpanMap = new Map<string, SpanNode>();\n\n for (const span of spans) {\n createOrUpdateSpanNodeAndRefs(nodeMap, span);\n }\n\n return Array.from(nodeMap, function ([_id, spanNode]) {\n return spanNode;\n });\n}\n\nfunction createOrUpdateSpanNodeAndRefs(nodeMap: SpanMap, span: ReadableSpan): void {\n const parentSpan = getSpanParent(span);\n const parentIsRemote = parentSpan ? !!parentSpan.spanContext().isRemote : false;\n\n const id = span.spanContext().spanId;\n\n // If the parentId is the trace parent ID, we pretend it's undefined\n // As this means the parent exists somewhere else\n const parentId = !parentIsRemote ? span.parentSpanId : undefined;\n\n if (!parentId) {\n createOrUpdateNode(nodeMap, { id, span, children: [] });\n return;\n }\n\n // Else make sure to create parent node as well\n // Note that the parent may not know it's parent _yet_, this may be updated in a later pass\n const parentNode = createOrGetParentNode(nodeMap, parentId);\n const node = createOrUpdateNode(nodeMap, { id, span, parentNode, children: [] });\n parentNode.children.push(node);\n}\n\nfunction createOrGetParentNode(nodeMap: SpanMap, id: string): SpanNode {\n const existing = nodeMap.get(id);\n\n if (existing) {\n return existing;\n }\n\n return createOrUpdateNode(nodeMap, { id, children: [] });\n}\n\nfunction createOrUpdateNode(nodeMap: SpanMap, spanNode: SpanNode): SpanNode {\n const existing = nodeMap.get(spanNode.id);\n\n // If span is already set, nothing to do here\n if (existing && existing.span) {\n return existing;\n }\n\n // If it exists but span is not set yet, we update it\n if (existing && !existing.span) {\n existing.span = spanNode.span;\n existing.parentNode = spanNode.parentNode;\n return existing;\n }\n\n // Else, we create a new one...\n nodeMap.set(spanNode.id, spanNode);\n return spanNode;\n}\n"],"names":[],"mappings":";;AAaA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"groupSpansWithParents.js","sources":["../../../src/utils/groupSpansWithParents.ts"],"sourcesContent":["import type { ReadableSpan } from '@opentelemetry/sdk-trace-base';\n\nimport { getSpanParent } from './spanData';\n\nexport interface SpanNode {\n id: string;\n span?: ReadableSpan;\n parentNode?: SpanNode | undefined;\n children: SpanNode[];\n}\n\ntype SpanMap = Map<string, SpanNode>;\n\n/**\n * This function runs through a list of OTEL Spans, and wraps them in an `SpanNode`\n * where each node holds a reference to their parent node.\n */\nexport function groupSpansWithParents(spans: ReadableSpan[]): SpanNode[] {\n const nodeMap: SpanMap = new Map<string, SpanNode>();\n\n for (const span of spans) {\n createOrUpdateSpanNodeAndRefs(nodeMap, span);\n }\n\n return Array.from(nodeMap, function ([_id, spanNode]) {\n return spanNode;\n });\n}\n\nfunction createOrUpdateSpanNodeAndRefs(nodeMap: SpanMap, span: ReadableSpan): void {\n const parentSpan = getSpanParent(span);\n const parentIsRemote = parentSpan ? !!parentSpan.spanContext().isRemote : false;\n\n const id = span.spanContext().spanId;\n\n // If the parentId is the trace parent ID, we pretend it's undefined\n // As this means the parent exists somewhere else\n const parentId = !parentIsRemote ? span.parentSpanId : undefined;\n\n if (!parentId) {\n createOrUpdateNode(nodeMap, { id, span, children: [] });\n return;\n }\n\n // Else make sure to create parent node as well\n // Note that the parent may not know it's parent _yet_, this may be updated in a later pass\n const parentNode = createOrGetParentNode(nodeMap, parentId);\n const node = createOrUpdateNode(nodeMap, { id, span, parentNode, children: [] });\n parentNode.children.push(node);\n}\n\nfunction createOrGetParentNode(nodeMap: SpanMap, id: string): SpanNode {\n const existing = nodeMap.get(id);\n\n if (existing) {\n return existing;\n }\n\n return createOrUpdateNode(nodeMap, { id, children: [] });\n}\n\nfunction createOrUpdateNode(nodeMap: SpanMap, spanNode: SpanNode): SpanNode {\n const existing = nodeMap.get(spanNode.id);\n\n // If span is already set, nothing to do here\n if (existing && existing.span) {\n return existing;\n }\n\n // If it exists but span is not set yet, we update it\n if (existing && !existing.span) {\n existing.span = spanNode.span;\n existing.parentNode = spanNode.parentNode;\n return existing;\n }\n\n // Else, we create a new one...\n nodeMap.set(spanNode.id, spanNode);\n return spanNode;\n}\n"],"names":[],"mappings":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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAChC,CAAA;AACA;AACA,SAAS,qBAAqB,CAAC,OAAO,EAAW,EAAE,EAAoB;AACvE,EAAE,MAAM,WAAW,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;AAClC;AACA,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,OAAO,QAAQ,CAAA;AACnB,GAAE;AACF;AACA,EAAE,OAAO,kBAAkB,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAC,EAAG,CAAC,CAAA;AAC1D,CAAA;AACA;AACA,SAAS,kBAAkB,CAAC,OAAO,EAAW,QAAQ,EAAsB;AAC5E,EAAE,MAAM,QAAS,GAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;AAC3C;AACA;AACA,EAAE,IAAI,QAAA,IAAY,QAAQ,CAAC,IAAI,EAAE;AACjC,IAAI,OAAO,QAAQ,CAAA;AACnB,GAAE;AACF;AACA;AACA,EAAE,IAAI,QAAS,IAAG,CAAC,QAAQ,CAAC,IAAI,EAAE;AAClC,IAAI,QAAQ,CAAC,IAAA,GAAO,QAAQ,CAAC,IAAI,CAAA;AACjC,IAAI,QAAQ,CAAC,UAAA,GAAa,QAAQ,CAAC,UAAU,CAAA;AAC7C,IAAI,OAAO,QAAQ,CAAA;AACnB,GAAE;AACF;AACA;AACA,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;AACpC,EAAE,OAAO,QAAQ,CAAA;AACjB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isSentryRequest.js","sources":["../../../src/utils/isSentryRequest.ts"],"sourcesContent":["import { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport { getClient, isSentryRequestUrl } from '@sentry/core';\n\nimport type { AbstractSpan } from '../types';\nimport { spanHasAttributes } from './spanTypes';\n\n/**\n *\n * @param otelSpan Checks wheter a given OTEL Span is an http request to sentry.\n * @returns boolean\n */\nexport function isSentryRequestSpan(span: AbstractSpan): boolean {\n if (!spanHasAttributes(span)) {\n return false;\n }\n\n const { attributes } = span;\n\n const httpUrl = attributes[SemanticAttributes.HTTP_URL];\n\n if (!httpUrl) {\n return false;\n }\n\n return isSentryRequestUrl(httpUrl.toString(), getClient());\n}\n"],"names":[],"mappings":";;;;AAMA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"isSentryRequest.js","sources":["../../../src/utils/isSentryRequest.ts"],"sourcesContent":["import { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport { getClient, isSentryRequestUrl } from '@sentry/core';\n\nimport type { AbstractSpan } from '../types';\nimport { spanHasAttributes } from './spanTypes';\n\n/**\n *\n * @param otelSpan Checks wheter a given OTEL Span is an http request to sentry.\n * @returns boolean\n */\nexport function isSentryRequestSpan(span: AbstractSpan): boolean {\n if (!spanHasAttributes(span)) {\n return false;\n }\n\n const { attributes } = span;\n\n const httpUrl = attributes[SemanticAttributes.HTTP_URL];\n\n if (!httpUrl) {\n return false;\n }\n\n return isSentryRequestUrl(httpUrl.toString(), getClient());\n}\n"],"names":[],"mappings":";;;;AAMA;AACA;AACA;AACA;AACA;AACO,SAAS,mBAAmB,CAAC,IAAI,EAAyB;AACjE,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;AAChC,IAAI,OAAO,KAAK,CAAA;AAChB,GAAE;AACF;AACA,EAAE,MAAM,EAAE,UAAW,EAAA,GAAI,IAAI,CAAA;AAC7B;AACA,EAAE,MAAM,UAAU,UAAU,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;AACzD;AACA,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,IAAI,OAAO,KAAK,CAAA;AAChB,GAAE;AACF;AACA,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,CAAC,CAAA;AAC5D;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapStatus.js","sources":["../../../src/utils/mapStatus.ts"],"sourcesContent":["import { SpanStatusCode } from '@opentelemetry/api';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { SpanStatusType as SentryStatus } from '@sentry/core';\n\nimport type { AbstractSpan } from '../types';\nimport { spanHasAttributes, spanHasStatus } from './spanTypes';\n\n// canonicalCodesHTTPMap maps some HTTP codes to Sentry's span statuses. See possible mapping in https://develop.sentry.dev/sdk/event-payloads/span/\nconst canonicalCodesHTTPMap: Record<string, SentryStatus> = {\n '400': 'failed_precondition',\n '401': 'unauthenticated',\n '403': 'permission_denied',\n '404': 'not_found',\n '409': 'aborted',\n '429': 'resource_exhausted',\n '499': 'cancelled',\n '500': 'internal_error',\n '501': 'unimplemented',\n '503': 'unavailable',\n '504': 'deadline_exceeded',\n} as const;\n\n// canonicalCodesGrpcMap maps some GRPC codes to Sentry's span statuses. See description in grpc documentation.\nconst canonicalCodesGrpcMap: Record<string, SentryStatus> = {\n '1': 'cancelled',\n '2': 'unknown_error',\n '3': 'invalid_argument',\n '4': 'deadline_exceeded',\n '5': 'not_found',\n '6': 'already_exists',\n '7': 'permission_denied',\n '8': 'resource_exhausted',\n '9': 'failed_precondition',\n '10': 'aborted',\n '11': 'out_of_range',\n '12': 'unimplemented',\n '13': 'internal_error',\n '14': 'unavailable',\n '15': 'data_loss',\n '16': 'unauthenticated',\n} as const;\n\n/**\n * Get a Sentry span status from an otel span.\n */\nexport function mapStatus(span: AbstractSpan): SentryStatus {\n const attributes = spanHasAttributes(span) ? span.attributes : {};\n const status = spanHasStatus(span) ? span.status : undefined;\n\n const httpCode = attributes[SemanticAttributes.HTTP_STATUS_CODE];\n const grpcCode = attributes[SemanticAttributes.RPC_GRPC_STATUS_CODE];\n\n const code = typeof httpCode === 'string' ? httpCode : typeof httpCode === 'number' ? httpCode.toString() : undefined;\n if (code) {\n const sentryStatus = canonicalCodesHTTPMap[code];\n if (sentryStatus) {\n return sentryStatus;\n }\n }\n\n if (typeof grpcCode === 'string') {\n const sentryStatus = canonicalCodesGrpcMap[grpcCode];\n if (sentryStatus) {\n return sentryStatus;\n }\n }\n\n const statusCode = status && status.code;\n if (statusCode === SpanStatusCode.OK || statusCode === SpanStatusCode.UNSET) {\n return 'ok';\n }\n\n return 'unknown_error';\n}\n"],"names":[],"mappings":";;;;AAOA;AACA,
|
|
1
|
+
{"version":3,"file":"mapStatus.js","sources":["../../../src/utils/mapStatus.ts"],"sourcesContent":["import { SpanStatusCode } from '@opentelemetry/api';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { SpanStatusType as SentryStatus } from '@sentry/core';\n\nimport type { AbstractSpan } from '../types';\nimport { spanHasAttributes, spanHasStatus } from './spanTypes';\n\n// canonicalCodesHTTPMap maps some HTTP codes to Sentry's span statuses. See possible mapping in https://develop.sentry.dev/sdk/event-payloads/span/\nconst canonicalCodesHTTPMap: Record<string, SentryStatus> = {\n '400': 'failed_precondition',\n '401': 'unauthenticated',\n '403': 'permission_denied',\n '404': 'not_found',\n '409': 'aborted',\n '429': 'resource_exhausted',\n '499': 'cancelled',\n '500': 'internal_error',\n '501': 'unimplemented',\n '503': 'unavailable',\n '504': 'deadline_exceeded',\n} as const;\n\n// canonicalCodesGrpcMap maps some GRPC codes to Sentry's span statuses. See description in grpc documentation.\nconst canonicalCodesGrpcMap: Record<string, SentryStatus> = {\n '1': 'cancelled',\n '2': 'unknown_error',\n '3': 'invalid_argument',\n '4': 'deadline_exceeded',\n '5': 'not_found',\n '6': 'already_exists',\n '7': 'permission_denied',\n '8': 'resource_exhausted',\n '9': 'failed_precondition',\n '10': 'aborted',\n '11': 'out_of_range',\n '12': 'unimplemented',\n '13': 'internal_error',\n '14': 'unavailable',\n '15': 'data_loss',\n '16': 'unauthenticated',\n} as const;\n\n/**\n * Get a Sentry span status from an otel span.\n */\nexport function mapStatus(span: AbstractSpan): SentryStatus {\n const attributes = spanHasAttributes(span) ? span.attributes : {};\n const status = spanHasStatus(span) ? span.status : undefined;\n\n const httpCode = attributes[SemanticAttributes.HTTP_STATUS_CODE];\n const grpcCode = attributes[SemanticAttributes.RPC_GRPC_STATUS_CODE];\n\n const code = typeof httpCode === 'string' ? httpCode : typeof httpCode === 'number' ? httpCode.toString() : undefined;\n if (code) {\n const sentryStatus = canonicalCodesHTTPMap[code];\n if (sentryStatus) {\n return sentryStatus;\n }\n }\n\n if (typeof grpcCode === 'string') {\n const sentryStatus = canonicalCodesGrpcMap[grpcCode];\n if (sentryStatus) {\n return sentryStatus;\n }\n }\n\n const statusCode = status && status.code;\n if (statusCode === SpanStatusCode.OK || statusCode === SpanStatusCode.UNSET) {\n return 'ok';\n }\n\n return 'unknown_error';\n}\n"],"names":[],"mappings":";;;;AAOA;AACA,MAAM,qBAAqB,GAAiC;AAC5D,EAAE,KAAK,EAAE,qBAAqB;AAC9B,EAAE,KAAK,EAAE,iBAAiB;AAC1B,EAAE,KAAK,EAAE,mBAAmB;AAC5B,EAAE,KAAK,EAAE,WAAW;AACpB,EAAE,KAAK,EAAE,SAAS;AAClB,EAAE,KAAK,EAAE,oBAAoB;AAC7B,EAAE,KAAK,EAAE,WAAW;AACpB,EAAE,KAAK,EAAE,gBAAgB;AACzB,EAAE,KAAK,EAAE,eAAe;AACxB,EAAE,KAAK,EAAE,aAAa;AACtB,EAAE,KAAK,EAAE,mBAAmB;AAC5B,CAAE,EAAA;AACF;AACA;AACA,MAAM,qBAAqB,GAAiC;AAC5D,EAAE,GAAG,EAAE,WAAW;AAClB,EAAE,GAAG,EAAE,eAAe;AACtB,EAAE,GAAG,EAAE,kBAAkB;AACzB,EAAE,GAAG,EAAE,mBAAmB;AAC1B,EAAE,GAAG,EAAE,WAAW;AAClB,EAAE,GAAG,EAAE,gBAAgB;AACvB,EAAE,GAAG,EAAE,mBAAmB;AAC1B,EAAE,GAAG,EAAE,oBAAoB;AAC3B,EAAE,GAAG,EAAE,qBAAqB;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W,KAAI,cAAc,CAAC,EAAG,IAAG,UAAW,KAAI,cAAc,CAAC,KAAK,EAAE;AAC/E,IAAI,OAAO,IAAI,CAAA;AACf,GAAE;AACF;AACA,EAAE,OAAO,eAAe,CAAA;AACxB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseSpanDescription.js","sources":["../../../src/utils/parseSpanDescription.ts"],"sourcesContent":["import type { AttributeValue, Attributes } from '@opentelemetry/api';\nimport { SpanKind } from '@opentelemetry/api';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { TransactionSource } from '@sentry/types';\nimport { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '@sentry/utils';\n\nimport type { AbstractSpan } from '../types';\nimport { getSpanKind } from './getSpanKind';\nimport { spanHasAttributes, spanHasName } from './spanTypes';\n\ninterface SpanDescription {\n op: string | undefined;\n description: string;\n source: TransactionSource;\n data?: Record<string, string>;\n}\n\n/**\n * Extract better op/description from an otel span.\n *\n * Based on https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/7422ce2a06337f68a59b552b8c5a2ac125d6bae5/exporter/sentryexporter/sentry_exporter.go#L306\n */\nexport function parseSpanDescription(span: AbstractSpan): SpanDescription {\n const attributes = spanHasAttributes(span) ? span.attributes : {};\n const name = spanHasName(span) ? span.name : '<unknown>';\n\n // if http.method exists, this is an http request span\n const httpMethod = attributes[SemanticAttributes.HTTP_METHOD];\n if (httpMethod) {\n return descriptionForHttpMethod({ attributes, name, kind: getSpanKind(span) }, httpMethod);\n }\n\n // If db.type exists then this is a database call span.\n const dbSystem = attributes[SemanticAttributes.DB_SYSTEM];\n if (dbSystem) {\n return descriptionForDbSystem({ attributes, name });\n }\n\n // If rpc.service exists then this is a rpc call span.\n const rpcService = attributes[SemanticAttributes.RPC_SERVICE];\n if (rpcService) {\n return {\n op: 'rpc',\n description: name,\n source: 'route',\n };\n }\n\n // If messaging.system exists then this is a messaging system span.\n const messagingSystem = attributes[SemanticAttributes.MESSAGING_SYSTEM];\n if (messagingSystem) {\n return {\n op: 'message',\n description: name,\n source: 'route',\n };\n }\n\n // If faas.trigger exists then this is a function as a service span.\n const faasTrigger = attributes[SemanticAttributes.FAAS_TRIGGER];\n if (faasTrigger) {\n return { op: faasTrigger.toString(), description: name, source: 'route' };\n }\n\n return { op: undefined, description: name, source: 'custom' };\n}\n\nfunction descriptionForDbSystem({ attributes, name }: { attributes: Attributes; name: string }): SpanDescription {\n // Use DB statement (Ex \"SELECT * FROM table\") if possible as description.\n const statement = attributes[SemanticAttributes.DB_STATEMENT];\n\n const description = statement ? statement.toString() : name;\n\n return { op: 'db', description, source: 'task' };\n}\n\n/** Only exported for tests. */\nexport function descriptionForHttpMethod(\n { name, kind, attributes }: { name: string; attributes: Attributes; kind: SpanKind },\n httpMethod: AttributeValue,\n): SpanDescription {\n const opParts = ['http'];\n\n switch (kind) {\n case SpanKind.CLIENT:\n opParts.push('client');\n break;\n case SpanKind.SERVER:\n opParts.push('server');\n break;\n }\n\n const { urlPath, url, query, fragment, hasRoute } = getSanitizedUrl(attributes, kind);\n\n if (!urlPath) {\n return { op: opParts.join('.'), description: name, source: 'custom' };\n }\n\n // Ex. description=\"GET /api/users\".\n const description = `${httpMethod} ${urlPath}`;\n\n // If `httpPath` is a root path, then we can categorize the transaction source as route.\n const source: TransactionSource = hasRoute || urlPath === '/' ? 'route' : 'url';\n\n const data: Record<string, string> = {};\n\n if (url) {\n data.url = url;\n }\n if (query) {\n data['http.query'] = query;\n }\n if (fragment) {\n data['http.fragment'] = fragment;\n }\n\n return {\n op: opParts.join('.'),\n description,\n source,\n data,\n };\n}\n\n/** Exported for tests only */\nexport function getSanitizedUrl(\n attributes: Attributes,\n kind: SpanKind,\n): {\n url: string | undefined;\n urlPath: string | undefined;\n query: string | undefined;\n fragment: string | undefined;\n hasRoute: boolean;\n} {\n // This is the relative path of the URL, e.g. /sub\n const httpTarget = attributes[SemanticAttributes.HTTP_TARGET];\n // This is the full URL, including host & query params etc., e.g. https://example.com/sub?foo=bar\n const httpUrl = attributes[SemanticAttributes.HTTP_URL];\n // This is the normalized route name - may not always be available!\n const httpRoute = attributes[SemanticAttributes.HTTP_ROUTE];\n\n const parsedUrl = typeof httpUrl === 'string' ? parseUrl(httpUrl) : undefined;\n const url = parsedUrl ? getSanitizedUrlString(parsedUrl) : undefined;\n const query = parsedUrl && parsedUrl.search ? parsedUrl.search : undefined;\n const fragment = parsedUrl && parsedUrl.hash ? parsedUrl.hash : undefined;\n\n if (typeof httpRoute === 'string') {\n return { urlPath: httpRoute, url, query, fragment, hasRoute: true };\n }\n\n if (kind === SpanKind.SERVER && typeof httpTarget === 'string') {\n return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };\n }\n\n if (parsedUrl) {\n return { urlPath: url, url, query, fragment, hasRoute: false };\n }\n\n // fall back to target even for client spans, if no URL is present\n if (typeof httpTarget === 'string') {\n return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };\n }\n\n return { urlPath: undefined, url, query, fragment, hasRoute: false };\n}\n"],"names":[],"mappings":";;;;;;AAiBA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"parseSpanDescription.js","sources":["../../../src/utils/parseSpanDescription.ts"],"sourcesContent":["import type { AttributeValue, Attributes } from '@opentelemetry/api';\nimport { SpanKind } from '@opentelemetry/api';\nimport { SemanticAttributes } from '@opentelemetry/semantic-conventions';\nimport type { TransactionSource } from '@sentry/types';\nimport { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '@sentry/utils';\n\nimport type { AbstractSpan } from '../types';\nimport { getSpanKind } from './getSpanKind';\nimport { spanHasAttributes, spanHasName } from './spanTypes';\n\ninterface SpanDescription {\n op: string | undefined;\n description: string;\n source: TransactionSource;\n data?: Record<string, string>;\n}\n\n/**\n * Extract better op/description from an otel span.\n *\n * Based on https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/7422ce2a06337f68a59b552b8c5a2ac125d6bae5/exporter/sentryexporter/sentry_exporter.go#L306\n */\nexport function parseSpanDescription(span: AbstractSpan): SpanDescription {\n const attributes = spanHasAttributes(span) ? span.attributes : {};\n const name = spanHasName(span) ? span.name : '<unknown>';\n\n // if http.method exists, this is an http request span\n const httpMethod = attributes[SemanticAttributes.HTTP_METHOD];\n if (httpMethod) {\n return descriptionForHttpMethod({ attributes, name, kind: getSpanKind(span) }, httpMethod);\n }\n\n // If db.type exists then this is a database call span.\n const dbSystem = attributes[SemanticAttributes.DB_SYSTEM];\n if (dbSystem) {\n return descriptionForDbSystem({ attributes, name });\n }\n\n // If rpc.service exists then this is a rpc call span.\n const rpcService = attributes[SemanticAttributes.RPC_SERVICE];\n if (rpcService) {\n return {\n op: 'rpc',\n description: name,\n source: 'route',\n };\n }\n\n // If messaging.system exists then this is a messaging system span.\n const messagingSystem = attributes[SemanticAttributes.MESSAGING_SYSTEM];\n if (messagingSystem) {\n return {\n op: 'message',\n description: name,\n source: 'route',\n };\n }\n\n // If faas.trigger exists then this is a function as a service span.\n const faasTrigger = attributes[SemanticAttributes.FAAS_TRIGGER];\n if (faasTrigger) {\n return { op: faasTrigger.toString(), description: name, source: 'route' };\n }\n\n return { op: undefined, description: name, source: 'custom' };\n}\n\nfunction descriptionForDbSystem({ attributes, name }: { attributes: Attributes; name: string }): SpanDescription {\n // Use DB statement (Ex \"SELECT * FROM table\") if possible as description.\n const statement = attributes[SemanticAttributes.DB_STATEMENT];\n\n const description = statement ? statement.toString() : name;\n\n return { op: 'db', description, source: 'task' };\n}\n\n/** Only exported for tests. */\nexport function descriptionForHttpMethod(\n { name, kind, attributes }: { name: string; attributes: Attributes; kind: SpanKind },\n httpMethod: AttributeValue,\n): SpanDescription {\n const opParts = ['http'];\n\n switch (kind) {\n case SpanKind.CLIENT:\n opParts.push('client');\n break;\n case SpanKind.SERVER:\n opParts.push('server');\n break;\n }\n\n const { urlPath, url, query, fragment, hasRoute } = getSanitizedUrl(attributes, kind);\n\n if (!urlPath) {\n return { op: opParts.join('.'), description: name, source: 'custom' };\n }\n\n // Ex. description=\"GET /api/users\".\n const description = `${httpMethod} ${urlPath}`;\n\n // If `httpPath` is a root path, then we can categorize the transaction source as route.\n const source: TransactionSource = hasRoute || urlPath === '/' ? 'route' : 'url';\n\n const data: Record<string, string> = {};\n\n if (url) {\n data.url = url;\n }\n if (query) {\n data['http.query'] = query;\n }\n if (fragment) {\n data['http.fragment'] = fragment;\n }\n\n return {\n op: opParts.join('.'),\n description,\n source,\n data,\n };\n}\n\n/** Exported for tests only */\nexport function getSanitizedUrl(\n attributes: Attributes,\n kind: SpanKind,\n): {\n url: string | undefined;\n urlPath: string | undefined;\n query: string | undefined;\n fragment: string | undefined;\n hasRoute: boolean;\n} {\n // This is the relative path of the URL, e.g. /sub\n const httpTarget = attributes[SemanticAttributes.HTTP_TARGET];\n // This is the full URL, including host & query params etc., e.g. https://example.com/sub?foo=bar\n const httpUrl = attributes[SemanticAttributes.HTTP_URL];\n // This is the normalized route name - may not always be available!\n const httpRoute = attributes[SemanticAttributes.HTTP_ROUTE];\n\n const parsedUrl = typeof httpUrl === 'string' ? parseUrl(httpUrl) : undefined;\n const url = parsedUrl ? getSanitizedUrlString(parsedUrl) : undefined;\n const query = parsedUrl && parsedUrl.search ? parsedUrl.search : undefined;\n const fragment = parsedUrl && parsedUrl.hash ? parsedUrl.hash : undefined;\n\n if (typeof httpRoute === 'string') {\n return { urlPath: httpRoute, url, query, fragment, hasRoute: true };\n }\n\n if (kind === SpanKind.SERVER && typeof httpTarget === 'string') {\n return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };\n }\n\n if (parsedUrl) {\n return { urlPath: url, url, query, fragment, hasRoute: false };\n }\n\n // fall back to target even for client spans, if no URL is present\n if (typeof httpTarget === 'string') {\n return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };\n }\n\n return { urlPath: undefined, url, query, fragment, hasRoute: false };\n}\n"],"names":[],"mapp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|
|
1
|
-
{"version":3,"file":"spanData.js","sources":["../../../src/utils/spanData.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { Hub, Scope, TransactionMetadata } from '@sentry/types';\n\nimport type { AbstractSpan } from '../types';\n\n// We store the parent span, scope & metadata in separate weakmaps, so we can access them for a given span\n// This way we can enhance the data that an OTEL Span natively gives us\n// and since we are using weakmaps, we do not need to clean up after ourselves\nconst SpanScope = new WeakMap<AbstractSpan, Scope>();\nconst SpanFinishScope = new WeakMap<AbstractSpan, Scope>();\nconst SpanHub = new WeakMap<AbstractSpan, Hub>();\nconst SpanParent = new WeakMap<AbstractSpan, Span>();\nconst SpanMetadata = new WeakMap<AbstractSpan, Partial<TransactionMetadata>>();\n\n/** Set the Sentry scope on an OTEL span. */\nexport function setSpanScope(span: AbstractSpan, scope: Scope): void {\n SpanScope.set(span, scope);\n}\n\n/** Get the Sentry scope of an OTEL span. */\nexport function getSpanScope(span: AbstractSpan): Scope | undefined {\n return SpanScope.get(span);\n}\n\n/** Set the Sentry hub on an OTEL span. */\nexport function setSpanHub(span: AbstractSpan, hub: Hub): void {\n SpanHub.set(span, hub);\n}\n\n/** Get the Sentry hub of an OTEL span. */\nexport function getSpanHub(span: AbstractSpan): Hub | undefined {\n return SpanHub.get(span);\n}\n\n/** Set the parent OTEL span on an OTEL span. */\nexport function setSpanParent(span: AbstractSpan, parentSpan: Span): void {\n SpanParent.set(span, parentSpan);\n}\n\n/** Get the parent OTEL span of an OTEL span. */\nexport function getSpanParent(span: AbstractSpan): Span | undefined {\n return SpanParent.get(span);\n}\n\n/** Set metadata for an OTEL span. */\nexport function setSpanMetadata(span: AbstractSpan, metadata: Partial<TransactionMetadata>): void {\n SpanMetadata.set(span, metadata);\n}\n\n/** Get metadata for an OTEL span. */\nexport function getSpanMetadata(span: AbstractSpan): Partial<TransactionMetadata> | undefined {\n return SpanMetadata.get(span);\n}\n\n/** Set the Sentry scope to be used for finishing a given OTEL span. */\nexport function setSpanFinishScope(span: AbstractSpan, scope: Scope): void {\n SpanFinishScope.set(span, scope);\n}\n\n/** Get the Sentry scope to use for finishing an OTEL span. */\nexport function getSpanFinishScope(span: AbstractSpan): Scope | undefined {\n return SpanFinishScope.get(span);\n}\n"],"names":[],"mappings":"AAKA;AACA;AACA;AACA,
|
|
1
|
+
{"version":3,"file":"spanData.js","sources":["../../../src/utils/spanData.ts"],"sourcesContent":["import type { Span } from '@opentelemetry/api';\nimport type { Hub, Scope, TransactionMetadata } from '@sentry/types';\n\nimport type { AbstractSpan } from '../types';\n\n// We store the parent span, scope & metadata in separate weakmaps, so we can access them for a given span\n// This way we can enhance the data that an OTEL Span natively gives us\n// and since we are using weakmaps, we do not need to clean up after ourselves\nconst SpanScope = new WeakMap<AbstractSpan, Scope>();\nconst SpanFinishScope = new WeakMap<AbstractSpan, Scope>();\nconst SpanHub = new WeakMap<AbstractSpan, Hub>();\nconst SpanParent = new WeakMap<AbstractSpan, Span>();\nconst SpanMetadata = new WeakMap<AbstractSpan, Partial<TransactionMetadata>>();\n\n/** Set the Sentry scope on an OTEL span. */\nexport function setSpanScope(span: AbstractSpan, scope: Scope): void {\n SpanScope.set(span, scope);\n}\n\n/** Get the Sentry scope of an OTEL span. */\nexport function getSpanScope(span: AbstractSpan): Scope | undefined {\n return SpanScope.get(span);\n}\n\n/** Set the Sentry hub on an OTEL span. */\nexport function setSpanHub(span: AbstractSpan, hub: Hub): void {\n SpanHub.set(span, hub);\n}\n\n/** Get the Sentry hub of an OTEL span. */\nexport function getSpanHub(span: AbstractSpan): Hub | undefined {\n return SpanHub.get(span);\n}\n\n/** Set the parent OTEL span on an OTEL span. */\nexport function setSpanParent(span: AbstractSpan, parentSpan: Span): void {\n SpanParent.set(span, parentSpan);\n}\n\n/** Get the parent OTEL span of an OTEL span. */\nexport function getSpanParent(span: AbstractSpan): Span | undefined {\n return SpanParent.get(span);\n}\n\n/** Set metadata for an OTEL span. */\nexport function setSpanMetadata(span: AbstractSpan, metadata: Partial<TransactionMetadata>): void {\n SpanMetadata.set(span, metadata);\n}\n\n/** Get metadata for an OTEL span. */\nexport function getSpanMetadata(span: AbstractSpan): Partial<TransactionMetadata> | undefined {\n return SpanMetadata.get(span);\n}\n\n/** Set the Sentry scope to be used for finishing a given OTEL span. */\nexport function setSpanFinishScope(span: AbstractSpan, scope: Scope): void {\n SpanFinishScope.set(span, scope);\n}\n\n/** Get the Sentry scope to use for finishing an OTEL span. */\nexport function getSpanFinishScope(span: AbstractSpan): Scope | undefined {\n return SpanFinishScope.get(span);\n}\n"],"names":[],"mappings":"AAKA;AACA;AACA;AACA,MAAM,SAAU,GAAE,IAAI,OAAO,EAAuB,CAAA;AACpD,MAAM,eAAgB,GAAE,IAAI,OAAO,EAAuB,CAAA;AAC1D,MAAM,OAAQ,GAAE,IAAI,OAAO,EAAqB,CAAA;AAChD,MAAM,UAAW,GAAE,IAAI,OAAO,EAAsB,CAAA;AACpD,MAAM,YAAa,GAAE,IAAI,OAAO,EAA8C,CAAA;AAC9E;AACA;AACO,SAAS,YAAY,CAAC,IAAI,EAAgB,KAAK,EAAe;AACrE,EAAE,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAC5B,CAAA;AACA;AACA;AACO,SAAS,YAAY,CAAC,IAAI,EAAmC;AACpE,EAAE,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC5B,CAAA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAgB,GAAG,EAAa;AAC/D,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;AACxB,CAAA;AACA;AACA;AACO,SAAS,UAAU,CAAC,IAAI,EAAiC;AAChE,EAAE,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC1B,CAAA;AACA;AACA;AACO,SAAS,aAAa,CAAC,IAAI,EAAgB,UAAU,EAAc;AAC1E,EAAE,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;AAClC,CAAA;AACA;AACA;AACO,SAAS,aAAa,CAAC,IAAI,EAAkC;AACpE,EAAE,OAAO,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC7B,CAAA;AACA;AACA;AACO,SAAS,eAAe,CAAC,IAAI,EAAgB,QAAQ,EAAsC;AAClG,EAAE,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AAClC,CAAA;AACA;AACA;AACO,SAAS,eAAe,CAAC,IAAI,EAA0D;AAC9F,EAAE,OAAO,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAC/B,CAAA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,IAAI,EAAgB,KAAK,EAAe;AAC3E,EAAE,eAAe,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AAClC,CAAA;AACA;AACA;AACO,SAAS,kBAAkB,CAAC,IAAI,EAAmC;AAC1E,EAAE,OAAO,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AAClC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanTypes.js","sources":["../../../src/utils/spanTypes.ts"],"sourcesContent":["import type { SpanKind, SpanStatus } from '@opentelemetry/api';\nimport type { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\n\nimport type { AbstractSpan } from '../types';\n\n/**\n * Check if a given span has attributes.\n * This is necessary because the base `Span` type does not have attributes,\n * so in places where we are passed a generic span, we need to check if we want to access them.\n */\nexport function spanHasAttributes<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { attributes: ReadableSpan['attributes'] } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.attributes && typeof castSpan.attributes === 'object';\n}\n\n/**\n * Check if a given span has a kind.\n * This is necessary because the base `Span` type does not have a kind,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasKind<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & { kind: SpanKind } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.kind;\n}\n\n/**\n * Check if a given span has a status.\n * This is necessary because the base `Span` type does not have a status,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasStatus<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { status: SpanStatus } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.status;\n}\n\n/**\n * Check if a given span has a name.\n * This is necessary because the base `Span` type does not have a name,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasName<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & { name: string } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.name;\n}\n\n/**\n * Check if a given span has a kind.\n * This is necessary because the base `Span` type does not have a kind,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasParentId<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { parentSpanId: string } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.parentSpanId;\n}\n\n/**\n * Check if a given span has events.\n * This is necessary because the base `Span` type does not have events,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasEvents<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { events: TimedEvent[] } {\n const castSpan = span as ReadableSpan;\n return Array.isArray(castSpan.events);\n}\n"],"names":[],"mappings":"AAKA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"file":"spanTypes.js","sources":["../../../src/utils/spanTypes.ts"],"sourcesContent":["import type { SpanKind, SpanStatus } from '@opentelemetry/api';\nimport type { ReadableSpan, TimedEvent } from '@opentelemetry/sdk-trace-base';\n\nimport type { AbstractSpan } from '../types';\n\n/**\n * Check if a given span has attributes.\n * This is necessary because the base `Span` type does not have attributes,\n * so in places where we are passed a generic span, we need to check if we want to access them.\n */\nexport function spanHasAttributes<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { attributes: ReadableSpan['attributes'] } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.attributes && typeof castSpan.attributes === 'object';\n}\n\n/**\n * Check if a given span has a kind.\n * This is necessary because the base `Span` type does not have a kind,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasKind<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & { kind: SpanKind } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.kind;\n}\n\n/**\n * Check if a given span has a status.\n * This is necessary because the base `Span` type does not have a status,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasStatus<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { status: SpanStatus } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.status;\n}\n\n/**\n * Check if a given span has a name.\n * This is necessary because the base `Span` type does not have a name,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasName<SpanType extends AbstractSpan>(span: SpanType): span is SpanType & { name: string } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.name;\n}\n\n/**\n * Check if a given span has a kind.\n * This is necessary because the base `Span` type does not have a kind,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasParentId<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { parentSpanId: string } {\n const castSpan = span as ReadableSpan;\n return !!castSpan.parentSpanId;\n}\n\n/**\n * Check if a given span has events.\n * This is necessary because the base `Span` type does not have events,\n * so in places where we are passed a generic span, we need to check if we want to access it.\n */\nexport function spanHasEvents<SpanType extends AbstractSpan>(\n span: SpanType,\n): span is SpanType & { events: TimedEvent[] } {\n const castSpan = span as ReadableSpan;\n return Array.isArray(castSpan.events);\n}\n"],"names":[],"mappings":"AAKA;AACA;AACA;AACA;AACA;AACO,SAAS,iBAAiB;AACjC,EAAE,IAAI;AACN,EAAiE;AACjE,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,UAAA,IAAc,OAAO,QAAQ,CAAC,UAAW,KAAI,QAAQ,CAAA;AACzE,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAgC,IAAI,EAAmD;AAClH,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAA;AACxB,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,IAAI;AACN,EAA6C;AAC7C,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAA;AAC1B,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAgC,IAAI,EAAiD;AAChH,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAA;AACxB,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,eAAe;AAC/B,EAAE,IAAI;AACN,EAA+C;AAC/C,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAA;AAChC,CAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa;AAC7B,EAAE,IAAI;AACN,EAA+C;AAC/C,EAAE,MAAM,QAAS,GAAE,IAAK,EAAA;AACxB,EAAE,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACvC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/opentelemetry",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.91.0",
|
|
4
4
|
"description": "Official Sentry utilities for OpenTelemetry",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/opentelemetry",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@sentry/core": "7.
|
|
27
|
-
"@sentry/types": "7.
|
|
28
|
-
"@sentry/utils": "7.
|
|
26
|
+
"@sentry/core": "7.91.0",
|
|
27
|
+
"@sentry/types": "7.91.0",
|
|
28
|
+
"@sentry/utils": "7.91.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@opentelemetry/api": "^1.0.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/custom/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAkB,MAAM,EAAoB,MAAM,eAAe,CAAC;AAE9E,OAAO,KAAK,EAAE,mBAAmB,IAAI,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAOpF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,gBAAgB,SAAS,KACvB,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EAC7B,uBAAuB,SAAS,KAC9B,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,4BAA4B,EAC5D,WAAW,EAAE,gBAAgB,GAAG,uBAAuB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/custom/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAS,MAAM,cAAc,CAAC;AAEtD,OAAO,KAAK,EAAkB,MAAM,EAAoB,MAAM,eAAe,CAAC;AAE9E,OAAO,KAAK,EAAE,mBAAmB,IAAI,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAOpF;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,gBAAgB,SAAS,KACvB,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,EAC7B,uBAAuB,SAAS,KAC9B,GAAG,IAAI,EAAE,GAAG,EAAE,KACX,MAAM,GAAG,UAAU,CAAC,GAAG,CAAC,GAAG,4BAA4B,EAC5D,WAAW,EAAE,gBAAgB,GAAG,uBAAuB,CA4DxD"}
|
package/types/custom/scope.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Span } from '@opentelemetry/api';
|
|
2
2
|
import { Scope } from '@sentry/core';
|
|
3
|
-
import type { Breadcrumb, Span as SentrySpan } from '@sentry/types';
|
|
3
|
+
import type { Breadcrumb, ScopeData, Span as SentrySpan } from '@sentry/types';
|
|
4
4
|
/** A fork of the classic scope with some otel specific stuff. */
|
|
5
5
|
export declare class OpenTelemetryScope extends Scope {
|
|
6
6
|
/**
|
|
@@ -30,6 +30,8 @@ export declare class OpenTelemetryScope extends Scope {
|
|
|
30
30
|
* @inheritDoc
|
|
31
31
|
*/
|
|
32
32
|
addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
|
|
33
|
+
/** @inheritDoc */
|
|
34
|
+
getScopeData(): ScopeData;
|
|
33
35
|
/** Add a breadcrumb to this scope. */
|
|
34
36
|
protected _addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
|
|
35
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/custom/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAiB,IAAI,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../../src/custom/scope.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAiB,IAAI,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AAU9F,iEAAiE;AACjE,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C;;;OAGG;IACI,UAAU,EAAE,IAAI,GAAG,SAAS,CAAC;IAEpC;;OAEG;WACW,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,GAAG,KAAK;IAIzC;;OAEG;IACI,KAAK,IAAI,kBAAkB;IAqBlC;;;OAGG;IACI,OAAO,IAAI,SAAS;IAM3B;;;OAGG;IACI,OAAO,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAMvC;;OAEG;IACI,aAAa,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAiB3E,kBAAkB;IACX,YAAY,IAAI,SAAS;IAQhC,sCAAsC;IACtC,SAAS,CAAC,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAI/E;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,UAAU,EAAE;CAO1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spanExporter.d.ts","sourceRoot":"","sources":["../../src/spanExporter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAqBhF;;GAEG;AACH,qBAAa,kBAAmB,YAAW,YAAY;IACrD,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,QAAQ,CAAU;;IAO1B,kBAAkB;IACX,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,cAAc,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,GAAG,IAAI;IAoC1F,kBAAkB;IACX,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAMhC,kBAAkB;IACL,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGzC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Span } from '@opentelemetry/api';
|
|
2
2
|
import { Scope } from '@sentry/core';
|
|
3
|
-
import { Breadcrumb, Span as SentrySpan } from '@sentry/types';
|
|
3
|
+
import { Breadcrumb, ScopeData, Span as SentrySpan } from '@sentry/types';
|
|
4
4
|
/** A fork of the classic scope with some otel specific stuff. */
|
|
5
5
|
export declare class OpenTelemetryScope extends Scope {
|
|
6
6
|
/**
|
|
@@ -30,6 +30,8 @@ export declare class OpenTelemetryScope extends Scope {
|
|
|
30
30
|
* @inheritDoc
|
|
31
31
|
*/
|
|
32
32
|
addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
|
|
33
|
+
/** @inheritDoc */
|
|
34
|
+
getScopeData(): ScopeData;
|
|
33
35
|
/** Add a breadcrumb to this scope. */
|
|
34
36
|
protected _addBreadcrumb(breadcrumb: Breadcrumb, maxBreadcrumbs?: number): this;
|
|
35
37
|
/**
|