Skip to content

Some web vitals are missingΒ #14201

@RexSkz

Description

@RexSkz

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

Sentry Browser CDN bundle

SDK Version

8.37.0

Framework Version

React 17.0.2

Link to Sentry event

https://moego-ey.sentry.io/discover/homepage/?dataset=transactions&field=title&field=project&field=timestamp&field=measurements.fcp&field=measurements.cls&field=measurements.lcp&field=measurements.ttfb&field=measurements.fp&name=All%20Errors&project=4507922008702976&query=transaction.op%3Apageload&queryDataset=transaction-like&sort=-timestamp&statsPeriod=7d&yAxis=count%28%29

Reproduction Example/SDK Setup

Sentry.init({
  dsn: __SENTRY_DSN__,
  enabled,
  debug,
  environment,
  release,

  tracesSampleRate: 1,

  integrations: [
    window.Sentry.breadcrumbsIntegration({
      console: true,
      dom: { serializeAttribute: ['data-testid', 'data-slot'] },
      fetch: true,
      history: true,
      xhr: true,
    }),
    window.Sentry.browserTracingIntegration?.(),
    window.Sentry.extraErrorDataIntegration?.(),
  ],
  ignoreErrors: [
    'CanceledError',
    'ResizeObserver loop limit exceeded',
  ],
  beforeSend(event, hint) {
    const exception = event.exception?.values?.[0];
    if (
      exception &&
      exception.type === 'UnhandledRejection' &&
      exception.value === 'Object captured as promise rejection with keys: config, data, headers, request, status'
    ) {
      // already reportd in other libraries
      return null;
    }
    return event;
  },
});

Steps to Reproduce

Just open the page. But I noticed a scenario that may trigger the problem: our project will trigger a react-router change to add 2 queries immediately in the App's useEffect:

const history = useHistory();
history.push(`/current-path?query1=value1&query2=value2`);

Expected Result

FCP, LCP, and TTFB should be displayed correctly on the Web Vitals page.

Actual Result

They are missing, only an INP metric is displayed.

After some investigation, FCP, LCP and TTFB were generated, but for some reason, they aren't attached to the pageload event, instead of a navigation event.

Metadata

Metadata

Assignees

Projects

Status

Waiting for: Community

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions