sentry-module: SSR tracing won't working

What’s wrong with my config? SSR tracing won’t working, so I separated DSN for easy debug.

Version

@nuxtjs/sentry: 7.0.4 nuxt: 2.15.8

Sentry configuration

  sentry: {
    dsn: true, // for canInitialize
    clientConfig: {
        dsn: process.env.SENTRY_CLIENT_DSN, // VueJS project
    },    
    serverConfig: {
      dsn: process.env.SENTRY_SERVER_DSN, // NodeJS project
      transport: makeNodeTransport,
    },
    lazy: false,
    disabled: false,
    tracing: {
      tracesSampleRate: 1.0,
      vueOptions: {
        tracing: true,
        tracingOptions: {
          hooks: ['mount', 'update'],
          timeout: 2000,
          trackComponents: true
        }
      },
      browserOptions: {}
    },
    config: {
      environment: 'codesandbox',
    },
  }

Reproduction Link

https://codesandbox.io/p/sandbox/elated-borg-9im5b7?file=%2Fnuxt.config.ts&selection=[{"endColumn"%3A17%2C"endLineNumber"%3A73%2C"startColumn"%3A17%2C"startLineNumber"%3A73}]

(I can provide access for trial sentry projects if needed)

Steps to reproduce

Load page, then move to about page

What is Expected?

Both client and server tracing is collected

What is actually happening?

Only client tracing is collected

image image

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

Nuxt 2 doesn’t come with axios.

But maybe it it still makes sense to include an optional plugin like that. Though I’m afraid that it would be too restrictive. It’s probably better to document this instead and let user manually handle it.

I’m trying to find backend/SSR bottle-necks (slow render components, slow api’s e.t.c.)

I don’t think server tracing will give you all that information. Maybe it will tell you about slow APIs but for slow components the profiling might be more like what you need - https://docs.sentry.io/platforms/node/profiling/

EDIT: although even with profiling you will probably not have that good visibility into the components.

Fixing in https://github.com/nuxt-community/sentry-module/pull/517

Note that you config has some invalid values (or in wrong places). It can be simplified to:

  sentry: {
    dsn: true, // for canInitialize
    clientConfig: {
      dsn:
        '...',
    },
    serverConfig: {
      dsn:
        '...',
    },
    lazy: false,
    disabled: false,
    tracing: {
      tracesSampleRate: 1.0,
    },
    config: {
      environment: 'codesandbox',
      debug: true,
    },
  },

I found an issue in the code. Will hopefully have a fix soon.