-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Description
Not sure if it's an issue. I'm using newrelic-react-native-agent as a New Relic agent in my React Native project. When viewing the distributed tracing for my mobile app in the New Relic dashboard (Production), I notice that some tracing requests have unusually high trace duration times.
After debugging locally, I can confirm that my HTTP requests do not take that long, and the test distributed tracing logs reflect the correct durations. However, I can reproduce the issue by opening the app and suddenly putting it into the background.
In the Timeline view of the high trace duration events, I see a blank time gap between the start span and end span, which seems to correspond to the time the app was in the background.
Context
- React Native version: 0.75.3
- newrelic-react-native-agent version: 1.5.5
- Platform: iOS
- Background fetch: Enabled
Expected Behavior
The trace duration time should reflect the actual HTTP request time, even if the app transitions to the background during the request.
Observed Behavior
- Trace duration times are significantly inflated when the app transitions to the background during an HTTP request.
- In the Timeline view, there is a blank time gap between the start span and end span, which seems to correspond to the time the app was in the background.
Questions
- Does the trace duration time also include UI interaction or other app lifecycle events?
- If I want to track only the HTTP request time for mobile, should I use custom events instead of relying on
noticeHttpTransaction?
Steps to Reproduce
- Open the app and initiate an HTTP request.
- Immediately put the app into the background while the request is in progress.
- Bring the app back to the foreground and observe the distributed tracing logs in the New Relic dashboard.
Additional Notes
- The issue seems to occur because the app transitions to the background, and the trace duration includes the time the app was paused.
- I have tried to disabled these configurations:
interactionTracingEnabled,webViewInstrumentation
