firebase / firebase/firebase-ios-sdk

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

Open
#11,861 11 comments 5 reactions 0 assignees View on GitHub
api: performance needs-attention type: feature request
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### 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

```swift
// ❌ 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.