diff --git a/src/hubextensions.ts b/src/hubextensions.ts index 675d26b7..32fe604d 100644 --- a/src/hubextensions.ts +++ b/src/hubextensions.ts @@ -106,10 +106,15 @@ export function __PRIVATE__wrapStartTransactionWithProfiling(startTransaction: S }, MAX_PROFILE_DURATION_MS); function profilingWrappedTransactionFinish() { - // @ts-expect-error profile is not a part of sdk metadata so we expect error until it becomes part of the official SDK. // onProfileHandler should always return the same profile even if this is called multiple times. // Always call onProfileHandler to ensure stopProfiling is called and the timeout is cleared. - transaction.setMetadata({ profile: onProfileHandler() }); + const profile = onProfileHandler(); + // If we receive a profile, set the logging mode that was used as a tag + if (profile) { + transaction.setTag('profiler_logging_mode', profile.profiler_logging_mode); + } + // @ts-expect-error profile is not a part of sdk metadata so we expect error until it becomes part of the official SDK. + transaction.setMetadata({ profile }); return originalFinish(); } diff --git a/src/utils.ts b/src/utils.ts index 17619a1e..f14764c4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -176,7 +176,7 @@ export function createProfilingEventEnvelope( timestamp: new Date(transactionStartMs).toISOString(), platform: 'node', version: '1', - release: event.sdk?.version || 'unknown', + release: event.sdk?.version || 'unknown' runtime: { name: 'node', version: process.versions.node