21 May 2026 04:53 PM
Currently In Distributed Tracing, I can see the value as below, under Request attributes, using the below mentioned payload.
1. [key1,key2,key3] when "argumentIndex": 1
2. [value1,value2,value3] when "argumentIndex": 2
Please advise on how I can get the value of "Request-attributes-1" as only "value2"?
{
"name": "Request-attributes-1",
"enabled": true,
"dataType": "STRING",
"dataSources": [
{
"enabled": true,
"source": "METHOD_PARAM",
"technology": "JAVA",
"methods": [
{
"method": {
"visibility": "PUBLIC",
"modifiers": [
"ABSTRACT"
],
"className": "javax.class1.class2",
"methodName": "setAttribute",
"argumentTypes": [
"java.lang.String",
"java.lang.Object"
],
"returnType": "void"
},
"capture": "ARGUMENT",
"argumentIndex": X,
"deepObjectAccess": "toString().trim()"
}
]
}
],
"normalization": "ORIGINAL",
"aggregation": "ALL_DISTINCT_VALUES",
"confidential": false,
"skipPersonalDataMasking": false
}25 May 2026 12:28 PM
Hi @ashik_h2k
The setAttribute(String key, Object value) method takes the key as argument 1 and value as argument 2. The issue is that with argumentIndex: 2 you're capturing all values from every setAttribute call, not just the one where key = "key2".
You need to add a condition on your data source so it only captures argument 2 (value) when argument 1 (key) matches your desired key.
Add valueCondition and conditionArgumentIndex to your payload:
{
"name": "Request-attributes-1",
"enabled": true,
"dataType": "STRING",
"dataSources": [
{
"enabled": true,
"source": "METHOD_PARAM",
"technology": "JAVA",
"methods": [
{
"method": {
"visibility": "PUBLIC",
"modifiers": ["ABSTRACT"],
"className": "javax.class1.class2",
"methodName": "setAttribute",
"argumentTypes": ["java.lang.String", "java.lang.Object"],
"returnType": "void"
},
"capture": "ARGUMENT",
"argumentIndex": 2,
"deepObjectAccess": "toString().trim()"
}
],
"valueCondition": {
"negate": false,
"operator": "EQUALS",
"value": "key2"
},
"scope": {
"tagOfProcessGroup": null
},
"parameterName": "key2",
"conditionSource": "METHOD_PARAM",
"conditionArgumentIndex": 1
}
],
"normalization": "ORIGINAL",
"aggregation": "FIRST",
"confidential": false,
"skipPersonalDataMasking": false
}
This way you'll only get "value2" when the key is "key2".
Thanks,
Sujit
Featured Posts