# fetch connected hosts count to each active gate and display trends with DQL

**URL:** <https://community.dynatrace.com/t/fetch-connected-hosts-count-to-each-active-gate-and-display-trends-with-dql/55230>\
**Category:** DQL\
**Tags:** dql, dynatrace-managed, notebooks\
**Created:** [March 10, 2026, 6:48pm UTC](https://community.dynatrace.com/t/fetch-connected-hosts-count-to-each-active-gate-and-display-trends-with-dql/55230 "2026-03-10T18:48:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sisapy09](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@Sisapy09](https://community.dynatrace.com/u/Sisapy09)\
**Post date:** [March 10, 2026, 6:48pm UTC](https://community.dynatrace.com/t/fetch-connected-hosts-count-to-each-active-gate-and-display-trends-with-dql/55230/1 "2026-03-10T18:48:01Z")

</div>

any have DQL to get the some upgrade problems and hosts connected to AG. we can see them in deployment page but just checking if possible to get that from DQL.

---

<div class="post-metadata">

**Author:** ![sujit\_k\_singh](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@sujit\_k\_singh](https://community.dynatrace.com/u/sujit_k_singh)\
**Post date:** [March 11, 2026, 9:32am UTC](https://community.dynatrace.com/t/fetch-connected-hosts-count-to-each-active-gate-and-display-trends-with-dql/55230/2 "2026-03-11T09:32:36Z")

</div>

[@Sisapy09](https://community.dynatrace.com/user/83727)

You can’t pull the exact “currently connected hosts per ActiveGate” via DQL today. That counter is shown on the Deployment Status page, but there’s no exposed metric for it in Data Explorer/DQL. The closest metric is the self‑monitoring one for connected OneAgent modules, which you can trend and split by ActiveGate[Solved: hosts connected to each AGs - Dynatrace Community](https://community.dynatrace.com/post/259997)If you really need the host count per AG, the workaround is to call the ActiveGates API (getAllActiveGates) and read connectedHosts, then surface that in a dashboard app/notebook. There’s a community thread with a small JS example that does exactly this[List of Hosts connected to an ActiveGate - Dynatrace Community](https://community.dynatrace.com/post/179214)
