Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normalizeDepth doesn't have any effect #697

Open
simon-ccoms opened this issue Sep 26, 2024 · 2 comments
Open

normalizeDepth doesn't have any effect #697

simon-ccoms opened this issue Sep 26, 2024 · 2 comments
Labels

Comments

@simon-ccoms
Copy link

Version

@nuxtjs/sentry: 8.7.0
nuxt: 2.17.0

Sentry configuration

sentry: {
    dsn: process.env.SENTRY_DSN,
    clientIntegrations: {
      ExtraErrorData: {},
      ReportingObserver: { types: ['crash'] },
      HttpClient: true
    },
    config: {
      // Capture headers and cookies
      sendDefaultPii: true,

      normalizeDepth: 5,
    },
  },

Steps to reproduce

Use the above config on a route which returns a response with more than 3 levels of data in it.

What is Expected?

At least 5 levels of the data should appear on the Sentry issue.

What is actually happening?

The default value of 3 is always used, no matter what value is put into the sentry config.

@rchl
Copy link
Member

rchl commented Sep 27, 2024

It works here with a manually triggered exception like this:

      this.$sentry.withScope((scope) => {
        scope.setExtra('x', {
          1: {
            2: {
              3: {
                4: {
                  5: {
                    6: {
                      7: {
                        8: {
                          9: {},
                        },
                      },
                    },
                  },
                },
              },
            },
          },
        })
        scope.captureException(new Error('Some error'))
      })

You might need to specify your problem in more details. Ideally provide actual project that reproduces your issue.

@simon-ccoms
Copy link
Author

I'm not entirely sure what's going on but your code does show the correct depth in the Sentry dashboard.

The code that I'm using is as follows:-

try {
	await this.$axios.post('/api/tenants/contact/', {})
} catch (error) {
	this.$sentry.captureException(error)
}

where the API throws an HTTP 400 error whose response looks like this:-

{
	"recaptcha_token": [
		"This field is required."
	]
}

But Sentry only has the following in the error info:-

response: {
	data: {
		recaptcha_token: {
			[Array]
		}
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants