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

How to send Version code of android app as Config to Datadog?

Open manju1375 opened this issue 1 year ago • 10 comments

Question

Im using Configuration.Builder(someproperties).build() to send config info to Datadog RUM. I understand from docs it will take version by gradle.

But I want to send versionCode as well to Datadog RUM and that should be separate Property. I used the below code for the same. setAdditionalConfiguration(mapOf(Pair(VERSION_CODE,BuildConfig.VERSION_CODE))).build() on Builder

Im expecting versioncode will displayed in black box like below. But it is not working as expected

Untitled.pdf

But it is not displayed anywhere in the RUM explorer.

Finally Im using now GlobalRumMonitor.get().addAttribute(VERSION_CODE,BuildConfig.VERSION_CODE)

This will send info to customAttributes which is not accurate for me.

Let me know how to achieve the same?

manju1375 avatar Sep 26 '24 06:09 manju1375

Hi @manju1375! Regarding additionalConfiguration, it will not be helpful here as these parameters are mostly not displayed in the session. I'm looking to see if there is an alternative to customAttributes and will get back to you as soon as I have an answer.

jonathanmos avatar Sep 26 '24 13:09 jonathanmos

@manju1375 after some checks, we do not allow custom tags with RUM nor do we currently have plans to support this. The correct way to send this is what you have been doing - with customAttributes - and you can create a facet based upon that. You mentioned that customAttributes is not accurate for you - can you explain further what issue you are having with using it?

jonathanmos avatar Sep 29 '24 15:09 jonathanmos

There is no issue in sending Version code as customAttribute.

It is about the usage like as per the attached image, My team wants to see VersioCode at a glance.

It will be very helpful, sometimes for the same build we will have multiple version codes . Easy to identify versionCode changes across the sessions.

manju1375 avatar Oct 03 '24 04:10 manju1375

Thanks for your reply. If you add the versionCode as a custom facet then you can add it as a column to the session dashboard. You would then see the version codes at a glance for all the sessions. Would this solve the problem?

jonathanmos avatar Oct 07 '24 10:10 jonathanmos

Yes. We can add custom facet. I'm aware of it.

But the actual problem here is we have a team who focused on core features does not aware of Datadog RUM options. Myself is like responsible for Datadog integration for android.

All devs within team cannot configure these options and as version code is very vital for builds. It will be great if you guys consider to add custom tag support with RUM. It can be minimum in number definitely it will help.

Different teams/stack holders definitely have req to see particular attributes at initial glance without much configuration. Not now atleast in future.

manju1375 avatar Oct 08 '24 19:10 manju1375

@manju1375 Unfortunately, there are technical considerations that do not allow us currently to add this sort of support for custom tags. I hope this changes in the future, but cannot guarantee that this will be supported.

jonathanmos avatar Oct 09 '24 15:10 jonathanmos

It's picked up correctly in iOS (build number). What's the hold up in Android?

Image

kevin-abiera avatar Oct 17 '24 05:10 kevin-abiera

@kevin-abiera On ios this attribute is automatically collected, however what I think @manju1375 is referring to is seeing the attribute in the tags at the top of the session, and this is not possible on ios either. I'll look into automatically collecting the versionCode on android so that this behavior will be aligned

jonathanmos avatar Oct 21 '24 14:10 jonathanmos

Hi @jonathanmos

Is there any update on this? On the datadog web app I cannot query by Android version code. I'm not sure if I missed it but I do not see version code when looking at the sessions explorer

Thank you

ersen-lw avatar Sep 30 '25 15:09 ersen-lw

@ersen-lw this has recently been added in this pr, so it should be available in the next version

jonathanmos avatar Nov 25 '25 09:11 jonathanmos