04 Feb 2025
09:37 AM
- last edited on
10 Feb 2025
10:41 AM
by
MaciejNeumann
I'm trying to write a script that performs health checks on microservices, identifying any microservices that return HTTP status codes 400, 404, 500, or 503 and this script should fetch microservice data from Dynatrace and that's need to be
generate a report that is sent via email.
So for this Is there any existing API to achieve ?
From the above screenshot that is used for to ingest the events from third party applications to dynatrace. So for the same as above is there any API to fetch the service details from dynatrace to outisde env's?
So what exactly we are looking is the script should fetch microservices data from Dynatrace and that's need to be
generate a report that is sent via email.
So for this Is there any existing API to achieve ?
We can fetch it from problem section but we don't need because sometimes it will miss alerts. But here we need only for microservices that are hosted in particular zone
17 Feb 2025 11:48 AM
There are builtin metrics for 4xx or 5xx error codes that you can use in metric events and get alerts on these.
If you need only the specific error codes I would suggest creating custom metrics that filter on those error codes only.
If you have traces on Grail you can pull the specific status codes on demand
fetch spans, from: -30m, to: now(), scanLimitGBytes: 2
| filter in(http.response.status_code, {400, 404, 500, 503})
| summarize count(), by:{service.name, http.request.method ,http.response.status_code}