getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.64k stars 1.48k forks source link

web-vitals not logging - except INP #11677

Open rajat2502 opened 1 week ago

rajat2502 commented 1 week ago

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.107.0

Framework Version

Next 12.3.1, React 17.0.2

Link to Sentry event

No response

SDK Setup

import { browserTracingIntegration, init as initSentry } from '@sentry/nextjs';

initSentry({
  dsn: SENTRY_DSN,
  tracesSampleRate: 0.05,
  integrations: [
    browserTracingIntegration({
      enableInp: true,
    }),
  ],
});

Steps to Reproduce

  1. This started happening since we upgraded @sentry/nextjs to accommodate for the INP changes. Interestingly INP is logging correct but other web vitals are not showing up on the dashboard.

Expected Result

Should have all the web vitals.

Actual Result

Screenshot 2024-04-18 at 2 17 40 PM

Lms24 commented 1 week ago

Hey @rajat2502 thanks for writing in!

Any chance you're using the new de region in your Sentry organization/project? (If you didn't change anything in the past couple of weeks you're probably not using it) Also, you said you upgraded your Sentry SDK version. What was the version you used previously?

rajat2502 commented 1 week ago

I'm not sure what you mean by the de region, can you please link me to that? Although I'm sure we haven't changed anything in the last 2 weeks.

The earlier version of @sentry/nextjs was 7.14.2. I Interestingly, there is another project where we made the same changes and everything is logging as expected for that project.

rajat2502 commented 1 week ago

Both these projects lie in the same organisation (in case it helps)

AbhiPrasad commented 1 week ago

@rajat2502 we fixed some bugs around web vitals collection, could you try updating to the latest SDK version and checking the results?

rajat2502 commented 1 week ago

Yeah, we upgraded to the latest version of nextjs SDK but no luck so far.

AbhiPrasad commented 1 week ago

@rajat2502 I think this is just a case of sampling, you have way more interactions then you do pageloads, so the score is primarily made of of those samples.

You can either bump tracesSampleRate, or use interactionsSampleRate in https://github.com/getsentry/sentry-javascript/releases/tag/7.110.0 to sample down interactions (and less INP).

rajat2502 commented 1 week ago

Yeah, that might be the case, let me give it a try. I'm assuming there are no recommended sample rates for interaction as this would very from site to site?

rajat2502 commented 1 week ago

Unfortunately, even this didn't help. I had configured it to sample only 1% of INP samples. Should I try turning the enableInp flag to false?

Screenshot 2024-04-20 at 7 18 20 PM
lforst commented 1 week ago

@rajat2502 are you using the tunnelRoute option? If so, can you try turning it off?