RUM Resource Event Mapper is not called sometimes
Describe the bug
In our 2 Flutter applications, we are using the Datadog SDK to monitor Real User Monitoring (RUM) events. We have implemented a resource event mapper to filter query parameters from the RUM resource events.
RumResourceEvent? _mapRumResourceEvent({
required RumResourceEvent event,
}) {
String finalUrl = event.resource.url;
if (event.resource.type == RumResourceType.native) {
final uri = Uri.tryParse(event.resource.url);
if (uri != null) {
if (_isExcludedResource(event.resource)) {
return null;
}
// remove query params
final url = '${uri.origin}${uri.path}';
finalUrl = _maskUrl(url, method: event.resource.method);
}
}
return event.copyWith(
resource: event.resource.copyWith(
url: finalUrl,
),
);
}
We have observed that the resource event mapper is not consistently called for all resource events.
We would appreciate any insights into why this issue happened. If there are any additional steps we can take to debug or resolve this issue, please let us know.
Thank you.
Reproduction steps
We are unable to reliably reproduce this issue since the issue is intermitten
SDK logs
No response
Expected behavior
No response
Affected SDK versions
2.5.0, 2.6.0
Latest working SDK version
No response
Did you confirm if the latest SDK version fixes the bug?
No
Flutter Version
3.19.6
Setup Type
No response
Device Information
No response
Other relevant information
No response
Hi @hakivin,
Do you know if this seems to happen more often on iOS or Android?
Also, if you haven't yet, can you please open a support issue with Datadog and point them to this issue? I'd like to take a look and see if I'm seeing any telemetry from your org that might point to the potential problem.
Thanks!
it is only happened in Android.
I have just submitted a support ticket. Thank you.
Hi @hakivin ,
Really quick, do you have any background services or multiple flutter engines being created on Android? I'm seeing one error I expected, but a second that I wasn't.
I don't think our apps are creating multiple Flutter engines or running any background services. May I know about the error you're seeing? I suspect it might be related to a background process as well.
Hi @fuzzybinary, after further investigation, I discovered that an additional Flutter engine instance is being created by Firebase Messaging. This occurs specifically within the following code.
Okay, that makes more sense now. I'll hopefully have a solution for you soon.
Thanks for reporting!
Hi,
This should now be fixed in 2.8.0. We've raised the timeout for processing mappers and multiple flutter engines should no longer cause issues for the mappers. Let me know if you continue to see issues.