@@ -6,11 +6,12 @@ import { addChildSpanToSpan, getClient, getDefaultCurrentScope, getDefaultIsolat
66import { logger } from '@sentry/utils' ;
77
88import { DEBUG_BUILD } from './debug-build' ;
9+ import { SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE } from './semanticAttributes' ;
910import { SentrySpanExporter } from './spanExporter' ;
1011import { maybeCaptureExceptionForTimedEvent } from './utils/captureExceptionForTimedEvent' ;
1112import { getScopesFromContext } from './utils/contextData' ;
1213import { setIsSetup } from './utils/setupCheck' ;
13- import { setSpanParent , setSpanScopes } from './utils/spanData' ;
14+ import { setSpanScopes } from './utils/spanData' ;
1415
1516function onSpanStart ( span : Span , parentContext : Context ) : void {
1617 // This is a reliable way to get the parent span - because this is exactly how the parent is identified in the OTEL SDK
@@ -20,10 +21,14 @@ function onSpanStart(span: Span, parentContext: Context): void {
2021
2122 // We need access to the parent span in order to be able to move up the span tree for breadcrumbs
2223 if ( parentSpan ) {
23- setSpanParent ( span , parentSpan ) ;
2424 addChildSpanToSpan ( parentSpan , span ) ;
2525 }
2626
27+ // We need this in the span exporter
28+ if ( parentSpan && parentSpan . spanContext ( ) . isRemote ) {
29+ span . setAttribute ( SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE , true ) ;
30+ }
31+
2732 // The root context does not have scopes stored, so we check for this specifically
2833 // As fallback we attach the global scopes
2934 if ( parentContext === ROOT_CONTEXT ) {
0 commit comments