Skip to content

[Swift Concurrency] Performance Monitoring does not collect network traces when using URLSession's async methods #11861

Open
@moyerr

Description

@moyerr

Description

I noticed that my app's network requests were not showing up at all in Performance Monitoring. I traced the issue to the fact that I am using URLSession's concurrency (async/await) APIs.

I can tell everything is set up properly because I can see the network traces when I use URLSession's closure-based APIs.

Reproducing the issue

// ❌ This network call does not show up in Performance Monitoring
let (data, response) = try await URLSession.shared.data(for: request)

// ✅ This network call does show up in Performance monitoring
URLSession.shared
  .dataTask(with: try request) { data, response, error in
    // Handle the response
  }
  .resume()

Firebase SDK Version

10.15.0

Xcode Version

14.3.1

Installation Method

Swift Package Manager

Firebase Product(s)

Performance

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions