These examples illustrate how to build powerful and flexible health dashboards by using DQL to slice and dice all Davis reported problems and events.
Davis problems represent results that originate from the Davis root-cause analysis runs. In Grail, Davis problems and their updates are stored as Grail events.
Davis events represent raw events that originate from various anomaly detectors within Dynatrace or within the OneAgent. Examples here are OneAgent-detected CPU saturation events or high garbage collection time events.
dt.davis.problems
.event.id
holds the unique problem ID, which is stable across all refreshes and updates that Davis reports for the same problem.fetch dt.davis.problems, from:now()-24h, to:now()| summarize {problemCount = countDistinct(event.id)}
Query result
problemCount
415
dt.davis.problems
.event.id
field, which contains the problem ID.ACTIVE
. To do this, the DQL command takeLast
of the field event.status
receives the last state.fetch dt.davis.problems| filter event.status == "ACTIVE"| summarize {activeProblems = countDistinct(event.id)}
Query result
activeProblems
15
dt.davis.problems
.fetch dt.davis.problems, from:now()-7d| makeTimeseries count(default:0)
Query result
timeframe
interval
count
start: 20/11/2024, 12:00 end: 27/11/2024, 13:00
60 min
0.00, 55.00, 143.00, 703.00, 504.00, 120.00, 117.00, 692.00, 534.00
dt.davis.problems
.fetch dt.davis.problems| expand affected_entity_ids| summarize count = countDistinct(display_id), by:{affected_entity_ids}| sort count, direction:"descending"| limit 3
Query result
affected_entity_ids
count
HOST-A9449CACDE12B2BF
10
SERVICE-5624DD59D74FF453
5
PROCESS_GROUP_INSTANCE-3184C659684130C7
3
This example joins entity attributes in order to filter all problems with a given host name.
dt.davis.problems
.affected_entity_ids
field.host.
: host.id
and host.name
.myhost
.fetch dt.davis.problems| expand affected_entity_ids| fieldsAdd host.name = entityName(affected_entity_ids, type: "dt.entity.host")| filter host.name == "myhost"
Query result
timestamp
affected_entity_ids
host.id
host.name
display_id
5/31/2023, 1:31:39 PM
HOST-27D70086952122CF
HOST-27D70086952122CF
myhost
P-23054243
This example shows you how to filter problems by a unique ID.
dt.davis.problems
.fetch dt.davis.problems| filter display_id == "P-24051200"
Query result
timestamp
affected_entity_ids
host.id
host.name
display_id
5/31/2023, 1:31:39 PM
HOST-27D70086952122CF
HOST-27D70086952122CF
myhost
P-23053506
This example shows you how to fetch all active problems that weren't marked as duplicates.
Since the duplicate flag appears during the lifecycle of a problem, the update events need to be sorted by timestamp. Then, the events need to be summarized by taking the last state of the duplicate and status fields. It's possible to correctly apply the filter only after you sort the events by the timestamp.
dt.davis.problems
.fetch dt.davis.problems| filter event.status == "ACTIVE" and not dt.davis.is_duplicate == "true"
Query result
display_id
status
id
duplicate
P-230910385
ACTIVE
P-230910385
false
This example shows you how to calculate the mean time that was needed to resolve all the reported problems by summarizing the delta between start and end of each problem over time.
dt.davis.problems
.fetch dt.davis.problems, from:now()-7d| filter event.status == "CLOSED"| filter dt.davis.is_frequent_event == false and dt.davis.is_duplicate == false and maintenance.is_under_maintenance == false| makeTimeseries `AVG Problem duration in hours` = avg(toLong(resolved_problem_duration)/3600000000000.0), time:event.end
This example shows how to create a chart displaying the number of concurrently open problems over time. The resolution gaps are filled with the spread
command.
dt.davis.problems
.spread
command.fetch dt.davis.problems| makeTimeseries count = count(), spread: timeframe(from: event.start, to: coalesce(event.end, now()))
dt.davis.events
for the last 7 days.fetch dt.davis.events, from:now()-7d, to:now()| filter event.kind == "DAVIS_EVENT"| filter event.type == "OSI_HIGH_CPU" or event.type == "OSI_HIGH_MEMORY"| makeTimeseries count = count(default: 0)
Query result
60min interval
count
5/25/2023, 3:00 PM
146
5/25/2023, 4:00 PM
312
5/25/2023, 5:00 PM
201