Is there an existing issue for this?
Which plugins are affected?
Performance
Which platforms are affected?
Android
Description
The Firebase docs for Flutter state:
"Performance Monitoring automatically collects metrics for network requests that use HttpClient.enableTimelineLogging."
https://firebase.google.com/docs/perf-mon/network-traces?platform=flutter
On Android, requests made with Dart's dart:io HttpClient (via package:http's default IOClient, used by Chopper and by image loading) are not reported, even with HttpClient.enableTimelineLogging = true. Requests made by native SDKs in the same app (Facebook SDK, MoEngage) are reported.
Expected: a Logging network request trace: <url> (responseCode: ..., responseTime: ...) line for each Dart-side request, as the docs describe.
Actual: only native SDK traffic is logged, for example:
I FirebasePerformance: Logging network request trace: https://graph.facebook.com/v24.0/<id>/activities (responseCode: 200, responseTime: 470.825ms)
No lines appear for the app's own Chopper / http requests or image loads.
Questions
- Is automatic collection of
dart:io requests actually supported, and if so, under what conditions?
- If not, the docs sentence should be corrected (or point to
HttpMetric), and it may belong in firebase-docs rather than this repo.
Reproducing the issue
- Add
firebase_performance, apply the com.google.firebase.firebase-perf Gradle plugin (1.4.2), and add to AndroidManifest.xml inside <application>:
<meta-data android:name="firebase_performance_logcat_enabled" android:value="true" />
- In
main(), after Firebase.initializeApp(...): HttpClient.enableTimelineLogging = true;
- Make API calls with
package:http (default client) / Chopper (no custom client: passed), and load network images.
- Run
adb logcat -s FirebasePerformance on a debug build on an Android device.
- Observe that only native SDK traffic is logged; no traces appear for the Dart-side requests.
Firebase Core version
4.14.0
Flutter Version
3.47.5
Relevant Log Output
Flutter dependencies
firebase_performance 0.11.6, firebase_core 4.14.0, http ^1.2.1, chopper ^8.7.0 (default http.Client, no custom client)
Additional context and comments
No response
Is there an existing issue for this?
Which plugins are affected?
Performance
Which platforms are affected?
Android
Description
The Firebase docs for Flutter state:
On Android, requests made with Dart's
dart:ioHttpClient(viapackage:http's defaultIOClient, used by Chopper and by image loading) are not reported, even withHttpClient.enableTimelineLogging = true. Requests made by native SDKs in the same app (Facebook SDK, MoEngage) are reported.Expected: a
Logging network request trace: <url> (responseCode: ..., responseTime: ...)line for each Dart-side request, as the docs describe.Actual: only native SDK traffic is logged, for example:
No lines appear for the app's own Chopper /
httprequests or image loads.Questions
dart:iorequests actually supported, and if so, under what conditions?HttpMetric), and it may belong in firebase-docs rather than this repo.Reproducing the issue
firebase_performance, apply thecom.google.firebase.firebase-perfGradle plugin (1.4.2), and add toAndroidManifest.xmlinside<application>:main(), afterFirebase.initializeApp(...):HttpClient.enableTimelineLogging = true;package:http(default client) / Chopper (no customclient:passed), and load network images.adb logcat -s FirebasePerformanceon a debug build on an Android device.Firebase Core version
4.14.0
Flutter Version
3.47.5
Relevant Log Output
Flutter dependencies
firebase_performance 0.11.6, firebase_core 4.14.0, http ^1.2.1, chopper ^8.7.0 (default http.Client, no custom client)
Additional context and comments
No response