@sentry/core
Advanced tools
| // This file is a compatibility shim for TypeScript compilers that do not | ||
| // support the package.json `exports` field for resolving subpath exports. | ||
| // Note: `typesVersions` in package.json may redirect this to the downleveled variant. | ||
| export * from './build/types/browser'; |
| // This file is a compatibility shim for TypeScript compilers that do not | ||
| // support the package.json `exports` field for resolving subpath exports. | ||
| // Note: `typesVersions` in package.json may redirect this to the downleveled variant. | ||
| export * from './build/types/server'; |
@@ -58,9 +58,9 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
| /** The user ID (gated by sendDefaultPii) */ | ||
| /** The user ID */ | ||
| const SEMANTIC_ATTRIBUTE_USER_ID = 'user.id'; | ||
| /** The user email (gated by sendDefaultPii) */ | ||
| /** The user email */ | ||
| const SEMANTIC_ATTRIBUTE_USER_EMAIL = 'user.email'; | ||
| /** The user IP address (gated by sendDefaultPii) */ | ||
| /** The user IP address */ | ||
| const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = 'user.ip_address'; | ||
| /** The user username (gated by sendDefaultPii) */ | ||
| /** The user username */ | ||
| const SEMANTIC_ATTRIBUTE_USER_USERNAME = 'user.name'; | ||
@@ -67,0 +67,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"semanticAttributes.js","sources":["../../src/semanticAttributes.ts"],"sourcesContent":["/**\n * Use this attribute to represent the source of a span name.\n * Must be one of: custom, url, route, view, component, task\n * TODO(v11): rename this to sentry.span.source'\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Attributes that holds the sample rate that was locally applied to a span.\n * If this attribute is not defined, it means that the span inherited a sampling decision.\n *\n * NOTE: Is only defined on root spans.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Attribute holding the sample rate of the previous trace.\n * This is used to sample consistently across subsequent traces in the browser SDK.\n *\n * Note: Only defined on root spans, if opted into consistent sampling\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = 'sentry.previous_trace_sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/** The reason why an idle span finished. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason';\n\n/** The unit of a measurement, which may be stored as a TimedEvent. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit';\n\n/** The value of a measurement, which may be stored as a TimedEvent. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value';\n\n/** The release version of the application */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = 'sentry.release';\n/** The environment name (e.g., \"production\", \"staging\", \"development\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = 'sentry.environment';\n/** The segment name (e.g., \"GET /users\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = 'sentry.segment.name';\n/** The id of the segment that this span belongs to. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = 'sentry.segment.id';\n/** The name of the Sentry SDK (e.g., \"sentry.php\", \"sentry.javascript\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = 'sentry.sdk.name';\n/** The version of the Sentry SDK */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = 'sentry.sdk.version';\n\n/** The user ID (gated by sendDefaultPii) */\nexport const SEMANTIC_ATTRIBUTE_USER_ID = 'user.id';\n/** The user email (gated by sendDefaultPii) */\nexport const SEMANTIC_ATTRIBUTE_USER_EMAIL = 'user.email';\n/** The user IP address (gated by sendDefaultPii) */\nexport const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = 'user.ip_address';\n/** The user username (gated by sendDefaultPii) */\nexport const SEMANTIC_ATTRIBUTE_USER_USERNAME = 'user.name';\n\n/**\n * A custom span name set by users guaranteed to be taken over any automatically\n * inferred name. This attribute is removed before the span is sent.\n *\n * @internal only meant for internal SDK usage\n * @hidden\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = 'sentry.custom_span_name';\n\n/**\n * The id of the profile that this span occurred in.\n */\nexport const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id';\n\nexport const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size';\n\n/** TODO: Remove these once we update to latest semantic conventions */\nexport const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = 'http.request.method';\nexport const SEMANTIC_ATTRIBUTE_URL_FULL = 'url.full';\n\n/**\n * A span link attribute to mark the link as a special span link.\n *\n * Known values:\n * - `previous_trace`: The span links to the frontend root span of the previous trace.\n * - `next_trace`: The span links to the frontend root span of the next trace. (Not set by the SDK)\n *\n * Other values may be set as appropriate.\n * @see https://develop.sentry.dev/sdk/telemetry/traces/span-links/#link-types\n */\nexport const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = 'sentry.link.type';\n\n/**\n * =============================================================================\n * GEN AI ATTRIBUTES\n * Based on OpenTelemetry Semantic Conventions for Generative AI\n * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/\n * =============================================================================\n */\n\n/**\n * The conversation ID for linking messages across API calls.\n * For OpenAI Assistants API: thread_id\n * For LangGraph: configurable.thread_id\n */\nexport const GEN_AI_CONVERSATION_ID_ATTRIBUTE = 'gen_ai.conversation.id';\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,qCAAA,GAAwC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,oDAAA,GAAuD;;AAEpE;AACA;AACA;AACO,MAAM,4BAAA,GAA+B;;AAE5C;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACO,MAAM,iDAAA,GAAoD;;AAEjE;AACO,MAAM,0CAAA,GAA6C;;AAE1D;AACO,MAAM,2CAAA,GAA8C;;AAE3D;AACO,MAAM,iCAAA,GAAoC;AACjD;AACO,MAAM,qCAAA,GAAwC;AACrD;AACO,MAAM,sCAAA,GAAyC;AACtD;AACO,MAAM,oCAAA,GAAuC;AACpD;AACO,MAAM,kCAAA,GAAqC;AAClD;AACO,MAAM,qCAAA,GAAwC;;AAErD;AACO,MAAM,0BAAA,GAA6B;AAC1C;AACO,MAAM,6BAAA,GAAgC;AAC7C;AACO,MAAM,kCAAA,GAAqC;AAClD;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,0CAAA,GAA6C;;AAE1D;AACA;AACA;AACO,MAAM,6BAAA,GAAgC;;AAEtC,MAAM,iCAAA,GAAoC;;AAE1C,MAAM,4BAAA,GAA+B;;AAErC,MAAM,4BAAA,GAA+B;;AAErC,MAAM,kCAAA,GAAqC;;AAElD;AACO,MAAM,sCAAA,GAAyC;AAC/C,MAAM,2BAAA,GAA8B;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iCAAA,GAAoC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} | ||
| {"version":3,"file":"semanticAttributes.js","sources":["../../src/semanticAttributes.ts"],"sourcesContent":["/**\n * Use this attribute to represent the source of a span name.\n * Must be one of: custom, url, route, view, component, task\n * TODO(v11): rename this to sentry.span.source'\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Attributes that holds the sample rate that was locally applied to a span.\n * If this attribute is not defined, it means that the span inherited a sampling decision.\n *\n * NOTE: Is only defined on root spans.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Attribute holding the sample rate of the previous trace.\n * This is used to sample consistently across subsequent traces in the browser SDK.\n *\n * Note: Only defined on root spans, if opted into consistent sampling\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = 'sentry.previous_trace_sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/** The reason why an idle span finished. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason';\n\n/** The unit of a measurement, which may be stored as a TimedEvent. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit';\n\n/** The value of a measurement, which may be stored as a TimedEvent. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value';\n\n/** The release version of the application */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = 'sentry.release';\n/** The environment name (e.g., \"production\", \"staging\", \"development\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = 'sentry.environment';\n/** The segment name (e.g., \"GET /users\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = 'sentry.segment.name';\n/** The id of the segment that this span belongs to. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = 'sentry.segment.id';\n/** The name of the Sentry SDK (e.g., \"sentry.php\", \"sentry.javascript\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = 'sentry.sdk.name';\n/** The version of the Sentry SDK */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = 'sentry.sdk.version';\n\n/** The user ID */\nexport const SEMANTIC_ATTRIBUTE_USER_ID = 'user.id';\n/** The user email */\nexport const SEMANTIC_ATTRIBUTE_USER_EMAIL = 'user.email';\n/** The user IP address */\nexport const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = 'user.ip_address';\n/** The user username */\nexport const SEMANTIC_ATTRIBUTE_USER_USERNAME = 'user.name';\n\n/**\n * A custom span name set by users guaranteed to be taken over any automatically\n * inferred name. This attribute is removed before the span is sent.\n *\n * @internal only meant for internal SDK usage\n * @hidden\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = 'sentry.custom_span_name';\n\n/**\n * The id of the profile that this span occurred in.\n */\nexport const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id';\n\nexport const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size';\n\n/** TODO: Remove these once we update to latest semantic conventions */\nexport const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = 'http.request.method';\nexport const SEMANTIC_ATTRIBUTE_URL_FULL = 'url.full';\n\n/**\n * A span link attribute to mark the link as a special span link.\n *\n * Known values:\n * - `previous_trace`: The span links to the frontend root span of the previous trace.\n * - `next_trace`: The span links to the frontend root span of the next trace. (Not set by the SDK)\n *\n * Other values may be set as appropriate.\n * @see https://develop.sentry.dev/sdk/telemetry/traces/span-links/#link-types\n */\nexport const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = 'sentry.link.type';\n\n/**\n * =============================================================================\n * GEN AI ATTRIBUTES\n * Based on OpenTelemetry Semantic Conventions for Generative AI\n * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/\n * =============================================================================\n */\n\n/**\n * The conversation ID for linking messages across API calls.\n * For OpenAI Assistants API: thread_id\n * For LangGraph: configurable.thread_id\n */\nexport const GEN_AI_CONVERSATION_ID_ATTRIBUTE = 'gen_ai.conversation.id';\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,qCAAA,GAAwC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,oDAAA,GAAuD;;AAEpE;AACA;AACA;AACO,MAAM,4BAAA,GAA+B;;AAE5C;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACO,MAAM,iDAAA,GAAoD;;AAEjE;AACO,MAAM,0CAAA,GAA6C;;AAE1D;AACO,MAAM,2CAAA,GAA8C;;AAE3D;AACO,MAAM,iCAAA,GAAoC;AACjD;AACO,MAAM,qCAAA,GAAwC;AACrD;AACO,MAAM,sCAAA,GAAyC;AACtD;AACO,MAAM,oCAAA,GAAuC;AACpD;AACO,MAAM,kCAAA,GAAqC;AAClD;AACO,MAAM,qCAAA,GAAwC;;AAErD;AACO,MAAM,0BAAA,GAA6B;AAC1C;AACO,MAAM,6BAAA,GAAgC;AAC7C;AACO,MAAM,kCAAA,GAAqC;AAClD;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,0CAAA,GAA6C;;AAE1D;AACA;AACA;AACO,MAAM,6BAAA,GAAgC;;AAEtC,MAAM,iCAAA,GAAoC;;AAE1C,MAAM,4BAAA,GAA+B;;AAErC,MAAM,4BAAA,GAA+B;;AAErC,MAAM,kCAAA,GAAqC;;AAElD;AACO,MAAM,sCAAA,GAAyC;AAC/C,MAAM,2BAAA,GAA8B;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iCAAA,GAAoC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} |
@@ -97,3 +97,3 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
| const sdk = client.getSdkMetadata(); | ||
| const { release, environment, sendDefaultPii } = client.getOptions(); | ||
| const { release, environment } = client.getOptions(); | ||
@@ -108,10 +108,6 @@ // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation) | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version, | ||
| ...(sendDefaultPii | ||
| ? { | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id, | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email, | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address, | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username, | ||
| } | ||
| : {}), | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id, | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email, | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address, | ||
| [semanticAttributes.SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username, | ||
| ...scopeData.attributes, | ||
@@ -118,0 +114,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"captureSpan.js","sources":["../../../../src/tracing/spans/captureSpan.ts"],"sourcesContent":["import type { RawAttributes } from '../../attributes';\nimport type { Client } from '../../client';\nimport type { ScopeData } from '../../scope';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n SEMANTIC_ATTRIBUTE_USER_EMAIL,\n SEMANTIC_ATTRIBUTE_USER_ID,\n SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,\n SEMANTIC_ATTRIBUTE_USER_USERNAME,\n} from '../../semanticAttributes';\nimport type { SerializedStreamedSpan, Span, StreamedSpanJSON } from '../../types-hoist/span';\nimport { getCombinedScopeData } from '../../utils/scopeData';\nimport { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '../../utils/url';\nimport {\n INTERNAL_getSegmentSpan,\n showSpanDropWarning,\n spanToStreamedSpanJSON,\n streamedSpanJsonToSerializedSpan,\n} from '../../utils/spanUtils';\nimport { getCapturedScopesOnSpan } from '../utils';\nimport { isStreamedBeforeSendSpanCallback } from './beforeSendSpan';\n\nexport type SerializedStreamedSpanWithSegmentSpan = SerializedStreamedSpan & {\n _segmentSpan: Span;\n};\n\n/**\n * Captures a span and returns a JSON representation to be enqueued for sending.\n *\n * IMPORTANT: This function converts the span to JSON immediately to avoid writing\n * to an already-ended OTel span instance (which is blocked by the OTel Span class).\n *\n * @returns the final serialized span with a reference to its segment span. This reference\n * is needed later on to compute the DSC for the span envelope.\n */\nexport function captureSpan(span: Span, client: Client): SerializedStreamedSpanWithSegmentSpan {\n // Convert to JSON FIRST - we cannot write to an already-ended span\n const spanJSON = spanToStreamedSpanJSON(span);\n\n const segmentSpan = INTERNAL_getSegmentSpan(span);\n const serializedSegmentSpan = spanToStreamedSpanJSON(segmentSpan);\n\n const { isolationScope: spanIsolationScope, scope: spanScope } = getCapturedScopesOnSpan(span);\n\n const finalScopeData = getCombinedScopeData(spanIsolationScope, spanScope);\n\n applyCommonSpanAttributes(spanJSON, serializedSegmentSpan, client, finalScopeData);\n\n // Backfill span data from OTel semantic conventions when not explicitly set.\n // OTel-originated spans don't have sentry.op, description, etc. — the non-streamed path\n // infers these in the SentrySpanExporter, but streamed spans skip the exporter entirely.\n // Access `kind` via duck-typing — OTel span objects have this property but it's not on Sentry's Span type.\n // This must run before all hooks and beforeSendSpan so that user callbacks can see and override inferred values.\n const spanKind = (span as { kind?: number }).kind;\n inferSpanDataFromOtelAttributes(spanJSON, spanKind);\n\n if (spanJSON.is_segment) {\n applyScopeToSegmentSpan(spanJSON, finalScopeData);\n // Allow hook subscribers to mutate the segment span JSON\n // This also invokes the `processSegmentSpan` hook of all integrations\n client.emit('processSegmentSpan', spanJSON);\n }\n\n // This allows hook subscribers to mutate the span JSON\n // This also invokes the `processSpan` hook of all integrations\n client.emit('processSpan', spanJSON);\n\n const { beforeSendSpan } = client.getOptions();\n const processedSpan =\n beforeSendSpan && isStreamedBeforeSendSpanCallback(beforeSendSpan)\n ? applyBeforeSendSpanCallback(spanJSON, beforeSendSpan)\n : spanJSON;\n\n // Backfill sentry.span.source from sentry.source. Only `sentry.span.source` is respected by Sentry.\n // TODO(v11): Remove this backfill once we renamed SEMANTIC_ATTRIBUTE_SENTRY_SOURCE to sentry.span.source\n const spanNameSource = processedSpan.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n if (spanNameSource) {\n safeSetSpanJSONAttributes(processedSpan, {\n // Purposefully not using a constant defined here like in other attributes:\n // This will be the name for SEMANTIC_ATTRIBUTE_SENTRY_SOURCE in v11\n 'sentry.span.source': spanNameSource,\n });\n }\n\n return {\n ...streamedSpanJsonToSerializedSpan(processedSpan),\n _segmentSpan: segmentSpan,\n };\n}\n\nfunction applyScopeToSegmentSpan(_segmentSpanJSON: StreamedSpanJSON, _scopeData: ScopeData): void {\n // TODO: Apply contexts data from auto instrumentation to segment span\n // This will follow in a separate PR\n}\n\n/**\n * Safely set attributes on a span JSON.\n * If an attribute already exists, it will not be overwritten.\n */\nexport function safeSetSpanJSONAttributes(\n spanJSON: StreamedSpanJSON,\n newAttributes: RawAttributes<Record<string, unknown>>,\n): void {\n const originalAttributes = spanJSON.attributes ?? (spanJSON.attributes = {});\n\n Object.entries(newAttributes).forEach(([key, value]) => {\n if (value != null && !(key in originalAttributes)) {\n originalAttributes[key] = value;\n }\n });\n}\n\nfunction applyCommonSpanAttributes(\n spanJSON: StreamedSpanJSON,\n serializedSegmentSpan: StreamedSpanJSON,\n client: Client,\n scopeData: ScopeData,\n): void {\n const sdk = client.getSdkMetadata();\n const { release, environment, sendDefaultPii } = client.getOptions();\n\n // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)\n safeSetSpanJSONAttributes(spanJSON, {\n [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,\n [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID]: serializedSegmentSpan.span_id,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,\n ...(sendDefaultPii\n ? {\n [SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id,\n [SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email,\n [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address,\n [SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username,\n }\n : {}),\n ...scopeData.attributes,\n });\n}\n\n/**\n * Apply a user-provided beforeSendSpan callback to a span JSON.\n */\nexport function applyBeforeSendSpanCallback(\n span: StreamedSpanJSON,\n beforeSendSpan: (span: StreamedSpanJSON) => StreamedSpanJSON,\n): StreamedSpanJSON {\n const modifedSpan = beforeSendSpan(span);\n if (!modifedSpan) {\n showSpanDropWarning();\n return span;\n }\n return modifedSpan;\n}\n\n// OTel SpanKind values (numeric to avoid importing from @opentelemetry/api)\nconst SPAN_KIND_SERVER = 1;\nconst SPAN_KIND_CLIENT = 2;\n\n/**\n * Infer and backfill span data from OTel semantic conventions.\n * This mirrors what the `SentrySpanExporter` does for non-streamed spans via `getSpanData`/`inferSpanData`.\n * Streamed spans skip the exporter, so we do the inference here during capture.\n *\n * Backfills: `sentry.op`, `sentry.source`, and `name` (description).\n * Uses `safeSetSpanJSONAttributes` so explicitly set attributes are never overwritten.\n */\n/** Exported only for tests. */\nexport function inferSpanDataFromOtelAttributes(spanJSON: StreamedSpanJSON, spanKind?: number): void {\n const attributes = spanJSON.attributes;\n if (!attributes) {\n return;\n }\n\n const httpMethod = attributes['http.request.method'] || attributes['http.method'];\n if (httpMethod) {\n inferHttpSpanData(spanJSON, attributes, spanKind, httpMethod);\n return;\n }\n\n const dbSystem = attributes['db.system.name'] || attributes['db.system'];\n const opIsCache =\n typeof attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'string' &&\n `${attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP]}`.startsWith('cache.');\n if (dbSystem && !opIsCache) {\n inferDbSpanData(spanJSON, attributes);\n return;\n }\n\n if (attributes['rpc.service']) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'rpc' });\n return;\n }\n\n if (attributes['messaging.system']) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'message' });\n return;\n }\n\n const faasTrigger = attributes['faas.trigger'];\n if (faasTrigger) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${faasTrigger}` });\n }\n}\n\nfunction inferHttpSpanData(\n spanJSON: StreamedSpanJSON,\n attributes: RawAttributes<Record<string, unknown>>,\n spanKind: number | undefined,\n httpMethod: unknown,\n): void {\n // Infer op: http.client, http.server, or just http\n const opParts = ['http'];\n if (spanKind === SPAN_KIND_CLIENT) {\n opParts.push('client');\n } else if (spanKind === SPAN_KIND_SERVER) {\n opParts.push('server');\n }\n if (attributes['sentry.http.prefetch']) {\n opParts.push('prefetch');\n }\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: opParts.join('.') });\n\n // If the user set a custom span name via updateSpanName(), apply it — OTel instrumentation\n // may have overwritten span.name after the user set it, so we restore from the attribute.\n const customName = attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n if (typeof customName === 'string') {\n spanJSON.name = customName;\n return;\n }\n\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') {\n return;\n }\n\n const httpRoute = attributes['http.route'];\n if (typeof httpRoute === 'string') {\n spanJSON.name = `${httpMethod} ${httpRoute}`;\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route' });\n } else {\n // Infer span name from URL attributes, matching the non-streamed exporter's behavior.\n // Only overwrite the name for OTel spans (known spanKind)\n if (spanKind === SPAN_KIND_CLIENT || spanKind === SPAN_KIND_SERVER) {\n const urlPath = getUrlPath(attributes, spanKind);\n if (urlPath) {\n spanJSON.name = `${httpMethod} ${urlPath}`;\n }\n }\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url' });\n }\n}\n\n/**\n * Extract a URL path from span attributes for use in the span name.\n * Mirrors the logic in the non-streamed exporter's `getSanitizedUrl`.\n */\nfunction getUrlPath(\n attributes: RawAttributes<Record<string, unknown>>,\n spanKind: number | undefined,\n): string | undefined {\n const httpUrl = attributes['http.url'] || attributes['url.full'];\n const httpTarget = attributes['http.target'];\n\n const parsedUrl = typeof httpUrl === 'string' ? parseUrl(httpUrl) : undefined;\n const sanitizedUrl = parsedUrl ? getSanitizedUrlString(parsedUrl) : undefined;\n\n // For server spans, prefer the relative target path\n if (spanKind === SPAN_KIND_SERVER && typeof httpTarget === 'string') {\n return stripUrlQueryAndFragment(httpTarget);\n }\n\n // For client spans (and others), use the full sanitized URL\n if (sanitizedUrl) {\n return sanitizedUrl;\n }\n\n // Fall back to target if no full URL is available\n if (typeof httpTarget === 'string') {\n return stripUrlQueryAndFragment(httpTarget);\n }\n\n return undefined;\n}\n\nfunction inferDbSpanData(spanJSON: StreamedSpanJSON, attributes: RawAttributes<Record<string, unknown>>): void {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db' });\n\n // If the user set a custom span name via updateSpanName(), apply it.\n const customName = attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n if (typeof customName === 'string') {\n spanJSON.name = customName;\n return;\n }\n\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') {\n return;\n }\n\n const statement = attributes['db.statement'];\n if (statement) {\n spanJSON.name = `${statement}`;\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'task' });\n }\n}\n"],"names":["spanToStreamedSpanJSON","INTERNAL_getSegmentSpan","getCapturedScopesOnSpan","getCombinedScopeData","beforeSendSpan","isStreamedBeforeSendSpanCallback","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","streamedSpanJsonToSerializedSpan","SEMANTIC_ATTRIBUTE_SENTRY_RELEASE","SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT","SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME","SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID","SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME","SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION","SEMANTIC_ATTRIBUTE_USER_ID","SEMANTIC_ATTRIBUTE_USER_EMAIL","SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS","SEMANTIC_ATTRIBUTE_USER_USERNAME","showSpanDropWarning","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME","parseUrl","getSanitizedUrlString","stripUrlQueryAndFragment"],"mappings":";;;;;;;;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,IAAI,EAAQ,MAAM,EAAiD;AAC/F;AACA,EAAE,MAAM,QAAA,GAAWA,gCAAsB,CAAC,IAAI,CAAC;;AAE/C,EAAE,MAAM,WAAA,GAAcC,iCAAuB,CAAC,IAAI,CAAC;AACnD,EAAE,MAAM,qBAAA,GAAwBD,gCAAsB,CAAC,WAAW,CAAC;;AAEnE,EAAE,MAAM,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAA,EAAU,GAAIE,6BAAuB,CAAC,IAAI,CAAC;;AAEhG,EAAE,MAAM,iBAAiBC,8BAAoB,CAAC,kBAAkB,EAAE,SAAS,CAAC;;AAE5E,EAAE,yBAAyB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,MAAM,EAAE,cAAc,CAAC;;AAEpF;AACA;AACA;AACA;AACA;AACA,EAAE,MAAM,QAAA,GAAW,CAAC,IAAA,GAA2B,IAAI;AACnD,EAAE,+BAA+B,CAAC,QAAQ,EAAE,QAAQ,CAAC;;AAErD,EAAE,IAAI,QAAQ,CAAC,UAAU,EAAE;AAE3B;AACA;AACA,IAAI,MAAM,CAAC,IAAI,CAAC,oBAA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AA,GAAA,UAAA,CAAAC,6DAAA,CAAA;AACA,EAAA,IAAA,OAAA,UAAA,KAAA,QAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,UAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,IAAA,UAAA,CAAAd,mDAAA,CAAA,KAAA,QAAA,EAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,MAAA,SAAA,GAAA,UAAA,CAAA,cAAA,CAAA;AACA,EAAA,IAAA,SAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,CAAA,EAAA,SAAA,CAAA,CAAA;AACA,IAAA,yBAAA,CAAA,QAAA,EAAA,EAAA,CAAAA,mDAAA,GAAA,MAAA,EAAA,CAAA;AACA,EAAA;AACA;;;;;;;"} | ||
| {"version":3,"file":"captureSpan.js","sources":["../../../../src/tracing/spans/captureSpan.ts"],"sourcesContent":["import type { RawAttributes } from '../../attributes';\nimport type { Client } from '../../client';\nimport type { ScopeData } from '../../scope';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n SEMANTIC_ATTRIBUTE_USER_EMAIL,\n SEMANTIC_ATTRIBUTE_USER_ID,\n SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,\n SEMANTIC_ATTRIBUTE_USER_USERNAME,\n} from '../../semanticAttributes';\nimport type { SerializedStreamedSpan, Span, StreamedSpanJSON } from '../../types-hoist/span';\nimport { getCombinedScopeData } from '../../utils/scopeData';\nimport { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '../../utils/url';\nimport {\n INTERNAL_getSegmentSpan,\n showSpanDropWarning,\n spanToStreamedSpanJSON,\n streamedSpanJsonToSerializedSpan,\n} from '../../utils/spanUtils';\nimport { getCapturedScopesOnSpan } from '../utils';\nimport { isStreamedBeforeSendSpanCallback } from './beforeSendSpan';\n\nexport type SerializedStreamedSpanWithSegmentSpan = SerializedStreamedSpan & {\n _segmentSpan: Span;\n};\n\n/**\n * Captures a span and returns a JSON representation to be enqueued for sending.\n *\n * IMPORTANT: This function converts the span to JSON immediately to avoid writing\n * to an already-ended OTel span instance (which is blocked by the OTel Span class).\n *\n * @returns the final serialized span with a reference to its segment span. This reference\n * is needed later on to compute the DSC for the span envelope.\n */\nexport function captureSpan(span: Span, client: Client): SerializedStreamedSpanWithSegmentSpan {\n // Convert to JSON FIRST - we cannot write to an already-ended span\n const spanJSON = spanToStreamedSpanJSON(span);\n\n const segmentSpan = INTERNAL_getSegmentSpan(span);\n const serializedSegmentSpan = spanToStreamedSpanJSON(segmentSpan);\n\n const { isolationScope: spanIsolationScope, scope: spanScope } = getCapturedScopesOnSpan(span);\n\n const finalScopeData = getCombinedScopeData(spanIsolationScope, spanScope);\n\n applyCommonSpanAttributes(spanJSON, serializedSegmentSpan, client, finalScopeData);\n\n // Backfill span data from OTel semantic conventions when not explicitly set.\n // OTel-originated spans don't have sentry.op, description, etc. — the non-streamed path\n // infers these in the SentrySpanExporter, but streamed spans skip the exporter entirely.\n // Access `kind` via duck-typing — OTel span objects have this property but it's not on Sentry's Span type.\n // This must run before all hooks and beforeSendSpan so that user callbacks can see and override inferred values.\n const spanKind = (span as { kind?: number }).kind;\n inferSpanDataFromOtelAttributes(spanJSON, spanKind);\n\n if (spanJSON.is_segment) {\n applyScopeToSegmentSpan(spanJSON, finalScopeData);\n // Allow hook subscribers to mutate the segment span JSON\n // This also invokes the `processSegmentSpan` hook of all integrations\n client.emit('processSegmentSpan', spanJSON);\n }\n\n // This allows hook subscribers to mutate the span JSON\n // This also invokes the `processSpan` hook of all integrations\n client.emit('processSpan', spanJSON);\n\n const { beforeSendSpan } = client.getOptions();\n const processedSpan =\n beforeSendSpan && isStreamedBeforeSendSpanCallback(beforeSendSpan)\n ? applyBeforeSendSpanCallback(spanJSON, beforeSendSpan)\n : spanJSON;\n\n // Backfill sentry.span.source from sentry.source. Only `sentry.span.source` is respected by Sentry.\n // TODO(v11): Remove this backfill once we renamed SEMANTIC_ATTRIBUTE_SENTRY_SOURCE to sentry.span.source\n const spanNameSource = processedSpan.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n if (spanNameSource) {\n safeSetSpanJSONAttributes(processedSpan, {\n // Purposefully not using a constant defined here like in other attributes:\n // This will be the name for SEMANTIC_ATTRIBUTE_SENTRY_SOURCE in v11\n 'sentry.span.source': spanNameSource,\n });\n }\n\n return {\n ...streamedSpanJsonToSerializedSpan(processedSpan),\n _segmentSpan: segmentSpan,\n };\n}\n\nfunction applyScopeToSegmentSpan(_segmentSpanJSON: StreamedSpanJSON, _scopeData: ScopeData): void {\n // TODO: Apply contexts data from auto instrumentation to segment span\n // This will follow in a separate PR\n}\n\n/**\n * Safely set attributes on a span JSON.\n * If an attribute already exists, it will not be overwritten.\n */\nexport function safeSetSpanJSONAttributes(\n spanJSON: StreamedSpanJSON,\n newAttributes: RawAttributes<Record<string, unknown>>,\n): void {\n const originalAttributes = spanJSON.attributes ?? (spanJSON.attributes = {});\n\n Object.entries(newAttributes).forEach(([key, value]) => {\n if (value != null && !(key in originalAttributes)) {\n originalAttributes[key] = value;\n }\n });\n}\n\nfunction applyCommonSpanAttributes(\n spanJSON: StreamedSpanJSON,\n serializedSegmentSpan: StreamedSpanJSON,\n client: Client,\n scopeData: ScopeData,\n): void {\n const sdk = client.getSdkMetadata();\n const { release, environment } = client.getOptions();\n\n // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)\n safeSetSpanJSONAttributes(spanJSON, {\n [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,\n [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID]: serializedSegmentSpan.span_id,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,\n [SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id,\n [SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email,\n [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address,\n [SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username,\n ...scopeData.attributes,\n });\n}\n\n/**\n * Apply a user-provided beforeSendSpan callback to a span JSON.\n */\nexport function applyBeforeSendSpanCallback(\n span: StreamedSpanJSON,\n beforeSendSpan: (span: StreamedSpanJSON) => StreamedSpanJSON,\n): StreamedSpanJSON {\n const modifedSpan = beforeSendSpan(span);\n if (!modifedSpan) {\n showSpanDropWarning();\n return span;\n }\n return modifedSpan;\n}\n\n// OTel SpanKind values (numeric to avoid importing from @opentelemetry/api)\nconst SPAN_KIND_SERVER = 1;\nconst SPAN_KIND_CLIENT = 2;\n\n/**\n * Infer and backfill span data from OTel semantic conventions.\n * This mirrors what the `SentrySpanExporter` does for non-streamed spans via `getSpanData`/`inferSpanData`.\n * Streamed spans skip the exporter, so we do the inference here during capture.\n *\n * Backfills: `sentry.op`, `sentry.source`, and `name` (description).\n * Uses `safeSetSpanJSONAttributes` so explicitly set attributes are never overwritten.\n */\n/** Exported only for tests. */\nexport function inferSpanDataFromOtelAttributes(spanJSON: StreamedSpanJSON, spanKind?: number): void {\n const attributes = spanJSON.attributes;\n if (!attributes) {\n return;\n }\n\n const httpMethod = attributes['http.request.method'] || attributes['http.method'];\n if (httpMethod) {\n inferHttpSpanData(spanJSON, attributes, spanKind, httpMethod);\n return;\n }\n\n const dbSystem = attributes['db.system.name'] || attributes['db.system'];\n const opIsCache =\n typeof attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'string' &&\n `${attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP]}`.startsWith('cache.');\n if (dbSystem && !opIsCache) {\n inferDbSpanData(spanJSON, attributes);\n return;\n }\n\n if (attributes['rpc.service']) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'rpc' });\n return;\n }\n\n if (attributes['messaging.system']) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'message' });\n return;\n }\n\n const faasTrigger = attributes['faas.trigger'];\n if (faasTrigger) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${faasTrigger}` });\n }\n}\n\nfunction inferHttpSpanData(\n spanJSON: StreamedSpanJSON,\n attributes: RawAttributes<Record<string, unknown>>,\n spanKind: number | undefined,\n httpMethod: unknown,\n): void {\n // Infer op: http.client, http.server, or just http\n const opParts = ['http'];\n if (spanKind === SPAN_KIND_CLIENT) {\n opParts.push('client');\n } else if (spanKind === SPAN_KIND_SERVER) {\n opParts.push('server');\n }\n if (attributes['sentry.http.prefetch']) {\n opParts.push('prefetch');\n }\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: opParts.join('.') });\n\n // If the user set a custom span name via updateSpanName(), apply it — OTel instrumentation\n // may have overwritten span.name after the user set it, so we restore from the attribute.\n const customName = attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n if (typeof customName === 'string') {\n spanJSON.name = customName;\n return;\n }\n\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') {\n return;\n }\n\n const httpRoute = attributes['http.route'];\n if (typeof httpRoute === 'string') {\n spanJSON.name = `${httpMethod} ${httpRoute}`;\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route' });\n } else {\n // Infer span name from URL attributes, matching the non-streamed exporter's behavior.\n // Only overwrite the name for OTel spans (known spanKind)\n if (spanKind === SPAN_KIND_CLIENT || spanKind === SPAN_KIND_SERVER) {\n const urlPath = getUrlPath(attributes, spanKind);\n if (urlPath) {\n spanJSON.name = `${httpMethod} ${urlPath}`;\n }\n }\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url' });\n }\n}\n\n/**\n * Extract a URL path from span attributes for use in the span name.\n * Mirrors the logic in the non-streamed exporter's `getSanitizedUrl`.\n */\nfunction getUrlPath(\n attributes: RawAttributes<Record<string, unknown>>,\n spanKind: number | undefined,\n): string | undefined {\n const httpUrl = attributes['http.url'] || attributes['url.full'];\n const httpTarget = attributes['http.target'];\n\n const parsedUrl = typeof httpUrl === 'string' ? parseUrl(httpUrl) : undefined;\n const sanitizedUrl = parsedUrl ? getSanitizedUrlString(parsedUrl) : undefined;\n\n // For server spans, prefer the relative target path\n if (spanKind === SPAN_KIND_SERVER && typeof httpTarget === 'string') {\n return stripUrlQueryAndFragment(httpTarget);\n }\n\n // For client spans (and others), use the full sanitized URL\n if (sanitizedUrl) {\n return sanitizedUrl;\n }\n\n // Fall back to target if no full URL is available\n if (typeof httpTarget === 'string') {\n return stripUrlQueryAndFragment(httpTarget);\n }\n\n return undefined;\n}\n\nfunction inferDbSpanData(spanJSON: StreamedSpanJSON, attributes: RawAttributes<Record<string, unknown>>): void {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db' });\n\n // If the user set a custom span name via updateSpanName(), apply it.\n const customName = attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n if (typeof customName === 'string') {\n spanJSON.name = customName;\n return;\n }\n\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') {\n return;\n }\n\n const statement = attributes['db.statement'];\n if (statement) {\n spanJSON.name = `${statement}`;\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'task' });\n }\n}\n"],"names":["spanToStreamedSpanJSON","INTERNAL_getSegmentSpan","getCapturedScopesOnSpan","getCombinedScopeData","beforeSendSpan","isStreamedBeforeSendSpanCallback","SEMANTIC_ATTRIBUTE_SENTRY_SOURCE","streamedSpanJsonToSerializedSpan","SEMANTIC_ATTRIBUTE_SENTRY_RELEASE","SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT","SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME","SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID","SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME","SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION","SEMANTIC_ATTRIBUTE_USER_ID","SEMANTIC_ATTRIBUTE_USER_EMAIL","SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS","SEMANTIC_ATTRIBUTE_USER_USERNAME","showSpanDropWarning","SEMANTIC_ATTRIBUTE_SENTRY_OP","SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME","parseUrl","getSanitizedUrlString","stripUrlQueryAndFragment"],"mappings":";;;;;;;;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,IAAI,EAAQ,MAAM,EAAiD;AAC/F;AACA,EAAE,MAAM,QAAA,GAAWA,gCAAsB,CAAC,IAAI,CAAC;;AAE/C,EAAE,MAAM,WAAA,GAAcC,iCAAuB,CAAC,IAAI,CAAC;AACnD,EAAE,MAAM,qBAAA,GAAwBD,gCAAsB,CAAC,WAAW,CAAC;;AAEnE,EAAE,MAAM,EAAE,cAAc,EAAE,k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CAAA;AACA,EAAA;;AAEA;AACA,EAAA,IAAA,YAAA,EAAA;AACA,IAAA,OAAA,YAAA;AACA,EAAA;;AAEA;AACA,EAAA,IAAA,OAAA,UAAA,KAAA,QAAA,EAAA;AACA,IAAA,OAAAA,4BAAA,CAAA,UAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,SAAA;AACA;;AAEA,SAAA,eAAA,CAAA,QAAA,EAAA,UAAA,EAAA;AACA,EAAA,yBAAA,CAAA,QAAA,EAAA,EAAA,CAAAJ,+CAAA,GAAA,IAAA,EAAA,CAAA;;AAEA;AACA,EAAA,MAAA,UAAA,GAAA,UAAA,CAAAC,6DAAA,CAAA;AACA,EAAA,IAAA,OAAA,UAAA,KAAA,QAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,UAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,IAAA,UAAA,CAAAd,mDAAA,CAAA,KAAA,QAAA,EAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,MAAA,SAAA,GAAA,UAAA,CAAA,cAAA,CAAA;AACA,EAAA,IAAA,SAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,CAAA,EAAA,SAAA,CAAA,CAAA;AACA,IAAA,yBAAA,CAAA,QAAA,EAAA,EAAA,CAAAA,mDAAA,GAAA,MAAA,EAAA,CAAA;AACA,EAAA;AACA;;;;;;;"} |
@@ -5,5 +5,5 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | ||
| const SDK_VERSION = "10.53.0" ; | ||
| const SDK_VERSION = "10.53.1" ; | ||
| exports.SDK_VERSION = SDK_VERSION; | ||
| //# sourceMappingURL=version.js.map |
@@ -1,1 +0,1 @@ | ||
| {"type":"module","version":"10.53.0","sideEffects":false} | ||
| {"type":"module","version":"10.53.1","sideEffects":false} |
@@ -56,9 +56,9 @@ /** | ||
| /** The user ID (gated by sendDefaultPii) */ | ||
| /** The user ID */ | ||
| const SEMANTIC_ATTRIBUTE_USER_ID = 'user.id'; | ||
| /** The user email (gated by sendDefaultPii) */ | ||
| /** The user email */ | ||
| const SEMANTIC_ATTRIBUTE_USER_EMAIL = 'user.email'; | ||
| /** The user IP address (gated by sendDefaultPii) */ | ||
| /** The user IP address */ | ||
| const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = 'user.ip_address'; | ||
| /** The user username (gated by sendDefaultPii) */ | ||
| /** The user username */ | ||
| const SEMANTIC_ATTRIBUTE_USER_USERNAME = 'user.name'; | ||
@@ -65,0 +65,0 @@ |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"semanticAttributes.js","sources":["../../src/semanticAttributes.ts"],"sourcesContent":["/**\n * Use this attribute to represent the source of a span name.\n * Must be one of: custom, url, route, view, component, task\n * TODO(v11): rename this to sentry.span.source'\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Attributes that holds the sample rate that was locally applied to a span.\n * If this attribute is not defined, it means that the span inherited a sampling decision.\n *\n * NOTE: Is only defined on root spans.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Attribute holding the sample rate of the previous trace.\n * This is used to sample consistently across subsequent traces in the browser SDK.\n *\n * Note: Only defined on root spans, if opted into consistent sampling\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = 'sentry.previous_trace_sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/** The reason why an idle span finished. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason';\n\n/** The unit of a measurement, which may be stored as a TimedEvent. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit';\n\n/** The value of a measurement, which may be stored as a TimedEvent. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value';\n\n/** The release version of the application */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = 'sentry.release';\n/** The environment name (e.g., \"production\", \"staging\", \"development\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = 'sentry.environment';\n/** The segment name (e.g., \"GET /users\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = 'sentry.segment.name';\n/** The id of the segment that this span belongs to. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = 'sentry.segment.id';\n/** The name of the Sentry SDK (e.g., \"sentry.php\", \"sentry.javascript\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = 'sentry.sdk.name';\n/** The version of the Sentry SDK */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = 'sentry.sdk.version';\n\n/** The user ID (gated by sendDefaultPii) */\nexport const SEMANTIC_ATTRIBUTE_USER_ID = 'user.id';\n/** The user email (gated by sendDefaultPii) */\nexport const SEMANTIC_ATTRIBUTE_USER_EMAIL = 'user.email';\n/** The user IP address (gated by sendDefaultPii) */\nexport const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = 'user.ip_address';\n/** The user username (gated by sendDefaultPii) */\nexport const SEMANTIC_ATTRIBUTE_USER_USERNAME = 'user.name';\n\n/**\n * A custom span name set by users guaranteed to be taken over any automatically\n * inferred name. This attribute is removed before the span is sent.\n *\n * @internal only meant for internal SDK usage\n * @hidden\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = 'sentry.custom_span_name';\n\n/**\n * The id of the profile that this span occurred in.\n */\nexport const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id';\n\nexport const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size';\n\n/** TODO: Remove these once we update to latest semantic conventions */\nexport const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = 'http.request.method';\nexport const SEMANTIC_ATTRIBUTE_URL_FULL = 'url.full';\n\n/**\n * A span link attribute to mark the link as a special span link.\n *\n * Known values:\n * - `previous_trace`: The span links to the frontend root span of the previous trace.\n * - `next_trace`: The span links to the frontend root span of the next trace. (Not set by the SDK)\n *\n * Other values may be set as appropriate.\n * @see https://develop.sentry.dev/sdk/telemetry/traces/span-links/#link-types\n */\nexport const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = 'sentry.link.type';\n\n/**\n * =============================================================================\n * GEN AI ATTRIBUTES\n * Based on OpenTelemetry Semantic Conventions for Generative AI\n * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/\n * =============================================================================\n */\n\n/**\n * The conversation ID for linking messages across API calls.\n * For OpenAI Assistants API: thread_id\n * For LangGraph: configurable.thread_id\n */\nexport const GEN_AI_CONVERSATION_ID_ATTRIBUTE = 'gen_ai.conversation.id';\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,qCAAA,GAAwC;;AAErD;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,oDAAA,GAAuD;;AAEpE;AACA;AACA;AACO,MAAM,4BAAA,GAA+B;;AAE5C;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACO,MAAM,iDAAA,GAAoD;;AAEjE;AACO,MAAM,0CAAA,GAA6C;;AAE1D;AACO,MAAM,2CAAA,GAA8C;;AAE3D;AACO,MAAM,iCAAA,GAAoC;AACjD;AACO,MAAM,qCAAA,GAAwC;AACrD;AACO,MAAM,sCAAA,GAAyC;AACtD;AACO,MAAM,oCAAA,GAAuC;AACpD;AACO,MAAM,kCAAA,GAAqC;AAClD;AACO,MAAM,qCAAA,GAAwC;;AAErD;AACO,MAAM,0BAAA,GAA6B;AAC1C;AACO,MAAM,6BAAA,GAAgC;AAC7C;AACO,MAAM,kCAAA,GAAqC;AAClD;AACO,MAAM,gCAAA,GAAmC;;AAEhD;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,0CAAA,GAA6C;;AAE1D;AACA;AACA;AACO,MAAM,6BAAA,GAAgC;;AAEtC,MAAM,iCAAA,GAAoC;;AAE1C,MAAM,4BAAA,GAA+B;;AAErC,MAAM,4BAAA,GAA+B;;AAErC,MAAM,kCAAA,GAAqC;;AAElD;AACO,MAAM,sCAAA,GAAyC;AAC/C,MAAM,2BAAA,GAA8B;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAM,iCAAA,GAAoC;;AAEjD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,gCAAA,GAAmC;;;;"} | ||
| {"version":3,"file":"semanticAttributes.js","sources":["../../src/semanticAttributes.ts"],"sourcesContent":["/**\n * Use this attribute to represent the source of a span name.\n * Must be one of: custom, url, route, view, component, task\n * TODO(v11): rename this to sentry.span.source'\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Attributes that holds the sample rate that was locally applied to a span.\n * If this attribute is not defined, it means that the span inherited a sampling decision.\n *\n * NOTE: Is only defined on root spans.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Attribute holding the sample rate of the previous trace.\n * This is used to sample consistently across subsequent traces in the browser SDK.\n *\n * Note: Only defined on root spans, if opted into consistent sampling\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = 'sentry.previous_trace_sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/** The reason why an idle span finished. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON = 'sentry.idle_span_finish_reason';\n\n/** The unit of a measurement, which may be stored as a TimedEvent. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT = 'sentry.measurement_unit';\n\n/** The value of a measurement, which may be stored as a TimedEvent. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE = 'sentry.measurement_value';\n\n/** The release version of the application */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_RELEASE = 'sentry.release';\n/** The environment name (e.g., \"production\", \"staging\", \"development\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT = 'sentry.environment';\n/** The segment name (e.g., \"GET /users\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME = 'sentry.segment.name';\n/** The id of the segment that this span belongs to. */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID = 'sentry.segment.id';\n/** The name of the Sentry SDK (e.g., \"sentry.php\", \"sentry.javascript\") */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME = 'sentry.sdk.name';\n/** The version of the Sentry SDK */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = 'sentry.sdk.version';\n\n/** The user ID */\nexport const SEMANTIC_ATTRIBUTE_USER_ID = 'user.id';\n/** The user email */\nexport const SEMANTIC_ATTRIBUTE_USER_EMAIL = 'user.email';\n/** The user IP address */\nexport const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = 'user.ip_address';\n/** The user username */\nexport const SEMANTIC_ATTRIBUTE_USER_USERNAME = 'user.name';\n\n/**\n * A custom span name set by users guaranteed to be taken over any automatically\n * inferred name. This attribute is removed before the span is sent.\n *\n * @internal only meant for internal SDK usage\n * @hidden\n */\nexport const SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME = 'sentry.custom_span_name';\n\n/**\n * The id of the profile that this span occurred in.\n */\nexport const SEMANTIC_ATTRIBUTE_PROFILE_ID = 'sentry.profile_id';\n\nexport const SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME = 'sentry.exclusive_time';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_HIT = 'cache.hit';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_KEY = 'cache.key';\n\nexport const SEMANTIC_ATTRIBUTE_CACHE_ITEM_SIZE = 'cache.item_size';\n\n/** TODO: Remove these once we update to latest semantic conventions */\nexport const SEMANTIC_ATTRIBUTE_HTTP_REQUEST_METHOD = 'http.request.method';\nexport const SEMANTIC_ATTRIBUTE_URL_FULL = 'url.full';\n\n/**\n * A span link attribute to mark the link as a special span link.\n *\n * Known values:\n * - `previous_trace`: The span links to the frontend root span of the previous trace.\n * - `next_trace`: The span links to the frontend root span of the next trace. (Not set by the SDK)\n *\n * Other values may be set as appropriate.\n * @see https://develop.sentry.dev/sdk/telemetry/traces/span-links/#link-types\n */\nexport const SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE = 'sentry.link.type';\n\n/**\n * =============================================================================\n * GEN AI ATTRIBUTES\n * Based on OpenTelemetry Semantic Conventions for Generative AI\n * @see https://opentelemetry.io/docs/specs/semconv/gen-ai/\n * =============================================================================\n */\n\n/**\n * The conversation ID for linking messages across API calls.\n * For OpenAI Assistants API: thread_id\n * For LangGraph: configurable.thread_id\n */\nexport const GEN_AI_CONVERSATION_ID_ATTRIBUTE = 'gen_ai.conversation.id';\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACO,MAAM,gCA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E_USER_EMAIL, SEMANTIC_ATTRIBUTE_USER_ID, SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID, SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME, SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT, SEMANTIC_ATTRIBUTE_SENTRY_RELEASE, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME } from '../../semanticAttributes.js'; | ||
| const sdk = client.getSdkMetadata(); | ||
| const { release, environment, sendDefaultPii } = client.getOptions(); | ||
| const { release, environment } = client.getOptions(); | ||
@@ -106,10 +106,6 @@ // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation) | ||
| [SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version, | ||
| ...(sendDefaultPii | ||
| ? { | ||
| [SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id, | ||
| [SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email, | ||
| [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address, | ||
| [SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username, | ||
| } | ||
| : {}), | ||
| [SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id, | ||
| [SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email, | ||
| [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address, | ||
| [SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username, | ||
| ...scopeData.attributes, | ||
@@ -116,0 +112,0 @@ }); |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"captureSpan.js","sources":["../../../../src/tracing/spans/captureSpan.ts"],"sourcesContent":["import type { RawAttributes } from '../../attributes';\nimport type { Client } from '../../client';\nimport type { ScopeData } from '../../scope';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n SEMANTIC_ATTRIBUTE_USER_EMAIL,\n SEMANTIC_ATTRIBUTE_USER_ID,\n SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,\n SEMANTIC_ATTRIBUTE_USER_USERNAME,\n} from '../../semanticAttributes';\nimport type { SerializedStreamedSpan, Span, StreamedSpanJSON } from '../../types-hoist/span';\nimport { getCombinedScopeData } from '../../utils/scopeData';\nimport { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '../../utils/url';\nimport {\n INTERNAL_getSegmentSpan,\n showSpanDropWarning,\n spanToStreamedSpanJSON,\n streamedSpanJsonToSerializedSpan,\n} from '../../utils/spanUtils';\nimport { getCapturedScopesOnSpan } from '../utils';\nimport { isStreamedBeforeSendSpanCallback } from './beforeSendSpan';\n\nexport type SerializedStreamedSpanWithSegmentSpan = SerializedStreamedSpan & {\n _segmentSpan: Span;\n};\n\n/**\n * Captures a span and returns a JSON representation to be enqueued for sending.\n *\n * IMPORTANT: This function converts the span to JSON immediately to avoid writing\n * to an already-ended OTel span instance (which is blocked by the OTel Span class).\n *\n * @returns the final serialized span with a reference to its segment span. This reference\n * is needed later on to compute the DSC for the span envelope.\n */\nexport function captureSpan(span: Span, client: Client): SerializedStreamedSpanWithSegmentSpan {\n // Convert to JSON FIRST - we cannot write to an already-ended span\n const spanJSON = spanToStreamedSpanJSON(span);\n\n const segmentSpan = INTERNAL_getSegmentSpan(span);\n const serializedSegmentSpan = spanToStreamedSpanJSON(segmentSpan);\n\n const { isolationScope: spanIsolationScope, scope: spanScope } = getCapturedScopesOnSpan(span);\n\n const finalScopeData = getCombinedScopeData(spanIsolationScope, spanScope);\n\n applyCommonSpanAttributes(spanJSON, serializedSegmentSpan, client, finalScopeData);\n\n // Backfill span data from OTel semantic conventions when not explicitly set.\n // OTel-originated spans don't have sentry.op, description, etc. — the non-streamed path\n // infers these in the SentrySpanExporter, but streamed spans skip the exporter entirely.\n // Access `kind` via duck-typing — OTel span objects have this property but it's not on Sentry's Span type.\n // This must run before all hooks and beforeSendSpan so that user callbacks can see and override inferred values.\n const spanKind = (span as { kind?: number }).kind;\n inferSpanDataFromOtelAttributes(spanJSON, spanKind);\n\n if (spanJSON.is_segment) {\n applyScopeToSegmentSpan(spanJSON, finalScopeData);\n // Allow hook subscribers to mutate the segment span JSON\n // This also invokes the `processSegmentSpan` hook of all integrations\n client.emit('processSegmentSpan', spanJSON);\n }\n\n // This allows hook subscribers to mutate the span JSON\n // This also invokes the `processSpan` hook of all integrations\n client.emit('processSpan', spanJSON);\n\n const { beforeSendSpan } = client.getOptions();\n const processedSpan =\n beforeSendSpan && isStreamedBeforeSendSpanCallback(beforeSendSpan)\n ? applyBeforeSendSpanCallback(spanJSON, beforeSendSpan)\n : spanJSON;\n\n // Backfill sentry.span.source from sentry.source. Only `sentry.span.source` is respected by Sentry.\n // TODO(v11): Remove this backfill once we renamed SEMANTIC_ATTRIBUTE_SENTRY_SOURCE to sentry.span.source\n const spanNameSource = processedSpan.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n if (spanNameSource) {\n safeSetSpanJSONAttributes(processedSpan, {\n // Purposefully not using a constant defined here like in other attributes:\n // This will be the name for SEMANTIC_ATTRIBUTE_SENTRY_SOURCE in v11\n 'sentry.span.source': spanNameSource,\n });\n }\n\n return {\n ...streamedSpanJsonToSerializedSpan(processedSpan),\n _segmentSpan: segmentSpan,\n };\n}\n\nfunction applyScopeToSegmentSpan(_segmentSpanJSON: StreamedSpanJSON, _scopeData: ScopeData): void {\n // TODO: Apply contexts data from auto instrumentation to segment span\n // This will follow in a separate PR\n}\n\n/**\n * Safely set attributes on a span JSON.\n * If an attribute already exists, it will not be overwritten.\n */\nexport function safeSetSpanJSONAttributes(\n spanJSON: StreamedSpanJSON,\n newAttributes: RawAttributes<Record<string, unknown>>,\n): void {\n const originalAttributes = spanJSON.attributes ?? (spanJSON.attributes = {});\n\n Object.entries(newAttributes).forEach(([key, value]) => {\n if (value != null && !(key in originalAttributes)) {\n originalAttributes[key] = value;\n }\n });\n}\n\nfunction applyCommonSpanAttributes(\n spanJSON: StreamedSpanJSON,\n serializedSegmentSpan: StreamedSpanJSON,\n client: Client,\n scopeData: ScopeData,\n): void {\n const sdk = client.getSdkMetadata();\n const { release, environment, sendDefaultPii } = client.getOptions();\n\n // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)\n safeSetSpanJSONAttributes(spanJSON, {\n [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,\n [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID]: serializedSegmentSpan.span_id,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,\n ...(sendDefaultPii\n ? {\n [SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id,\n [SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email,\n [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address,\n [SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username,\n }\n : {}),\n ...scopeData.attributes,\n });\n}\n\n/**\n * Apply a user-provided beforeSendSpan callback to a span JSON.\n */\nexport function applyBeforeSendSpanCallback(\n span: StreamedSpanJSON,\n beforeSendSpan: (span: StreamedSpanJSON) => StreamedSpanJSON,\n): StreamedSpanJSON {\n const modifedSpan = beforeSendSpan(span);\n if (!modifedSpan) {\n showSpanDropWarning();\n return span;\n }\n return modifedSpan;\n}\n\n// OTel SpanKind values (numeric to avoid importing from @opentelemetry/api)\nconst SPAN_KIND_SERVER = 1;\nconst SPAN_KIND_CLIENT = 2;\n\n/**\n * Infer and backfill span data from OTel semantic conventions.\n * This mirrors what the `SentrySpanExporter` does for non-streamed spans via `getSpanData`/`inferSpanData`.\n * Streamed spans skip the exporter, so we do the inference here during capture.\n *\n * Backfills: `sentry.op`, `sentry.source`, and `name` (description).\n * Uses `safeSetSpanJSONAttributes` so explicitly set attributes are never overwritten.\n */\n/** Exported only for tests. */\nexport function inferSpanDataFromOtelAttributes(spanJSON: StreamedSpanJSON, spanKind?: number): void {\n const attributes = spanJSON.attributes;\n if (!attributes) {\n return;\n }\n\n const httpMethod = attributes['http.request.method'] || attributes['http.method'];\n if (httpMethod) {\n inferHttpSpanData(spanJSON, attributes, spanKind, httpMethod);\n return;\n }\n\n const dbSystem = attributes['db.system.name'] || attributes['db.system'];\n const opIsCache =\n typeof attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'string' &&\n `${attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP]}`.startsWith('cache.');\n if (dbSystem && !opIsCache) {\n inferDbSpanData(spanJSON, attributes);\n return;\n }\n\n if (attributes['rpc.service']) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'rpc' });\n return;\n }\n\n if (attributes['messaging.system']) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'message' });\n return;\n }\n\n const faasTrigger = attributes['faas.trigger'];\n if (faasTrigger) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${faasTrigger}` });\n }\n}\n\nfunction inferHttpSpanData(\n spanJSON: StreamedSpanJSON,\n attributes: RawAttributes<Record<string, unknown>>,\n spanKind: number | undefined,\n httpMethod: unknown,\n): void {\n // Infer op: http.client, http.server, or just http\n const opParts = ['http'];\n if (spanKind === SPAN_KIND_CLIENT) {\n opParts.push('client');\n } else if (spanKind === SPAN_KIND_SERVER) {\n opParts.push('server');\n }\n if (attributes['sentry.http.prefetch']) {\n opParts.push('prefetch');\n }\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: opParts.join('.') });\n\n // If the user set a custom span name via updateSpanName(), apply it — OTel instrumentation\n // may have overwritten span.name after the user set it, so we restore from the attribute.\n const customName = attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n if (typeof customName === 'string') {\n spanJSON.name = customName;\n return;\n }\n\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') {\n return;\n }\n\n const httpRoute = attributes['http.route'];\n if (typeof httpRoute === 'string') {\n spanJSON.name = `${httpMethod} ${httpRoute}`;\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route' });\n } else {\n // Infer span name from URL attributes, matching the non-streamed exporter's behavior.\n // Only overwrite the name for OTel spans (known spanKind)\n if (spanKind === SPAN_KIND_CLIENT || spanKind === SPAN_KIND_SERVER) {\n const urlPath = getUrlPath(attributes, spanKind);\n if (urlPath) {\n spanJSON.name = `${httpMethod} ${urlPath}`;\n }\n }\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url' });\n }\n}\n\n/**\n * Extract a URL path from span attributes for use in the span name.\n * Mirrors the logic in the non-streamed exporter's `getSanitizedUrl`.\n */\nfunction getUrlPath(\n attributes: RawAttributes<Record<string, unknown>>,\n spanKind: number | undefined,\n): string | undefined {\n const httpUrl = attributes['http.url'] || attributes['url.full'];\n const httpTarget = attributes['http.target'];\n\n const parsedUrl = typeof httpUrl === 'string' ? parseUrl(httpUrl) : undefined;\n const sanitizedUrl = parsedUrl ? getSanitizedUrlString(parsedUrl) : undefined;\n\n // For server spans, prefer the relative target path\n if (spanKind === SPAN_KIND_SERVER && typeof httpTarget === 'string') {\n return stripUrlQueryAndFragment(httpTarget);\n }\n\n // For client spans (and others), use the full sanitized URL\n if (sanitizedUrl) {\n return sanitizedUrl;\n }\n\n // Fall back to target if no full URL is available\n if (typeof httpTarget === 'string') {\n return stripUrlQueryAndFragment(httpTarget);\n }\n\n return undefined;\n}\n\nfunction inferDbSpanData(spanJSON: StreamedSpanJSON, attributes: RawAttributes<Record<string, unknown>>): void {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db' });\n\n // If the user set a custom span name via updateSpanName(), apply it.\n const customName = attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n if (typeof customName === 'string') {\n spanJSON.name = customName;\n return;\n }\n\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') {\n return;\n }\n\n const statement = attributes['db.statement'];\n if (statement) {\n spanJSON.name = `${statement}`;\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'task' });\n }\n}\n"],"names":[],"mappings":";;;;;;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,IAAI,EAAQ,MAAM,EAAiD;AAC/F;AACA,EAAE,MAAM,QAAA,GAAW,sBAAsB,CAAC,IAAI,CAAC;;AAE/C,EAAE,MAAM,WAAA,GAAc,uBAAuB,CAAC,IAAI,CAAC;AACnD,EAAE,MAAM,qBAAA,GAAwB,sBAAsB,CAAC,WAAW,CAAC;;AA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AA,IAAA,OAAA,UAAA,KAAA,QAAA,EAAA;AACA,IAAA,OAAA,wBAAA,CAAA,UAAA,CAAA;AACA,EAAA;;AAEA;AACA,EAAA,IAAA,YAAA,EAAA;AACA,IAAA,OAAA,YAAA;AACA,EAAA;;AAEA;AACA,EAAA,IAAA,OAAA,UAAA,KAAA,QAAA,EAAA;AACA,IAAA,OAAA,wBAAA,CAAA,UAAA,CAAA;AACA,EAAA;;AAEA,EAAA,OAAA,SAAA;AACA;;AAEA,SAAA,eAAA,CAAA,QAAA,EAAA,UAAA,EAAA;AACA,EAAA,yBAAA,CAAA,QAAA,EAAA,EAAA,CAAA,4BAAA,GAAA,IAAA,EAAA,CAAA;;AAEA;AACA,EAAA,MAAA,UAAA,GAAA,UAAA,CAAA,0CAAA,CAAA;AACA,EAAA,IAAA,OAAA,UAAA,KAAA,QAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,UAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,IAAA,UAAA,CAAA,gCAAA,CAAA,KAAA,QAAA,EAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,MAAA,SAAA,GAAA,UAAA,CAAA,cAAA,CAAA;AACA,EAAA,IAAA,SAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,CAAA,EAAA,SAAA,CAAA,CAAA;AACA,IAAA,yBAAA,CAAA,QAAA,EAAA,EAAA,CAAA,gCAAA,GAAA,MAAA,EAAA,CAAA;AACA,EAAA;AACA;;;;"} | ||
| {"version":3,"file":"captureSpan.js","sources":["../../../../src/tracing/spans/captureSpan.ts"],"sourcesContent":["import type { RawAttributes } from '../../attributes';\nimport type { Client } from '../../client';\nimport type { ScopeData } from '../../scope';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT,\n SEMANTIC_ATTRIBUTE_SENTRY_OP,\n SEMANTIC_ATTRIBUTE_SENTRY_RELEASE,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID,\n SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n SEMANTIC_ATTRIBUTE_USER_EMAIL,\n SEMANTIC_ATTRIBUTE_USER_ID,\n SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS,\n SEMANTIC_ATTRIBUTE_USER_USERNAME,\n} from '../../semanticAttributes';\nimport type { SerializedStreamedSpan, Span, StreamedSpanJSON } from '../../types-hoist/span';\nimport { getCombinedScopeData } from '../../utils/scopeData';\nimport { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '../../utils/url';\nimport {\n INTERNAL_getSegmentSpan,\n showSpanDropWarning,\n spanToStreamedSpanJSON,\n streamedSpanJsonToSerializedSpan,\n} from '../../utils/spanUtils';\nimport { getCapturedScopesOnSpan } from '../utils';\nimport { isStreamedBeforeSendSpanCallback } from './beforeSendSpan';\n\nexport type SerializedStreamedSpanWithSegmentSpan = SerializedStreamedSpan & {\n _segmentSpan: Span;\n};\n\n/**\n * Captures a span and returns a JSON representation to be enqueued for sending.\n *\n * IMPORTANT: This function converts the span to JSON immediately to avoid writing\n * to an already-ended OTel span instance (which is blocked by the OTel Span class).\n *\n * @returns the final serialized span with a reference to its segment span. This reference\n * is needed later on to compute the DSC for the span envelope.\n */\nexport function captureSpan(span: Span, client: Client): SerializedStreamedSpanWithSegmentSpan {\n // Convert to JSON FIRST - we cannot write to an already-ended span\n const spanJSON = spanToStreamedSpanJSON(span);\n\n const segmentSpan = INTERNAL_getSegmentSpan(span);\n const serializedSegmentSpan = spanToStreamedSpanJSON(segmentSpan);\n\n const { isolationScope: spanIsolationScope, scope: spanScope } = getCapturedScopesOnSpan(span);\n\n const finalScopeData = getCombinedScopeData(spanIsolationScope, spanScope);\n\n applyCommonSpanAttributes(spanJSON, serializedSegmentSpan, client, finalScopeData);\n\n // Backfill span data from OTel semantic conventions when not explicitly set.\n // OTel-originated spans don't have sentry.op, description, etc. — the non-streamed path\n // infers these in the SentrySpanExporter, but streamed spans skip the exporter entirely.\n // Access `kind` via duck-typing — OTel span objects have this property but it's not on Sentry's Span type.\n // This must run before all hooks and beforeSendSpan so that user callbacks can see and override inferred values.\n const spanKind = (span as { kind?: number }).kind;\n inferSpanDataFromOtelAttributes(spanJSON, spanKind);\n\n if (spanJSON.is_segment) {\n applyScopeToSegmentSpan(spanJSON, finalScopeData);\n // Allow hook subscribers to mutate the segment span JSON\n // This also invokes the `processSegmentSpan` hook of all integrations\n client.emit('processSegmentSpan', spanJSON);\n }\n\n // This allows hook subscribers to mutate the span JSON\n // This also invokes the `processSpan` hook of all integrations\n client.emit('processSpan', spanJSON);\n\n const { beforeSendSpan } = client.getOptions();\n const processedSpan =\n beforeSendSpan && isStreamedBeforeSendSpanCallback(beforeSendSpan)\n ? applyBeforeSendSpanCallback(spanJSON, beforeSendSpan)\n : spanJSON;\n\n // Backfill sentry.span.source from sentry.source. Only `sentry.span.source` is respected by Sentry.\n // TODO(v11): Remove this backfill once we renamed SEMANTIC_ATTRIBUTE_SENTRY_SOURCE to sentry.span.source\n const spanNameSource = processedSpan.attributes?.[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n if (spanNameSource) {\n safeSetSpanJSONAttributes(processedSpan, {\n // Purposefully not using a constant defined here like in other attributes:\n // This will be the name for SEMANTIC_ATTRIBUTE_SENTRY_SOURCE in v11\n 'sentry.span.source': spanNameSource,\n });\n }\n\n return {\n ...streamedSpanJsonToSerializedSpan(processedSpan),\n _segmentSpan: segmentSpan,\n };\n}\n\nfunction applyScopeToSegmentSpan(_segmentSpanJSON: StreamedSpanJSON, _scopeData: ScopeData): void {\n // TODO: Apply contexts data from auto instrumentation to segment span\n // This will follow in a separate PR\n}\n\n/**\n * Safely set attributes on a span JSON.\n * If an attribute already exists, it will not be overwritten.\n */\nexport function safeSetSpanJSONAttributes(\n spanJSON: StreamedSpanJSON,\n newAttributes: RawAttributes<Record<string, unknown>>,\n): void {\n const originalAttributes = spanJSON.attributes ?? (spanJSON.attributes = {});\n\n Object.entries(newAttributes).forEach(([key, value]) => {\n if (value != null && !(key in originalAttributes)) {\n originalAttributes[key] = value;\n }\n });\n}\n\nfunction applyCommonSpanAttributes(\n spanJSON: StreamedSpanJSON,\n serializedSegmentSpan: StreamedSpanJSON,\n client: Client,\n scopeData: ScopeData,\n): void {\n const sdk = client.getSdkMetadata();\n const { release, environment } = client.getOptions();\n\n // avoid overwriting any previously set attributes (from users or potentially our SDK instrumentation)\n safeSetSpanJSONAttributes(spanJSON, {\n [SEMANTIC_ATTRIBUTE_SENTRY_RELEASE]: release,\n [SEMANTIC_ATTRIBUTE_SENTRY_ENVIRONMENT]: environment,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_NAME]: serializedSegmentSpan.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SEGMENT_ID]: serializedSegmentSpan.span_id,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_NAME]: sdk?.sdk?.name,\n [SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION]: sdk?.sdk?.version,\n [SEMANTIC_ATTRIBUTE_USER_ID]: scopeData.user?.id,\n [SEMANTIC_ATTRIBUTE_USER_EMAIL]: scopeData.user?.email,\n [SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS]: scopeData.user?.ip_address,\n [SEMANTIC_ATTRIBUTE_USER_USERNAME]: scopeData.user?.username,\n ...scopeData.attributes,\n });\n}\n\n/**\n * Apply a user-provided beforeSendSpan callback to a span JSON.\n */\nexport function applyBeforeSendSpanCallback(\n span: StreamedSpanJSON,\n beforeSendSpan: (span: StreamedSpanJSON) => StreamedSpanJSON,\n): StreamedSpanJSON {\n const modifedSpan = beforeSendSpan(span);\n if (!modifedSpan) {\n showSpanDropWarning();\n return span;\n }\n return modifedSpan;\n}\n\n// OTel SpanKind values (numeric to avoid importing from @opentelemetry/api)\nconst SPAN_KIND_SERVER = 1;\nconst SPAN_KIND_CLIENT = 2;\n\n/**\n * Infer and backfill span data from OTel semantic conventions.\n * This mirrors what the `SentrySpanExporter` does for non-streamed spans via `getSpanData`/`inferSpanData`.\n * Streamed spans skip the exporter, so we do the inference here during capture.\n *\n * Backfills: `sentry.op`, `sentry.source`, and `name` (description).\n * Uses `safeSetSpanJSONAttributes` so explicitly set attributes are never overwritten.\n */\n/** Exported only for tests. */\nexport function inferSpanDataFromOtelAttributes(spanJSON: StreamedSpanJSON, spanKind?: number): void {\n const attributes = spanJSON.attributes;\n if (!attributes) {\n return;\n }\n\n const httpMethod = attributes['http.request.method'] || attributes['http.method'];\n if (httpMethod) {\n inferHttpSpanData(spanJSON, attributes, spanKind, httpMethod);\n return;\n }\n\n const dbSystem = attributes['db.system.name'] || attributes['db.system'];\n const opIsCache =\n typeof attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'string' &&\n `${attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP]}`.startsWith('cache.');\n if (dbSystem && !opIsCache) {\n inferDbSpanData(spanJSON, attributes);\n return;\n }\n\n if (attributes['rpc.service']) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'rpc' });\n return;\n }\n\n if (attributes['messaging.system']) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'message' });\n return;\n }\n\n const faasTrigger = attributes['faas.trigger'];\n if (faasTrigger) {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: `${faasTrigger}` });\n }\n}\n\nfunction inferHttpSpanData(\n spanJSON: StreamedSpanJSON,\n attributes: RawAttributes<Record<string, unknown>>,\n spanKind: number | undefined,\n httpMethod: unknown,\n): void {\n // Infer op: http.client, http.server, or just http\n const opParts = ['http'];\n if (spanKind === SPAN_KIND_CLIENT) {\n opParts.push('client');\n } else if (spanKind === SPAN_KIND_SERVER) {\n opParts.push('server');\n }\n if (attributes['sentry.http.prefetch']) {\n opParts.push('prefetch');\n }\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: opParts.join('.') });\n\n // If the user set a custom span name via updateSpanName(), apply it — OTel instrumentation\n // may have overwritten span.name after the user set it, so we restore from the attribute.\n const customName = attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n if (typeof customName === 'string') {\n spanJSON.name = customName;\n return;\n }\n\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') {\n return;\n }\n\n const httpRoute = attributes['http.route'];\n if (typeof httpRoute === 'string') {\n spanJSON.name = `${httpMethod} ${httpRoute}`;\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'route' });\n } else {\n // Infer span name from URL attributes, matching the non-streamed exporter's behavior.\n // Only overwrite the name for OTel spans (known spanKind)\n if (spanKind === SPAN_KIND_CLIENT || spanKind === SPAN_KIND_SERVER) {\n const urlPath = getUrlPath(attributes, spanKind);\n if (urlPath) {\n spanJSON.name = `${httpMethod} ${urlPath}`;\n }\n }\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url' });\n }\n}\n\n/**\n * Extract a URL path from span attributes for use in the span name.\n * Mirrors the logic in the non-streamed exporter's `getSanitizedUrl`.\n */\nfunction getUrlPath(\n attributes: RawAttributes<Record<string, unknown>>,\n spanKind: number | undefined,\n): string | undefined {\n const httpUrl = attributes['http.url'] || attributes['url.full'];\n const httpTarget = attributes['http.target'];\n\n const parsedUrl = typeof httpUrl === 'string' ? parseUrl(httpUrl) : undefined;\n const sanitizedUrl = parsedUrl ? getSanitizedUrlString(parsedUrl) : undefined;\n\n // For server spans, prefer the relative target path\n if (spanKind === SPAN_KIND_SERVER && typeof httpTarget === 'string') {\n return stripUrlQueryAndFragment(httpTarget);\n }\n\n // For client spans (and others), use the full sanitized URL\n if (sanitizedUrl) {\n return sanitizedUrl;\n }\n\n // Fall back to target if no full URL is available\n if (typeof httpTarget === 'string') {\n return stripUrlQueryAndFragment(httpTarget);\n }\n\n return undefined;\n}\n\nfunction inferDbSpanData(spanJSON: StreamedSpanJSON, attributes: RawAttributes<Record<string, unknown>>): void {\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'db' });\n\n // If the user set a custom span name via updateSpanName(), apply it.\n const customName = attributes[SEMANTIC_ATTRIBUTE_SENTRY_CUSTOM_SPAN_NAME];\n if (typeof customName === 'string') {\n spanJSON.name = customName;\n return;\n }\n\n if (attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'custom') {\n return;\n }\n\n const statement = attributes['db.statement'];\n if (statement) {\n spanJSON.name = `${statement}`;\n safeSetSpanJSONAttributes(spanJSON, { [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'task' });\n }\n}\n"],"names":[],"mappings":";;;;;;;AAkCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,IAAI,EAAQ,MAAM,EAAiD;AAC/F;AACA,EAAE,MAAM,QAAA,GAAW,sBAAsB,CAAC,IAAI,CAAC;;AAE/C,EAAE,MAAM,WAAA,GAAc,uBAAuB,CAAC,IAAI,CAAC;AACnD,EAAE,MAAM,qBAAA,GAAwB,sBAAsB,CAAC,WAAW,CAAC;;AAEnE,EAAE,MAAM,EAAE,cAAc,EAAE,kBAAkB,EAAE,KAAK,EAAE,SAAA,EAAU,GAAI,uBAAuB,CAAC,IAAI,CAAC;;AAEhG,EAAE,MAAM,iBAAiB,oBAAoB,CAAC,kBAAkB,EAAE,SAAS,CAAC;;AAE5E,EAAE,yBAAyB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,MAAM,EAAE,cAAc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AAA,QAAA,EAAA,UAAA,EAAA;AACA,EAAA,yBAAA,CAAA,QAAA,EAAA,EAAA,CAAA,4BAAA,GAAA,IAAA,EAAA,CAAA;;AAEA;AACA,EAAA,MAAA,UAAA,GAAA,UAAA,CAAA,0CAAA,CAAA;AACA,EAAA,IAAA,OAAA,UAAA,KAAA,QAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,UAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,IAAA,UAAA,CAAA,gCAAA,CAAA,KAAA,QAAA,EAAA;AACA,IAAA;AACA,EAAA;;AAEA,EAAA,MAAA,SAAA,GAAA,UAAA,CAAA,cAAA,CAAA;AACA,EAAA,IAAA,SAAA,EAAA;AACA,IAAA,QAAA,CAAA,IAAA,GAAA,CAAA,EAAA,SAAA,CAAA,CAAA;AACA,IAAA,yBAAA,CAAA,QAAA,EAAA,EAAA,CAAA,gCAAA,GAAA,MAAA,EAAA,CAAA;AACA,EAAA;AACA;;;;"} |
| // This is a magic string replaced by rollup | ||
| const SDK_VERSION = "10.53.0" ; | ||
| const SDK_VERSION = "10.53.1" ; | ||
| export { SDK_VERSION }; | ||
| //# sourceMappingURL=version.js.map |
@@ -47,9 +47,9 @@ /** | ||
| export declare const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = "sentry.sdk.version"; | ||
| /** The user ID (gated by sendDefaultPii) */ | ||
| /** The user ID */ | ||
| export declare const SEMANTIC_ATTRIBUTE_USER_ID = "user.id"; | ||
| /** The user email (gated by sendDefaultPii) */ | ||
| /** The user email */ | ||
| export declare const SEMANTIC_ATTRIBUTE_USER_EMAIL = "user.email"; | ||
| /** The user IP address (gated by sendDefaultPii) */ | ||
| /** The user IP address */ | ||
| export declare const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = "user.ip_address"; | ||
| /** The user username (gated by sendDefaultPii) */ | ||
| /** The user username */ | ||
| export declare const SEMANTIC_ATTRIBUTE_USER_USERNAME = "user.name"; | ||
@@ -56,0 +56,0 @@ /** |
@@ -47,9 +47,9 @@ /** | ||
| export declare const SEMANTIC_ATTRIBUTE_SENTRY_SDK_VERSION = "sentry.sdk.version"; | ||
| /** The user ID (gated by sendDefaultPii) */ | ||
| /** The user ID */ | ||
| export declare const SEMANTIC_ATTRIBUTE_USER_ID = "user.id"; | ||
| /** The user email (gated by sendDefaultPii) */ | ||
| /** The user email */ | ||
| export declare const SEMANTIC_ATTRIBUTE_USER_EMAIL = "user.email"; | ||
| /** The user IP address (gated by sendDefaultPii) */ | ||
| /** The user IP address */ | ||
| export declare const SEMANTIC_ATTRIBUTE_USER_IP_ADDRESS = "user.ip_address"; | ||
| /** The user username (gated by sendDefaultPii) */ | ||
| /** The user username */ | ||
| export declare const SEMANTIC_ATTRIBUTE_USER_USERNAME = "user.name"; | ||
@@ -56,0 +56,0 @@ /** |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"semanticAttributes.d.ts","sourceRoot":"","sources":["../../src/semanticAttributes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,kBAAkB,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAE1E;;;;;GAKG;AACH,eAAO,MAAM,oDAAoD,sCAAsC,CAAC;AAExG;;GAEG;AACH,eAAO,MAAM,4BAA4B,cAAc,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,gCAAgC,kBAAkB,CAAC;AAEhE,4CAA4C;AAC5C,eAAO,MAAM,iDAAiD,mCAAmC,CAAC;AAElG,sEAAsE;AACtE,eAAO,MAAM,0CAA0C,4BAA4B,CAAC;AAEpF,uEAAuE;AACvE,eAAO,MAAM,2CAA2C,6BAA6B,CAAC;AAEtF,6CAA6C;AAC7C,eAAO,MAAM,iCAAiC,mBAAmB,CAAC;AAClE,0EAA0E;AAC1E,eAAO,MAAM,qCAAqC,uBAAuB,CAAC;AAC1E,4CAA4C;AAC5C,eAAO,MAAM,sCAAsC,wBAAw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,MAAM,gCAAgC,2BAA2B,CAAC"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"captureSpan.d.ts","sourceRoot":"","sources":["../../../../src/tracing/spans/captureSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAiB3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAY7F,MAAM,MAAM,qCAAqC,GAAG,sBAAsB,GAAG;IAC3E,YAAY,EAAE,IAAI,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,qCAAqC,CAqD7F;AAOD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACpD,IAAI,CAQN;AA+BD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,gBAAgB,EACtB,cAAc,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,gBAAgB,GAC3D,gBAAgB,CAOlB;AAMD;;;;;;;GAOG;AACH,+BAA+B;AAC/B,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAmCnG"} | ||
| {"version":3,"file":"captureSpan.d.ts","sourceRoot":"","sources":["../../../../src/tracing/spans/captureSpan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAiB3C,OAAO,KAAK,EAAE,sBAAsB,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAY7F,MAAM,MAAM,qCAAqC,GAAG,sBAAsB,GAAG;IAC3E,YAAY,EAAE,IAAI,CAAC;CACpB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,qCAAqC,CAqD7F;AAOD;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,gBAAgB,EAC1B,aAAa,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACpD,IAAI,CAQN;AA2BD;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,gBAAgB,EACtB,cAAc,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,gBAAgB,GAC3D,gBAAgB,CAOlB;AAMD;;;;;;;GAOG;AACH,+BAA+B;AAC/B,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAmCnG"} |
+10
-2
| { | ||
| "name": "@sentry/core", | ||
| "version": "10.53.0", | ||
| "version": "10.53.1", | ||
| "description": "Base implementation for all Sentry JavaScript SDKs", | ||
@@ -15,3 +15,5 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
| "browser.js", | ||
| "server.js" | ||
| "browser.d.ts", | ||
| "server.js", | ||
| "server.d.ts" | ||
| ], | ||
@@ -58,2 +60,8 @@ "main": "build/cjs/index.js", | ||
| "build/types-ts3.8/index.d.ts" | ||
| ], | ||
| "browser": [ | ||
| "build/types-ts3.8/browser.d.ts" | ||
| ], | ||
| "server": [ | ||
| "build/types-ts3.8/server.d.ts" | ||
| ] | ||
@@ -60,0 +68,0 @@ } |
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 7 instances in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1724
0.12%7051815
-0.01%