Description
Note: I haven't determined the root cause of this issue, but I wanted to share the behavior I was noticing as well as how to repro it.
Using a simple configuration of the AspNetResponseStatus
trigger, the collection rule doesn't always trigger when it should. In basic testing, it appears that instead of triggering on each instance of a 404 status code, it generally triggers on every third instance. I first noticed this using the configuration below on a dummy "FirstWebApp" application by entering an invalid path (e.g. localhost:5002/abc). During debugging, it appears that the traceEvents for a stopped activity (with the corresponding 404 status code) aren't being checked until several more requests have occurred.
To repro, below is the collection rule configuration I was using (with a local basic web app). Try a URL that won't work (such as localhost:5002/abc), and continue repeatedly trying invalid URLs. Pay attention to when the collection rule is successfully triggered and a dump is actually egressed.
Especially since I haven't looked far enough into it to find a solution, it's possible this is due to an issue with how I've configured this file, but I wanted to list something for it before investigating further. If you have any questions or can't get it to repro, let me know and I can make a screen recording of the behavior I'm seeing.
"CollectionRules": {
"BadResponseStatus": {
"Trigger": {
"Type": "AspNetResponseStatus",
"Settings": {
"ResponseCount": 1,
"StatusCodes": [
"400-499"
],
"SlidingWindowDuration": "00:00:05"
}
},
"Actions": [
{
"Type": "CollectDump",
"Settings": {
"Egress": "artifacts",
"Type": "Full"
}
}
],
"Limits":{
"ActionCount": 1000,
"ActionCountSlidingWindowDuration": "00:30:00"
}
}
}