cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to set request attribute

Hi,

we need a value, Where the customer fired a lot from postman. how to set a request attribute.

this data source


Don't know what value to add


code level


request value

9 REPLIES 9

sebastian_kryst
DynaMight Leader
DynaMight Leader

My tip. You've found your class and method and you know which object you want to catch. You should find class that represents this object and check what getter methods are available there. For example getApp_username or something like that. In such case you can use this as deep object access. If you want to catch all of them and you don't have accessor that will return whole object as string, you may not be able to catch all values at once (there can be only one sensor per method, it means that you can access only one value from object). If you will find other methods that are passing the same object, you can instrument them as well to get more values.

Sebastian

Hi Sebastian K.

Can you suggest which get values should be obtained from the data source from the image?

Thank you

It seems that you have there only stringlist. It's not full source. If you have stringList inside object it may be problem with extracting values. This is not regular object with accessors but list that contains strings (key : value). In such case you can take values by passing key name to get method. This operation is not allowed in dynatrace. You cannot use any accessor that needs parameter inside. It has to be converted to string in code, you will not be able to to that in DT.

But as client is passing this using postman, you should be able to catch POST variables with data you need? You will not need to instrument code and this should work out of the box.

Sebastian

Does that mean we can't get the parameters for a data source?

You will not be able to collect parameters from that code, but you will be able (or should be) catch tam as POST variables. You've presented to me POST Payload from browser, which means you will be able to catch it that way.

Sebastian

Sorry, I have some questions I didn't make user sessions but wanted to make a request attribute. Will catch tam as POST variables?

thank you

POST variables are regular request attributes. Change Request attribute source from .NET Methot into post varialble. Then put names of values from payload and should work.

ChadTurner
DynaMight Guru
DynaMight Guru

you can use the request attribute to link data back to a user session and use it as a user session tag. But first you must find where that data is located. for example if you are looking to grab something out of the url we would fill it out like this:

then select that as the tag for the user session within the application

-Chad

User sessions does not work for POSTMAN requests 🙂