Skip to content

[firebase_performance]: Network requests made via dart:io HttpClient are not collected automatically on Android, contrary to docs #18762

Description

@naveenthontepu

Is there an existing issue for this?

  • I have searched the existing issues.

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

  1. 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" />
  2. In main(), after Firebase.initializeApp(...): HttpClient.enableTimelineLogging = true;
  3. Make API calls with package:http (default client) / Chopper (no custom client: passed), and load network images.
  4. Run adb logcat -s FirebasePerformance on a debug build on an Android device.
  5. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs AttentionThis issue needs maintainer attention.type: bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions