sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

Manual TTID/TTFD API times out

Open serglom21 opened this issue 1 year ago • 20 comments

Platform:

  • [x] iOS

SDK:

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

SDK version: 5.22.0

react-native version: 0.72.3

Are you using Expo?

  • [ ] Yes
  • [x] No

Are you using sentry.io or on-premise?

  • [x] sentry.io (SaaS)
  • [ ] on-premise

Configuration:

export const routingInstrumentation = new Sentry.ReactNavigationInstrumentation(
  {
    enableTimeToInitialDisplay: true,
  },
);


Sentry.init({
  environment: 'development'
  sampleRate: 1.0,
  tracesSampleRate: 0.1,
  enableAppHangTracking: false,
  integrations: [
    new Sentry.ReactNativeTracing({
      routingInstrumentation,
      tracePropagationTargets: [currentConfig.DOMAIN],
    }),
  ],
});

I have the following issue:

I am seeing some inconsistencies in the data reported and what should be reported based on the SDK behaviour. For example, it is odd to me that some transactions are being marked as 'deadline_exceeded' when they do not exceed the default value for [finalTimeoutMs]. finalTimeoutMs is also not being overridden in the init code block

The default for finalTimeoutMs is 600000ms or 10mins, which is way above what the transactions being marked deadline_exceeded are reporting. The amount of failed transactions with this status seems to have increased after updating the SDK version from 5.3.0 to 5.22.0

More details with links to examples in the Customer Case

serglom21 avatar Jul 09 '24 00:07 serglom21

Hi @serglom21, thank you for the message,

I agree, it doesn't sound right, that these transaction are marked as deadline_exceeded. I'll take a look at the examples and keep you updated.

krystofwoldrich avatar Jul 10 '24 15:07 krystofwoldrich

Are you using something on the screens with deadline_exceeded a code called Stack.Navigator to switch between different pages? You can usually find it by looking for the term <Stack.Navigator> in your code

lucas-zimerman avatar Aug 19 '24 17:08 lucas-zimerman

Are you using something on the screens with deadline_exceeded a code called Stack.Navigator to switch between different pages? You can usually find it by looking for the term <Stack.Navigator> in your code

Yep, we are using the Stack.Navigator.

julianosbentowellhub avatar Aug 19 '24 17:08 julianosbentowellhub

Hi, I found a potential fix for your case and a solution will be implemented soon on the SDK.

lucas-zimerman avatar Aug 22 '24 20:08 lucas-zimerman

Hi, I found a potential fix for your case and a solution will be implemented soon on the SDK.

@lucas-zimerman thanks a lot for it, we are expecting to solve this issue ASAP to normalize our failure_rate metrics. When you had an stable version with the fix, could you share it here, pls?

julianosbentowellhub avatar Aug 22 '24 21:08 julianosbentowellhub

@julianosbentowellhub definitely, we'll update here when the fix is verified and released.

kahest avatar Aug 26 '24 14:08 kahest

@kahest same issue here: deadline_exceeded on all route change using react native Stack.Navigator.

Here is our configuration:

Sentry.init({
  dsn: '...',
  debug: true,
  environment: ENV.APP_ENV,
  tracesSampleRate: 1,
  enableNative: true,
  sampleRate: 1,
  attachStacktrace: true,
  ignoreErrors: [
    /.*[Network error]: Error: Socket closed.*/i,
    /.*Socket closed.*/i
  ],
  _experiments: {
    profilesSampleRate: 1
  },
  enableAutoPerformanceTracing: true,
  integrations: [
    new Sentry.ReactNativeTracing({
      enableUserInteractionTracing: true,
      enableStallTracking: true,
      enableHTTPTimings: true,
      enableAppStartTracking: true,
      maxTransactionDuration: 600 * 1000,
      enableNativeFramesTracking: true,
      routingInstrumentation: {  
          enableTimeToInitialDisplay: true,
          routeChangeTimeoutMs: 6000  
       }
    })
  ]
});

Image

jimmysafe avatar Sep 11 '24 14:09 jimmysafe

Hi @jimmysafe, thank you for the message,

are there any specific span in the transactions, which are causing the deadline_exceeded? For example the Time To Display spans?

krystofwoldrich avatar Sep 12 '24 11:09 krystofwoldrich

Hi @krystofwoldrich

The span which hangs and fails is the navigation span, i guess the issue is related to the fact we are using the <Stack.Navigator> in react native.

Also the Time to inital display is affected too by being always cancelled.

Image

Please let me know if you need more info :)

jimmysafe avatar Sep 13 '24 07:09 jimmysafe

@jimmysafe Thank you for the confirmation,

  • this will be fixed by https://github.com/getsentry/sentry-react-native/pull/4042

At the moment you can use manual TTID APIs https://docs.sentry.io/platforms/react-native/tracing/instrumentation/time-to-display/#time-to-initial-display-overwrite as a workaround or temporarly disable the feature.

krystofwoldrich avatar Sep 13 '24 10:09 krystofwoldrich

Even with manual ttids we see 80% cancelled or deadline_exceeded with 15s duration.

On Fri, Sep 13, 2024, 7:00 a.m. Krystof Woldrich @.***> wrote:

@jimmysafe https://github.com/jimmysafe Thank you for the confirmation,

At the moment you can use manual TTID APIs https://docs.sentry.io/platforms/react-native/tracing/instrumentation/time-to-display/#time-to-initial-display-overwrite as a workaround or temporarly disable the feature.

— Reply to this email directly, view it on GitHub https://github.com/getsentry/sentry-react-native/issues/3934#issuecomment-2348660631, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALJE44WVUOPKNYGEXVIMYTZWLATBAVCNFSM6AAAAABKRZZVU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBYGY3DANRTGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

sregg avatar Sep 13 '24 11:09 sregg

Hi @sregg, thank for the message,

are you experiencing this on iOS or Android?

Note I saw iOS in https://github.com/getsentry/sentry-react-native/issues/3786

Are you able to reproduce it locally? Would you be able to share a reproducible example?

krystofwoldrich avatar Sep 13 '24 11:09 krystofwoldrich

iOS and Android. It's mostly in the wild from now but I can try to repro locally. I believe last time I was seeing that when I would navigate back to the screen. I'll report back.

sregg avatar Sep 13 '24 11:09 sregg

Also, is it normal that the status is unknown when it's not timing out? Image Here's our home screen for example: Image

sregg avatar Sep 13 '24 14:09 sregg

I'm able to repro the deadline_exceeded and the 15s timeout every time I navigate back to a screen Image

sregg avatar Sep 13 '24 14:09 sregg

@sregg same here, we get tons of unknown status and i can confirm that even by using the <Sentry.TimeToInitialDisplay record={true} /> the issue of of deadline_exceeded persists.

jimmysafe avatar Sep 13 '24 16:09 jimmysafe

Thank you both for the reports, we're working on this. Which versions of the SDK are you using?

kahest avatar Sep 16 '24 09:09 kahest

Thank you both for the reports, we're working on this. Which versions of the SDK are you using?

v5.31.1

sregg avatar Sep 16 '24 12:09 sregg

@kahest any news on this fix?

jimmysafe avatar Oct 01 '24 07:10 jimmysafe

Hi @jimmysafe, we are still looking into this.

krystofwoldrich avatar Oct 07 '24 14:10 krystofwoldrich