DataDog / dd-sdk-android

Datadog SDK for Android (Compatible with Kotlin and Java)
Apache License 2.0
140 stars 56 forks source link

Disable RUM at runtime #1367

Open fleficher opened 1 year ago

fleficher commented 1 year ago

Is your feature request related to a problem? Please describe.

As of today, disabling RUM on the fly is not possible as it requires the user to restart the app to take in effect. The feature can only be disabled from the initialize call which is only working once:

 Datadog.initialize(
            context = context,
            trackingConsent = TrackingConsent.GRANTED,
            configuration = Configuration.Builder(
                rumEnabled = false,
            )
        )

The TrackingConsent property is used to disable RUM but also logs, etc. We would like to be able to only disable RUM, but not logs.

Describe the solution you'd like

Using the same way as for updating the tracking consent:

        Datadog.setRUMtrackingConsent(TrackingConsent.GRANTED)

which will take effect instantly.

0xnm commented 1 year ago

Hello @fleficher! Thanks for sharing this suggestion. Indeed, we are aware that it might be the need to enable/disable features dynamically, especially in the apps which heavily rely on the remote config.

We are working on the changes which should allow to support this use case. It should be available in the SDK v2 which we are going to release soon.

ankushg commented 11 months ago

I see that there are a couple betas of SDK v2! Is this feature supported in there?

0xnm commented 11 months ago

Hello @ankushg! Indeed we have few betas for SDK v2, but the possibility to stop individual features won't be there for 2.0.0 release. This functionality is on our roadmap however, and we aim to deliver it later.

With SDK v2 currently you have a possibility to stop the SDK completely, by calling Datadog.stopInstance.

ankushg commented 11 months ago

Thanks -- that's not exactly what we'd like to do, but looking forward to per-feature (and specifically, RUM) disabling

bill350 commented 7 months ago

Hey @0xnm ,

Just wanted to know the status of having dedicated consent for RUM on apps? Thanks!

0xnm commented 7 months ago

@bill350 This is not on our roadmap, data collection rules are not specific to any feature.