15 Feb 2023 06:14 AM - last edited on 14 Aug 2023 10:17 AM by MaciejNeumann
We have request on Nginx that always reply response 200 but need to look into response body to capture status of 'fail' or 'success'.
},
"response": {
"statusCode": 200,
"body": "{\"message\":null,\"responseData\":{\"accountList\":[{\"accountNo\":\"2491011751\",\"canAddNewLine\":true,\"msisdnList\":[]}],\"deviceAdvancePaymentWaive\":\"N\",\"ratePlanAdvancePaymentWaive\":\"Y\",\"lineDepositWaive\":\"Y\",\"newProductOfferId\":\"4062147\",\"deviceDAPAmount\":\"540\",\"orderAck\":\"Y\"},\"status\":\"fail\",\"timeStamp\":\"2023-02-14 01:37:05\",\"violations\":null}"
}
}
However, looking at request attributes documentation does not really mention on this. Is there a way to capture this as an attribute?
Gary
Solved! Go to Solution.
15 Feb 2023 06:53 AM
Hello Gary.
We often set a request attribute for capturing arguments\return value from classes and methods which work with body \ make body response on App server level (on a Java backend for example) In this situation.
With custom error rules you can set to mark requests which have 200 response code and request attribute - error: value as failed.
Nginx in our situation is only balancer or web server to serve static files.
Regards,
Romanenkov Alex
22 Nov 2023 06:05 PM
Hi,
This sounds like a solution to the problems that we have now. Can you elaborate a bit more on the configuration through step by step? I looked at the custom error rules but would like to see a proper values to be input to harvest them as request attribute values.
22 Nov 2023 08:52 PM - edited 22 Nov 2023 08:53 PM
Hello @gary1024
Maybe you could try to use bizEvents with Grail on the Dynatrace Platform.
Capture the full body of nginx is possible and then you can use Dynatrace Query Language with Notebooks or Dashboards to make it graphically.
Business Events
Dynatrace Grail
Dynatrace Query Language
BR,