Request attributes map

Hi all

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

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?

Hi @Hector1 ,

Can you please share screenshot for the configurations

BR

Hi @Esam_Eid

import java.util.HashMap;

import java.util.Map;

public class Main {

public static void main(String[] args) {

// Create

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

Hola @Hector1

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) , because it will be a string like " SessionId,47488338 ", and then you can use the “Restrict or further process the captured parameters” option.

I hope it’s helpful  :flexed_biceps:

Hi @PierreGutierrez

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?

Try this

Hi @Hector1 
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).

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 :flexed_biceps:.

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 :flexed_biceps: 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

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 :flexed_biceps: