# Request attributes map

**URL:** <https://community.dynatrace.com/t/request-attributes-map/45330>\
**Category:** Open Q&A\
**Tags:** request-attributes\
**Created:** [April 28, 2024, 5:32am UTC](https://community.dynatrace.com/t/request-attributes-map/45330 "2024-04-28T05:32:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hector1](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@Hector1](https://community.dynatrace.com/u/Hector1)\
**Post date:** [April 28, 2024, 5:32am UTC](https://community.dynatrace.com/t/request-attributes-map/45330/1 "2024-04-28T05:32:09Z")

</div>

Hi all

I’m new to monitoring, please don’t judge too harshly 🙂

Please help me with a question

I want to retrieve the key values ​​via request attributes for the java.util.map method

I try via get(“key”) but dynatrace writes an error

how can I get the value of the keys?

---

<div class="post-metadata">

**Author:** ![Esam\_Eid](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/esam_eid/32/167_2.png) [@Esam\_Eid](https://community.dynatrace.com/u/Esam_Eid)\
**Post date:** [April 28, 2024, 6:39am UTC](https://community.dynatrace.com/t/request-attributes-map/45330/2 "2024-04-28T06:39:19Z")

</div>

Hi&nbsp;[@Hector1](https://community.dynatrace.com/user/75130)&nbsp;,

Can you please share screenshot for the configurations

BR

---

<div class="post-metadata">

**Author:** ![Hector1](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@Hector1](https://community.dynatrace.com/u/Hector1)\
**Post date:** [April 28, 2024, 8:32am UTC](https://community.dynatrace.com/t/request-attributes-map/45330/3 "2024-04-28T08:32:10Z")

</div>

Hi [@Esam\_Eid](https://community.dynatrace.com/user/65475)

import java.util.HashMap;

import java.util.Map;

public class Main {

public static void main(String[] args) {

// Create

 ![IMG_20240428_133147.jpg](https://global.discourse-cdn.com/dynatrace/original/2X/6/66aef4adb83b3158f220df5d0178301bb4f7752e.jpeg)

Map

Map\<String, String\> map = new HashMap\<\>();

// — Map

map.put(“Sessionid”, “47488338”);

// Map —

System.out.println(map);

}

}

here is the usual code in java and from it I need to extract the key value

The screenshot shows that dynatrace does not allow this to be done as can be done in java code

---

<div class="post-metadata">

**Author:** ![PierreGutierrez](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pierregutierrez/32/5934_2.png) [@PierreGutierrez](https://community.dynatrace.com/u/PierreGutierrez)\
**Post date:** [April 29, 2024, 2:20am UTC](https://community.dynatrace.com/t/request-attributes-map/45330/4 "2024-04-29T02:20:05Z")

</div>

Hola&nbsp;[@Hector1](https://community.dynatrace.com/user/75130)

I see you are using a data type: Dictionary (key, value).  
I think Dynatrace can’t interpret it.

I also see that the result of your method is System.out.printIn(map), if so.

**Maybe you can capture the result of your method ( Change the option Capture)**&nbsp;, because it will be a string like " SessionId,47488338 ", and then you can use the “Restrict or further process the captured parameters” option.

 ![PierreGutierrez_0-1714356756217.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/7/d7317d466ac4abdd87472c2998ce9575714eb9ff.png)

I hope it’s helpful&nbsp; 💪

---

<div class="post-metadata">

**Author:** ![Hector1](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@Hector1](https://community.dynatrace.com/u/Hector1)\
**Post date:** [April 29, 2024, 5:27am UTC](https://community.dynatrace.com/t/request-attributes-map/45330/5 "2024-04-29T05:27:02Z")

</div>

Hi [@PierreGutierrez](https://community.dynatrace.com/user/45543)

Thanks for the advice, I’ll try to do that

And if the dictionary has more meanings than one, for example like this

sessionid=38288228, blockid=4646466446, useruiid=49393838

and there can be up to 50 such values. Can dynatrace see them all?

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [April 29, 2024, 6:56am UTC](https://community.dynatrace.com/t/request-attributes-map/45330/6 "2024-04-29T06:56:26Z")

</div>

Try this

 ![PacoPorro_0-1714373730687.png](https://global.discourse-cdn.com/dynatrace/original/3X/6/b/6bae34f4b8a640dd2589c63eb4c3a56433ef33f4.png)

 ![PacoPorro_1-1714373763241.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/f/8fdc331713f16c7f416b2ce1b492b95aecc925e3.png)

---

<div class="post-metadata">

**Author:** ![PierreGutierrez](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pierregutierrez/32/5934_2.png) [@PierreGutierrez](https://community.dynatrace.com/u/PierreGutierrez)\
**Post date:** [April 29, 2024, 2:40pm UTC](https://community.dynatrace.com/t/request-attributes-map/45330/7 "2024-04-29T14:40:46Z")

</div>

Hi&nbsp;[@Hector1](https://community.dynatrace.com/user/75130)&nbsp;  
If your method is going to be executed multiple times in the call (and at those times different data will be sent and those different values must be captured).

 ![PierreGutierrez_0-1714401216084.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/1261d9d78bc0afeeb09417ba66e5685eecefb8a4.png)

**NOTE: It is important that you know that with this configuration only 10 different values are captured.**

In that case, what PacoPorro recommends is a good alternative 💪.

In addition to this, I present other scenarios that may be useful to you:

1.- **Use a different request attribute** : Apply rules to capture different values, example:

- RA 1: Session ID  
- RA 2: Block ID

This will be useful when you want to analyze data in multidimensional 💪 and create Calculated Service Metrics in the future.

2.- **Use Business Event:** If you have a different Key, it is a perfect scenario to use it.

[https://docs.dynatrace.com/docs/shortlink/ba-business-events-capturing](https://docs.dynatrace.com/docs/shortlink/ba-business-events-capturing)

One of the good practices for using Request Attribute in Dyantrace is not to apply too many request attributes to the services.

Using them excessively can affect performance.

I hope it’s helpful 💪
