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

Segregation of native and JS breadcrumbs #994

Closed
6 of 11 tasks
awinograd opened this issue Jul 26, 2020 · 5 comments
Closed
6 of 11 tasks

Segregation of native and JS breadcrumbs #994

awinograd opened this issue Jul 26, 2020 · 5 comments

Comments

@awinograd
Copy link
Contributor

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 1.4.2

react-native version: 0.63.1

Are you using Expo?

  • Yes (bare workflow)
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

https://sentry.io/organizations/oui/issues/1806688837/?project=1512711&referrer=slack

Configuration:

(@sentry/react-native)

  Sentry.init({
    environment: environment,
    dsn: SENTRY_DSN,
    maxBreadcrumbs: 100,
    enableAutoSessionTracking: true,
    beforeBreadcrumb(breadcrumb, hint) {
      const is204 =
        breadcrumb.category === 'xhr' &&
        breadcrumb.data?.url === 'https://clients3.google.com/generate_204' &&
        breadcrumb.data?.status_code === 204;
      return is204 ? null : breadcrumb;
    },
    integrations = [
    ...((options.integrations as []) || []),
    new Sentry.Integrations.ReactNativeErrorHandlers({
      onerror: false,
      onunhandledrejection: true,
    }),
    new ExpoIntegration(),
    new RewriteFrames({
      iteratee: (frame) => {
        if (frame.filename) {
          frame.filename = normalizeUrl(frame.filename);
        }
        return frame;
      },
    }),
  ]
  });

I have following issue:

When a sentry message / error is recorded, the associated breadcrumbs don't appear in a linear timeline as expected. Rather, the JS breadcrumbs all happen linearly, and the native breadcrumbs happen linearly, offset by a few hours. As a result, in the sentry UI, the JS breadcrumbs and native breadcrumbs are not interleaved.

Steps to reproduce:

  • Enable native integration (which records default breadcrumbs)
  • Run through an app with JS breadcrumbs
  • Capture a message / error

Actual result:

JS breadcrumb 1
JS breadcrumb 2
JS breadcrumb 3
Native breadcrumb 1
Native breadcrumb 2
Native breadcrumb 3

Expected result:

JS breadcrumb 1
Native breadcrumb 1
JS breadcrumb 2
Native breadcrumb 2
JS breadcrumb 3
Native breadcrumb 3

@jennmueng
Copy link
Member

@awinograd When you mentioned

offset by a few hours

does this mean one or the other is incorrectly timestamped? This is an issue with some events that we've noticed from the past week or so where they are incorrectly timestamped. This could be a side effect of that.

@awinograd
Copy link
Contributor Author

awinograd commented Jul 27, 2020 via email

@danmaas
Copy link

danmaas commented Jul 31, 2020

I am also seeing weird segregation of breadcrumbs. In my case, the timestamps on each breadcrumb do appear to be correct, but in the Sentry web UI, the breadcrumbs are not all listed in sorted time order.

Here is an example issue showing this problem: https://sentry.io/share/issue/f1a08e268b30480781221e669c776874/ (note: the breadcrumbs will probably only be visible to Sentry staff, via the "Details" view).

The linked issue is from my React Native app running in production on Android, using @sentry/react-native version 1.6.3. It's emitting breadcrumbs both in JavaScript and in Java code.

In the Sentry web UI, after clicking "Show 191 collapsed crumbs" to show all breadcrumbs, I see the following sequence of timestamps:

18:35:17
...
18:35:48

18:35:17
...
18:35:48

There are two distinct "runs" of breadcrumbs. Each "run" appears to be in sorted order. It looks to me like the first "run" includes only JavaScript breadcrumbs, while the second "run" includes a duplicate copy of all the JavaScript breadcrumbs, plus the Java breadcrumbs.

@StarryFire
Copy link

Any updates on this?

@jennmueng
Copy link
Member

This has now been fixed in the latest release. https://github.com/getsentry/sentry-react-native/releases/tag/1.8.1

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

No branches or pull requests

4 participants