Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

xamarin.firebase.perf implementation is not showing network call from the app #172

Open
akankshajain00 opened this issue Dec 23, 2018 · 15 comments
Assignees

Comments

@akankshajain00
Copy link

akankshajain00 commented Dec 23, 2018

Hey, I am using Xamarin.Firebase.Pref stable version 60.1142.1 in my app. So after the integration of this NuGet package firebase console is showing some default traces like app_start, app_foregroung and app_background, but it's not showing the other default traces like network calls and API calls.

I have also implemented the firebase performance monitoring NuGet package for my ios app and all the default traces for ios is working fine because I followed the instructions given in the readme for that package.

But for android as such, there are no instructions to follow and it's written on the firebase performance monitoring native integration that all the network calls will come up by default when we will integrate the SDK.

So I am not sure in the NuGet package for Android(Xamarin.Firebase.Pref)) includes the traces for network calls by default or not.

Can somebody please look into this and let me know how can I get network call traces for my android app. Any help will be highly appreciated.

VS bug #760354

@akankshajain00
Copy link
Author

Hey @Redth can you please provide me solution for this.

@Redth Redth added needs-info More information is requested by engineering azdo-sync Azure DevOps Sync labels Jan 3, 2019
@Redth
Copy link
Member

Redth commented Jan 3, 2019

Make sure you're not using the default .NET managed HttpClient handler since Firebase would have no way to inspect network traffic through this handler.

See this doc for more information: https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/http-stack?tabs=windows

@akankshajain00
Copy link
Author

Hey @Redth thank you for your response. in our app we are using AndroidClientHandler for Android app and for ios we are using NSUrlSessionHandler for which network traffic is capturing fine.

@Redth Redth removed the needs-info More information is requested by engineering label Jan 4, 2019
@moljac
Copy link
Member

moljac commented Jan 4, 2019

@akankshajain00

Could you provide minimal sample, so I (we) can debug and investigate this issue. Namely without a sample it will take quite a lot of time to create it.

Moving this into LowPriority until the sample is created or obtained.

@akankshajain00
Copy link
Author

Okay, I will create a sample and will provide you.

@moljac
Copy link
Member

moljac commented Jan 14, 2019

Moving to low priority until sample is available.

@jldubz
Copy link

jldubz commented Jan 31, 2019

I am also encountering this issue. iOS firebase performance monitoring reports all of my network calls as expected, but I am receiving nothing on the Android side aside from UI draw times. I can tell you that we are using the Android HttpClient implementation.

I am happy to create a sample project to demonstrate this. What is the best way to provide you with access to the Firebase reports to show that nothing is being received from Android if they are connected to my Google account?

@jldubz
Copy link

jldubz commented Feb 1, 2019

I have uploaded a simple Xamarin.Android Firebase Performance Monitoring Test App for your reference. Please let me know if there is anything else that you need.

Thanks.

@jldubz
Copy link

jldubz commented Feb 2, 2019

I have spent the last day running the sample app to try and generate as many network calls as I can. I have snapped some screenshots of the relevant pages from Firebase and uploaded them to the GitHub repo.

Firebase Performance Dashboard Screenshot

This shows that the application is reporting to Firebase performance on the app start trace, but...

Firebase Performance Network Screenshot

This tells me that none of the network calls being made are tracked.

@jldubz
Copy link

jldubz commented Feb 5, 2019

I have noticed another inconsistency in the reports on another set of applications that I manage that has the Firebase Performance Monitoring package implemented in both the iOS and Android versions. The "Slow Rendering by Screen" metric is not being tracked as expected on Android, but it is tracked correctly on iOS. I have blurred the names of classes for this project for privacy reasons.

Android:

Slow Rendering by Screen - Android

iOS:

Slow Rendering by Screen - iOS

@MatFillion
Copy link

We're also facing this issue and our observations are exactly the same as described in this issue.

It is worth noting that Firebase's documentation states that the automatic network performance monitoring requires the application to use OkHttp3 (Reference)

Sample app with OkHttp3

If it can be of any help. I am attaching a Xamarin.Forms sample app using OkHttp3.
Simply add your own googleservices json file to the project (I removed it) and make sure Build Action is googleservicesjson)
To trigger the http call, click on the "Learn More" Button in the About tab.
perf_okhttp.zip

Investigation steps / observations

I confirmed the SDK initialized properly via the Firebase console setup.
Default startup traces are showing but network traces are not. (exactly same results as @jldubz via the dashboard screenshots)
firebase_performance_logcat_enabled is set to true in debug via AssemblyInfo.cs and I don't see http logs in the logcat either. (On a native app I can see them instantly).
Sample:

@moljac
Copy link
Member

moljac commented Jul 11, 2019

Related #228

@moljac
Copy link
Member

moljac commented Jul 11, 2019

used https://github.com/jldubz/Xamarin-Android-Firebase-Performance-Test/tree/master

in samples under s1 folder name (to shorten paths for windows)

@DeVivres
Copy link

DeVivres commented Jul 7, 2021

Any update on the situation? Thank you.

@GalaxiaGuy
Copy link

After reading about it, I'm not sure this will work in Xamarin. It seems it uses byte code rewriting as part of the Gradle plugin to intercept calls, and I don't think that will be executed as part of a Xamarin build.

More info here: https://www.oliverbrown.me.uk/2021/09/07/solved-firebase-performance-monitoring-in-xamarin-android/

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

No branches or pull requests

7 participants