DataDog / dd-sdk-ios

Datadog SDK for iOS - Swift and Objective-C.
Apache License 2.0
219 stars 127 forks source link

Custom attributes aren't show up for session but for action #2036

Closed vani2 closed 2 months ago

vani2 commented 2 months ago

Question

I had an issue before https://github.com/DataDog/dd-sdk-ios/issues/1601 and unfortunately, did't dig deeper to find out.

SDK version: 2.16.0 iPhone 14 Pro, iOS 18.0 Xcode 15.4 (15F31d)

After my app is launched, I set custom attributes

RUMMonitor.shared().addAttribute(forKey: "permissions", value: MyCustomEncodableModel) }

So, no problems with the code above. The issue is that I want to filter RUM sessions by these custom attributes and I can't, because it's shown only in actions but no at the top session page. Is there a way to propagate attributes to a session, or explicitly tell the SDK that I want these attributes to be attached to a session and not only to an action? Screenshot 2024-09-03 at 14 54 48 Screenshot 2024-09-03 at 14 55 06

mariedm commented 2 months ago

Hello @vani2, you should be able to filter RUM sessions by custom attributes. In the search bar, enter context.your_key:your_value.

Screenshot 2024-09-09 at 13 24 14

You can also do this from the attribute itself by clicking the gear icon left to it:

Screenshot 2024-09-09 at 13 28 23


Screenshot 2024-09-09 at 13 28 35

Let me know if that works for you.

vani2 commented 2 months ago

Thanks!