Skip to content

Commit

Permalink
ref(core): Reduce hasTracingEnabled size (#13232)
Browse files Browse the repository at this point in the history
Inlining the function removes the function declaration from the bundle.
  • Loading branch information
Lms24 authored Aug 6, 2024
1 parent ddff302 commit 7fc479f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/core/src/utils/hasTracingEnabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,8 @@ export function hasTracingEnabled(
return false;
}

const options = maybeOptions || getClientOptions();
const client = getClient();
const options = maybeOptions || (client && client.getOptions());
// eslint-disable-next-line deprecation/deprecation
return !!options && (options.enableTracing || 'tracesSampleRate' in options || 'tracesSampler' in options);
}

function getClientOptions(): Options | undefined {
const client = getClient();
return client && client.getOptions();
}

0 comments on commit 7fc479f

Please sign in to comment.