you can capture both primitive values and complex objects, but when you capture objects, the Agent will automatically call toString()/ToString() on it.
so if you capture an object that has a meaningful toString()/ToString() implementation (e.g. returning the JSON as string) then it will be possible to capture this. however, you will only get it to the maximum string capture length (which is 250 per default and can be increased to 32768).
also you should keep in mind that capturing huge strings can have quite a performance impact, both in traffic and cpu/response time.
Hi Shruti, Placing just sensor is not enough. You have to configure the placed sensor rule to capture its return value. By Default the return value is not captured. See in snapshot. You can also use the Accessor if its not simple type or .toString()-able.
Hi Rajesh ,
We have checked the return value
checkbox in sensor settings . Eventhough it is checked , we are getting the data type value in purepath details , not the intented value
For example our intended return value will be
are you sure that this method should return a JSON value?
because based on the captured object it looks like it's some sort of Task that should contain a JsonResult ... probably not at that point in time, but sometime in the future.
are you using async programming here, maybe with async/await or some specific async methods?
actually I don't think it will work this way.
because usually when you work with aync methods it works like this:
however, what this also means is that at the time when the async method is exited, the result itself is not yet available. otherwise the async operation would not make much sense, right?
however, AppMon captures the return value at the exit of the method, so if the result is not yet available, it would not be possible at all to get it.
I mean, you can try to query the result, which should work with an accessor "get_Result()", assuming that you are using such a Task: https://msdn.microsoft.com/en-us/library/dd321424(v=vs.110).aspx. however, I'd assume that you won't get the result at that point in time.
I would try to find a later point in time to get to this JSON value. are there maybe any other methods that are then using the actual JSON value?
you could also try instrumenting Task`1.get_Result(), which should be called to get the actual value, if my understanding is correct. however, this could result in *a lot* of instrumented method calls, which might induce significant traffic and performance overhead. so I would *not* recommend that in a production environment.
I am finding the same issue. The return value is datatype when accessor is left empty and the return is null with almost any accessor I tried.
Tried to capture this data from multiple methods with same luck.