diff --git a/packages/opentelemetry/src/index.ts b/packages/opentelemetry/src/index.ts index 635bfab9852f..4419d814b139 100644 --- a/packages/opentelemetry/src/index.ts +++ b/packages/opentelemetry/src/index.ts @@ -6,10 +6,7 @@ export type { OpenTelemetryClient } from './types'; export { wrapClientClass } from './custom/client'; export { getSpanKind } from './utils/getSpanKind'; -export { - getSpanParent, - getSpanScopes, -} from './utils/spanData'; +export { getSpanScopes } from './utils/spanData'; export { getScopesFromContext } from './utils/contextData'; diff --git a/packages/opentelemetry/src/sampler.ts b/packages/opentelemetry/src/sampler.ts index 805824834add..2b715eedd705 100644 --- a/packages/opentelemetry/src/sampler.ts +++ b/packages/opentelemetry/src/sampler.ts @@ -9,7 +9,6 @@ import { isNaN, logger } from '@sentry/utils'; import { DEBUG_BUILD } from './debug-build'; import { getPropagationContextFromSpanContext } from './propagator'; -import { InternalSentrySemanticAttributes } from './semanticAttributes'; import { setIsSetup } from './utils/setupCheck'; /** @@ -69,10 +68,6 @@ export class SentrySampler implements Sampler { [SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]: Number(sampleRate), }; - if (typeof parentSampled === 'boolean') { - attributes[InternalSentrySemanticAttributes.PARENT_SAMPLED] = parentSampled; - } - // Since this is coming from the user (or from a function provided by the user), who knows what we might get. (The // only valid values are booleans or numbers between 0 and 1.) if (!isValidSampleRate(sampleRate)) { diff --git a/packages/opentelemetry/src/semanticAttributes.ts b/packages/opentelemetry/src/semanticAttributes.ts index 8f61318a3ecc..80a80f87a666 100644 --- a/packages/opentelemetry/src/semanticAttributes.ts +++ b/packages/opentelemetry/src/semanticAttributes.ts @@ -1,7 +1,2 @@ -/** - * These are internal and are not supposed to be used/depended on by external parties. - * No guarantees apply to these attributes, and the may change/disappear at any time. - */ -export const InternalSentrySemanticAttributes = { - PARENT_SAMPLED: 'sentry.parentSampled', -} as const; +/** If this attribute is true, it means that the parent is a remote span. */ +export const SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = 'sentry.parentIsRemote'; diff --git a/packages/opentelemetry/src/spanExporter.ts b/packages/opentelemetry/src/spanExporter.ts index 3917e2b91629..58f6ba53303e 100644 --- a/packages/opentelemetry/src/spanExporter.ts +++ b/packages/opentelemetry/src/spanExporter.ts @@ -16,7 +16,7 @@ import type { SpanJSON, SpanOrigin, TraceContext, TransactionEvent, TransactionS import { dropUndefinedKeys, logger } from '@sentry/utils'; import { DEBUG_BUILD } from './debug-build'; -import { InternalSentrySemanticAttributes } from './semanticAttributes'; +import { SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE } from './semanticAttributes'; import { convertOtelTimeToSeconds } from './utils/convertOtelTimeToSeconds'; import { getDynamicSamplingContextFromSpan } from './utils/dynamicSamplingContext'; import { getRequestSpanData } from './utils/getRequestSpanData'; @@ -297,8 +297,8 @@ function removeSentryAttributes(data: Record): Record(); -const SpanParent = new WeakMap(); - -/** Set the parent OTEL span on an OTEL span. */ -export function setSpanParent(span: AbstractSpan, parentSpan: Span): void { - SpanParent.set(span, parentSpan); -} - -/** Get the parent OTEL span of an OTEL span. */ -export function getSpanParent(span: AbstractSpan): Span | undefined { - return SpanParent.get(span); -} /** * Set the Sentry scope to be used for finishing a given OTEL span.