Skip to content

Commit 0a5f568

Browse files
committed
add comments
1 parent 891b480 commit 0a5f568

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

packages/opentelemetry/src/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ export const SENTRY_TRACE_STATE_URL = 'sentry.url';
99
export const SENTRY_TRACE_STATE_SAMPLE_RAND = 'sentry.sample_rand';
1010
export const SENTRY_TRACE_STATE_SAMPLE_RATE = 'sentry.sample_rate';
1111

12+
// NOTE: `@sentry/nextjs` has a local copy of this context key for Edge bundles:
13+
// - `packages/nextjs/src/edge/index.ts` (`SENTRY_SCOPES_CONTEXT_KEY`)
14+
//
15+
// If you change the key name passed to `createContextKey(...)`, update that file too.
1216
export const SENTRY_SCOPES_CONTEXT_KEY = createContextKey('sentry_scopes');
1317

1418
export const SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY = createContextKey('sentry_fork_isolation_scope');

packages/opentelemetry/src/utils/contextData.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ const SCOPE_CONTEXT_FIELD = '_scopeContext';
1111
* This requires a Context Manager that was wrapped with getWrappedContextManager.
1212
*/
1313
export function getScopesFromContext(context: Context): CurrentScopes | undefined {
14+
// NOTE: `@sentry/nextjs` has a local copy of this helper for Edge bundles:
15+
// - `packages/nextjs/src/edge/index.ts` (`getScopesFromContext`)
16+
//
17+
// If you change how scopes are stored/read (key or retrieval), update that file too.
1418
return context.getValue(SENTRY_SCOPES_CONTEXT_KEY) as CurrentScopes | undefined;
1519
}
1620

packages/opentelemetry/src/utils/isSentryRequest.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import { spanHasAttributes } from './spanTypes';
99
* @returns boolean
1010
*/
1111
export function isSentryRequestSpan(span: AbstractSpan): boolean {
12+
// NOTE: `@sentry/nextjs` has a local copy of this helper for Edge bundles:
13+
// - `packages/nextjs/src/common/utils/dropMiddlewareTunnelRequests.ts` (`isSentryRequestSpan`)
14+
//
15+
// If you change supported OTEL attribute keys or request detection logic, update that file too.
1216
if (!spanHasAttributes(span)) {
1317
return false;
1418
}

0 commit comments

Comments
 (0)