29 Oct 2021
02:52 AM
- last edited on
12 Nov 2021
04:55 AM
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.
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...
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?
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.
Thank you! And on my other question regarding example POST request, I figured it out and was able to ignore a specific exception.
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"
]
}
}
]
}
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?
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",
Featured Posts