File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
packages/nuxt/src/runtime Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ export default defineNitroPlugin(nitroApp => {
5757
5858 // @ts -expect-error - 'render:html' is a valid hook name in the Nuxt context
5959 nitroApp . hooks . hook ( 'render:html' , ( html : NuxtRenderHTMLContext ) => {
60- addSentryTracingMetaTags ( html . head ) ;
60+ const sentryClient = SentryNode . getClient ( ) ;
61+ addSentryTracingMetaTags ( html . head , sentryClient ?. getOptions ( ) . debug ) ;
6162 } ) ;
6263} ) ;
6364
Original file line number Diff line number Diff line change 11import type { ClientOptions , Context } from '@sentry/core' ;
2+ import { consoleSandbox } from '@sentry/core' ;
23import { captureException , getClient , getTraceMetaTags } from '@sentry/core' ;
34import type { VueOptions } from '@sentry/vue/src/types' ;
45import type { CapturedErrorContext } from 'nitropack' ;
@@ -33,10 +34,16 @@ export function extractErrorContext(errorContext: CapturedErrorContext | undefin
3334 *
3435 * Exported only for testing
3536 */
36- export function addSentryTracingMetaTags ( head : NuxtRenderHTMLContext [ 'head' ] ) : void {
37+ export function addSentryTracingMetaTags ( head : NuxtRenderHTMLContext [ 'head' ] , debug ?: boolean ) : void {
3738 const metaTags = getTraceMetaTags ( ) ;
3839
3940 if ( metaTags ) {
41+ if ( debug ) {
42+ consoleSandbox ( ( ) => {
43+ // eslint-disable-next-line no-console
44+ console . log ( '[Sentry] Adding Sentry tracing meta tags to HTML page:' , metaTags ) ;
45+ } ) ;
46+ }
4047 head . push ( metaTags ) ;
4148 }
4249}
You can’t perform that action at this time.
0 commit comments