29 Oct 2021 10:52 AM - last edited on 12 Nov 2021 12:55 PM by Karolina_Linda
I know that we can use this early-adopter API to add some specific error-detection-rule based on a service request-attribute. This already helped us a lot.
However, now I want to make an Exception exclusion rule only on some specific services with a specific tag. I could do this manual, but that's a lot of work to maintain. And I don't see an API for that.
Is there an API? Or are there alternatives?
Solved! Go to Solution.
29 Oct 2021 02:39 PM - edited 29 Oct 2021 03:52 PM
Found it. It is possible via that API after all. See ignoredExceptionPatterns in https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/service-api/failure-detection...
10 Nov 2021 09:39 PM
This is great. Do you have an example of POST request to ignore a certain Exception? Also, I had added some exceptions to ignore list in the UI under Service settings. But when I do a GET all parameterSets, I get an empty response. Does this API only return the parameter sets that were created via API?
10 Nov 2021 10:30 PM
Correct. The API returns only settings that were created using API.
Unfortunately in the UI you don't see the parameters created using API, even in read-only mode.
10 Nov 2021 10:52 PM
Thank you! And on my other question regarding example POST request, I figured it out and was able to ignore a specific exception.
11 Nov 2021 09:53 AM
Hello @shreyas_shivapr
Im using below to exclude an exception using API.
1st step: Creating the parameter:
{
"id": "FDP_1",
"name": "Exclusion 500 Internal Server Error",
"description": "Exclusion 500 Internal Server Error",
"clientSideMissingHttpCodeIsFailure": false,
"serverSideMissingHttpCodeIsFailure": false,
"failingHttpCodesClientSide": "400-599",
"failingHttpCodesClientSide": "400-499, 501-599",
"failingHttpCodesServerSide": "500-599",
"failingHttpCodesServerSide": "501-599",
"http404NotFoundFailureEnabled": false,
"brokenLinkDomains": [],
"successForcingExceptionPatterns": [],
"ignoredExceptionPatterns": [
{
"classPattern": "System.Net.WebException",
"messagePattern": "The remote server returned an error: (500) Internal Server Error."
}
],
"tagConditions": []
}
2nd create the rule:
{
"id": "R_1",
"name": "Exclusion 500 Internal Server Error",
"description": "Exception Excluse 500 Server error",
"enabled": true,
"fdpId": "FDP_1",
"conditions": [
{
"attribute": "SERVICE_NAME",
"predicate": {
"type": "STRING_STARTS_WITH",
"ignoreCase": false,
"values": [
"Default Web Site:80,443",
"ANB-SRV-OUTDMZ"
]
}
}
]
}
11 Nov 2021 02:24 PM
Thanks @Malaik
Do we always need to create the rule followed by creating the parameter? And is the rule to apply the parameter to specific service?
12 Nov 2021 10:10 AM
We need to create le parameter first, because the ID of the parameter is one item of the rule.
You can specify a list of services ... (in my example, you can see all services starting with "Default Web Site:80,443"
"type": "STRING_STARTS_WITH",
"ignoreCase": false,
"values": [
"Default Web Site:80,443",