firebase / firebase-ios-sdk

Firebase SDK for Apple App Development
https://firebase.google.com
Apache License 2.0
5.59k stars 1.46k forks source link

[FR]: Add ability to choose which instrumentation happens through Firebase Performance, aka lifecycle events, but no URL Session Delegate method swizzling #12177

Open SwiftNativeDeveloper opened 10 months ago

SwiftNativeDeveloper commented 10 months ago

Description

I do not want method swizzling or inspection to occur on my networking code. Why? Well I don't want my URLs being uploaded, and I want the code to stay away from the request and response objects. From a privacy-by-design aspect, it is a much easier sell from a Software BOM to state 'firebase doesn't touch our networking code'. I have a product that only integrates with Firebase Performance and Crashlytics--and I want to remove any and all method swizzling that I can.

I can achieve this by disabling the automatic instrumentation before calling configure on the Firebase app. Great! Manual only instrumentation on URL Session! However, that then leaves the poor developer without the application lifecycle instrumentation too. Presently it is all or nothing. Having looked at the implementation of the lifecycle performance code, a third party developer using the SDK cannot replicate the behavior because it uses a ton of internal Firebase Trace API. https://github.com/firebase/firebase-ios-sdk/blob/master/FirebasePerformance/Sources/AppActivity/FPRAppActivityTracker.m

Please allow a developer to choose which components they'd like to have instrumented instead of all or nothing. Namely, allow separate/isolated disabling of method swizzling around URLSession code.

API Proposal

Make new properties that enable/disable each out-of-the-box instrumented feature.

isInstrumentationEnabled @property(nonatomic, assign, getter=isInstrumentationEnabled) BOOL instrumentationEnabled;

Proposals:

Firebase Product(s)

Performance

google-oss-bot commented 10 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.