07 Dec 2023 06:30 AM
Hi,
I wanted to pull all the exception that occurred with it's counts using API. Can I fetch the result by using provided API and if yes then let me know the API details.
Solved! Go to Solution.
07 Dec 2023 07:47 AM - edited 07 Dec 2023 07:47 AM
Hi @Shruts
To retrieve exceptions and their counts using the Dynatrace API, you can utilize the Dynatrace Problem and Event Feed API or the Logs API, depending on the exact nature of the data you're interested in.
Example:
GET https://{your-environment-id}.live.dynatrace.com/api/v2/logs/query
Authorization: Api-Token {your-api-token}
Content-Type: application/json
{
"query": "log level ERROR | count",
"from": "now-2d",
"to": "now"
}
Radek
07 Dec 2023 10:07 AM
Hi,
Can you send API documentation link or swagger document link for Logs API? Because couldn't able to find this API in given swagger doc.
Thanks & Regards,
Shruti
07 Dec 2023 11:55 AM
Hi,
You can find swagger in Managed >> Access tokens
https://docs.dynatrace.com/docs/shortlink/api-events-v2
Radek
08 Dec 2023 08:51 AM
You may be looking for this information displayed in the multidimensional analysis tool
There you can create a Metric based on the Exceptions and the count.
Once you have the metric you can easily pull the information from /api/v2/metrics
You may need to filter down the search using a specific service or request otherwise it may not work if you have too much data in your environment.
08 Dec 2023 09:14 AM
Please note that creating additional metrics consumes the DDU licence.