# Is monitoredEntitiesClient.getEntities() segments aware?

**URL:** <https://community.dynatrace.com/t/is-monitoredentitiesclient-getentities-segments-aware/53320>\
**Category:** Developer Q&A Forum\
**Tags:** grail, platform-services\
**Created:** [September 12, 2025, 9:19am UTC](https://community.dynatrace.com/t/is-monitoredentitiesclient-getentities-segments-aware/53320 "2025-09-12T09:19:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SjoerdB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sjoerdb/32/157_2.png) [@SjoerdB](https://community.dynatrace.com/u/SjoerdB)\
**Post date:** [September 12, 2025, 9:19am UTC](https://community.dynatrace.com/t/is-monitoredentitiesclient-getentities-segments-aware/53320/1 "2025-09-12T09:19:50Z")

</div>

In an application (dynatrace app), I added segments in my filterbar, and set the SegmentsProvider at the right level. Still when I query for entities with the `monitoredEntitiesClient.getEntities()` function, I get all entities and it doesn’t take my chosen segment into account.

So my main question is: is, or will `monitoredEntitiesClient.getEntities()` be segment aware?

In my app this getEntities is used for many different Types, so this is programatically the best option for me as far as I can oversee.

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [September 12, 2025, 11:29am UTC](https://community.dynatrace.com/t/is-monitoredentitiesclient-getentities-segments-aware/53320/2 "2025-09-12T11:29:28Z")

</div>

Hi&nbsp;[@SjoerdB](https://community.dynatrace.com/user/16542)

monitoredEntitiesClient.getEntities() is not segments aware and it is not planned to make it segments aware.

Instead, I would recommend that you query via DQL entities with&nbsp;[queryExecutionClient](https://docs.dynatrace.com/docs/shortlink/smartscape-commands#traverse) and pass the segment filter in the params. With DQL you should be able to get all entities as you would be able to do this with&nbsp;monitoredEntitiesClient.getEntities()

Best,  
Sini

---

<div class="post-metadata">

**Author:** ![SjoerdB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sjoerdb/32/157_2.png) [@SjoerdB](https://community.dynatrace.com/u/SjoerdB)\
**Post date:** [September 14, 2025, 1:20pm UTC](https://community.dynatrace.com/t/is-monitoredentitiesclient-getentities-segments-aware/53320/3 "2025-09-14T13:20:17Z")

</div>

Hi Sini,

Thank you for your answer!

For my first use-case (simple HOST based query), this would work perfectly (and I will implement it in the coming days), however this is harder for my other use-cases, where I don’t know upfront which entity types will be requested by the customer. Customer is able to set the type manually (e.g. “HOST”, “SERVICE”, but also custom (device sub-)types e.g. vmware datastores. Hence a generic DQL to obtain the information would be harder to make (or am I overlooking something?)…

So would it be possible to reconsider the segment awareness of the getEntities() ?

Thanks,

Sjoerd

---

<div class="post-metadata">

**Author:** ![sinisa\_zubic](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sinisa_zubic/32/32498_2.png) [@sinisa\_zubic](https://community.dynatrace.com/u/sinisa_zubic)\
**Post date:** [September 15, 2025, 7:30am UTC](https://community.dynatrace.com/t/is-monitoredentitiesclient-getentities-segments-aware/53320/4 "2025-09-15T07:30:12Z")

</div>

Hi Sjoerd,

With the new [smartscapeNodes command](https://docs.dynatrace.com/docs/shortlink/smartscape-commands#smartscapeNodes) you can query all entities (nodes) at once, independent of the entity type. It utilizes the [G](https://docs.dynatrace.com/docs/shortlink/release-notes-saas-sprint-317#smartscape)[rail-native Smartscape storage](https://docs.dynatrace.com/docs/shortlink/release-notes-saas-sprint-317#smartscape). More entities will be added over time, currently it stores [AWS](https://docs.dynatrace.com/docs/shortlink/preview-program#new-cloud-platform-monitoring-for-aws) & [kubernetes](https://docs.dynatrace.com/docs/shortlink/preview-program#enhanced-kubernetes-object-visibility) entities if you participate in the previews.

For early next we have planned to add entities like host and process to the new storage.

Now, having in mind your custom app, with one DQL command, you can query the available types:

```markup
smartscapeNodes "*"
| fields type
| dedup type

```

Then, with another one, you can query the selected entities:

```markup
smartscapeNodes "*"
| filter in (type, array("K8S_NAMESPACE", "K8S_POD"))

```

Best,  
Sini

---

<div class="post-metadata">

**Author:** ![SjoerdB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sjoerdb/32/157_2.png) [@SjoerdB](https://community.dynatrace.com/u/SjoerdB)\
**Post date:** [October 13, 2025, 11:22am UTC](https://community.dynatrace.com/t/is-monitoredentitiesclient-getentities-segments-aware/53320/5 "2025-10-13T11:22:16Z")

</div>

This will definitively help in getting all entity types through DQL, since it also has some more info like tags available. I will just need to wait until it becomes available, to test how it works with all sorts of custom devices (from e.g. extensions).
