DataDog / dd-sdk-android

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

RUM View name is not shown completely when the obfuscation is enabled (Proguard/R8 enabled) #967

Open Maxwell6635 opened 2 years ago

Maxwell6635 commented 2 years ago

Thanks for taking the time for reporting an issue!

Describe what happened View Name or Class Name is obfuscated in DataDog Rum View Dashboard.

Steps to reproduce the issue:

  1. Enable Proguard Rules
  2. Upload mapping files with Datadog Plugins

Describe what you expected: View Name able to be de-obfuscated

Screenshot 2022-06-30 at 12 11 17 PM

Additional context

xgouchet commented 2 years ago

Hi @Maxwell6635, the deobfuscation in Datadog is mostly performed on Errors' stacktraces. The name of a view, by default uses the View's canonical class name, but you have an option to rename it if you want to. When building the configuration of the SDK, you can use:

        val configBuilder = Configuration.Builder(
                logsEnabled = true,
                tracesEnabled = true,
                crashReportsEnabled = true,
                rumEnabled = true
        )
                .useViewTrackingStrategy(
                        ActivityViewTrackingStrategy(
                                trackExtras = true,
                                componentPredicate = object: ComponentPredicate<Activity> {
                                    override fun accept(component: Activity): Boolean {
                                        // Should we consider this activity as a RUM View?
                                        return true
                                    }

                                    override fun getViewName(component: Activity): String? {
                                        // What should be the name of the RUM View
                                        return component.title.toString()
                                    }
                                }
                        )
                )
Maxwell6635 commented 2 years ago

@xgouchet Hi, if we upload the mapping via this plugins. https://github.com/DataDog/dd-sdk-android-gradle-plugin

So the deobfuscation on ViewName will it not works right?

xgouchet commented 2 years ago

Hi @Maxwell6635 , no the view name won't be deobfuscated, only the errors stacktraces will.

Maxwell6635 commented 2 years ago

@xgouchet any plan to support this ?

xgouchet commented 2 years ago

For now this is not on our immediate roadmap but we might consider it eventually

sonrohan commented 6 months ago

@xgouchet Sorry to unearth an old thread, but do you know if this is on the roadmap?