30 May 2025
07:45 PM
- last edited on
24 Nov 2025
02:28 PM
by
Michal_Gebacki
I am trying to convert this code from the old dash board to have it working on the new dashboard but is not showing.
The migration of the dashboard did not get this righ.
Count The no of Management Zone:
timeseries {
management_zone_count = count(dt.entities, filter: { entity.type == "MANAGEMENT_ZONE" })
}
Count the Numbers of Tag:
timeseries {
applied_tags_count = count(dt.entities, filter: { entity.type == "TAG" })
}
I also tried this but none is working -
fetch dt.metrics
| filter startsWith(metric.key, "dt.sfm.server.automatically_applied_tags")
fetch dt.entities
| filter entity.type == "TAG"
| summarize count()
fetch dt.metrics
| filter startsWith(metric.key, "dt.sfm.server.management_zones")
fetch dt.entities
| filter entity.type == "MANAGEMENT_ZONE"
| summarize count()
Any help is much appreciated.
Marwan
Solved! Go to Solution.
24 Nov 2025 02:29 PM
Hi everyone!
Do you know what might help to solve issue Marwan described above?
Any help is highly appreciated, thank you!
24 Nov 2025 09:15 PM
Hi,
This behaviour is expected.
In the new Dashboards (v3) the concept of dt.entities is no longer available in Grail, so the queries from the old dashboards cannot be migrated directly.
dt.entities does not exist
Tags are not entities → entity.type == "TAG" will never return data
Management Zones are not entities → entity.type == "MANAGEMENT_ZONE" will never return data
You can only count entities that have a Management Zone assigned, for example:
fetch dt.entity.service
| filter isNotNull(managementZones)
| expand managementZones
| summarize entities_in_mz = countDistinct(id)
And you can count entities that contain tags:
fetch dt.entity.service
| filter isNotNull(tags)
| expand tags
| summarize entities_with_tags = countDistinct(id)These queries count entities using MZs or tags —
but not the number of MZs or the number of tags themselves, because those are no longer represented as queryable entities in Grail.
However, the new entity model does expose individual entity types, such as:
These entities contain a field called managementZones, so you can build a table of “how many entities belong to each management zone”, like this:
fetch dt.entity.service
| expand managementZones
| summarize by:{managementZones}, count = countDistinct(id)