21 Sep 2023 08:25 PM - last edited on 18 Dec 2023 09:34 AM by IzabelaRokita
I asked this in the Dev Q&A forum, but this forum might have more visibility.
As a test use case I am building a dashboard that lists problems, with a Severity variable. I have done it successfully using a CSV list of the Severity Levels, but in the API there is an existing ENUM of the levels called ProblemSeverityLevel which should have all of them, but I can't figure out how to use that in code. If I reference if from the problemsClient, it just returns null, or invalid reference, depending on how I try to use it. Is it possible to reference the ENUM so I can then list the values into the variable via code?
Solved! Go to Solution.
18 Dec 2023 09:36 AM
Hello @TomLichti ,
Have you found the answer to your question already? If not - let me know, I'll try to find someone to assist you 🙂
09 Jan 2024 09:34 PM
Hi @TomLichti
Dynatrace Severities are - Availability, Error, Slowdown, Resource, Custom
Have you tried this using DQL?
This DQL snippet will give you a summary of problems by severity
fetch events
| filter event.kind == "DAVIS_PROBLEM"
| summarize CurrentTime = takeLast(timestamp), by:{display_id, event.category}
| summarize ProblemCount = countDistinct(display_id),by:{event.category}
Remove the last line and it will give you a list of problems with their most recent event status
fetch events
| filter event.kind == "DAVIS_PROBLEM"
| summarize CurrentTime = takeLast(timestamp), by:{display_id, event.category}
//| summarize ProblemCount = countDistinct(display_id),by:{event.category}
Add this to a dashboard and you can use the below DQL snippets for the variable and filter by event.category
// Dashboard Variable
fetch events
| filter event.kind == "DAVIS_PROBLEM"
| summarize CurrentTime = takeLast(timestamp), by:{display_id, event.category}
| summarize ProblemCount = countDistinct(display_id),by:{event.category}
| fields event.category
//DQL Query Tile
fetch events
| filter event.kind == "DAVIS_PROBLEM"
| summarize CurrentTime = takeLast(timestamp), by:{display_id, event.category}
| filter in(event.category, array($Severity))
Let me know if you have any further questions.
Thanks,
Lawrence