dd-sdk-android icon indicating copy to clipboard operation
dd-sdk-android copied to clipboard

Allow client SDK to provide a custom version number

Open ankushg opened this issue 2 years ago • 3 comments

Currently, the datadog SDK seems to be looking up our version number from the PackageManager: https://github.com/DataDog/dd-sdk-android/blob/4be13fb69720ba54a7d61284816fb8a91ed75d19/dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/CoreFeature.kt#L314C34-L314C59

We reuse the same user-visible number if we discover bugs before pushing to production, but this makes all of our datadog dashboards extremely confusing to use.

We'd like to be able to provide our version code as the datadog version, rather than the user-visible version string.

ankushg avatar Jul 19 '23 23:07 ankushg

Hi @ankushg , this is a topic we're considering supporting in the future, we'll keep you posted when we have a plan for such use case

xgouchet avatar Jul 20 '23 08:07 xgouchet

Thanks -- from the code, it looked like we should have been able to pass in an attribute called "_dd.version" and have that used instead of what the PackageManager reports

Is that accurate?

ankushg avatar Jul 20 '23 19:07 ankushg

Yes indeed that workaround will work, you just need to make sure you change also the version in the gradle plugin when uploading your Proguard/R8 mapping files, with the following snippet :

datadog {
    versionName = "42"
}

xgouchet avatar Jul 21 '23 08:07 xgouchet