Skip to content

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

Open
@SwiftNativeDeveloper

Description

@SwiftNativeDeveloper

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:

  • isLifecycleInstrumentationEnabled
  • isNetworkInstrumentationEnabled

Firebase Product(s)

Performance

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