MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / shouldNoopSpan

Function shouldNoopSpan

packages/nextjs/src/common/utils/nextSpan.ts:14–23  ·  view source on GitHub ↗
(callback?: T & Partial<ServerReference>)

Source from the content-addressed store, hash-verified

12import { isUseCacheFunction } from './isUseCacheFunction';
13
14function shouldNoopSpan<T>(callback?: T & Partial<ServerReference>): boolean {
15 const isBuildContext = isBuild();
16 const isUseCacheFunctionContext = callback ? isUseCacheFunction(callback) : false;
17
18 if (isUseCacheFunctionContext) {
19 DEBUG_BUILD && debug.log('Skipping span creation in Cache Components context');
20 }
21
22 return isBuildContext || isUseCacheFunctionContext;
23}
24
25function createNonRecordingSpan(): Span {
26 return new SentryNonRecordingSpan({

Callers 3

startSpanFunction · 0.85
startSpanManualFunction · 0.85
startInactiveSpanFunction · 0.85

Calls 3

isBuildFunction · 0.90
isUseCacheFunctionFunction · 0.90
logMethod · 0.65

Tested by

no test coverage detected