# Entity Selector - Service to Service Relationship

**URL:** <https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488>\
**Category:** Dashboarding\
**Tags:** data-explorer, entities\
**Created:** [December 24, 2025, 12:22pm UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488 "2025-12-24T12:22:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Theodore\_x86](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theodore_x86/32/17620_2.png) [@Theodore\_x86](https://community.dynatrace.com/u/Theodore_x86)\
**Post date:** [December 24, 2025, 12:22pm UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/1 "2025-12-24T12:22:06Z")

</div>

Hello.

I am struggling to create a REQUEST COUNT metric for&nbsp;the Services targeting, all Services that run on specific hosts (filter by hostname, eg. contains(“something”)).

BR

---

<div class="post-metadata">

**Author:** ![michiel\_otten](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michiel_otten/32/21987_2.png) [@michiel\_otten](https://community.dynatrace.com/u/michiel_otten)\
**Post date:** [December 24, 2025, 2:09pm UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/2 "2025-12-24T14:09:22Z")

</div>

Hi theodore,

Would this work for you? You use the Data explorer to look at the fromRelationships from that specific service.

```python
builtin:service.request.count:splitBy("dt.entity.service"):filter(in("dt.entity.service", entitySelector("type(~"SERVICE~"),fromRelationship.runsOnHost(type(~"HOST~"),entityName.contains(~"YOURHOST~"))")))

```

KR.  
Michiel

---

<div class="post-metadata">

**Author:** ![Theodore\_x86](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theodore_x86/32/17620_2.png) [@Theodore\_x86](https://community.dynatrace.com/u/Theodore_x86)\
**Post date:** [December 24, 2025, 2:54pm UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/3 "2025-12-24T14:54:14Z")

</div>

Hello&nbsp;[@michiel\_otten](https://community.dynatrace.com/user/4669).

I tried it but no results are returned. Something missing maybe(?).

---

<div class="post-metadata">

**Author:** ![michiel\_otten](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michiel_otten/32/21987_2.png) [@michiel\_otten](https://community.dynatrace.com/u/michiel_otten)\
**Post date:** [December 24, 2025, 3:04pm UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/4 "2025-12-24T15:04:36Z")

</div>

Yes, by me! 😉  
I’ve succesfully exectuted this one on the playground

```python
builtin:service.requestCount.total:splitBy("dt.entity.service"):filter(in("dt.entity.service", entitySelector("type(~"SERVICE~"),fromRelationship.runsOnHost(type(~"HOST~"),entityName.contains(~"lnx1-demo.c.dynatrace-demoability.internal~"))")))

```

I mentioned the wrong metric.

 ![michiel_otten_0-1766588870946.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/f/3fab7b9b2e468d2e0217fd90e2683a9adaf36e46.png)

---

<div class="post-metadata">

**Author:** ![Theodore\_x86](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theodore_x86/32/17620_2.png) [@Theodore\_x86](https://community.dynatrace.com/u/Theodore_x86)\
**Post date:** [December 26, 2025, 12:04am UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/5 "2025-12-26T00:04:30Z")

</div>

Hi&nbsp;[@michiel\_otten](https://community.dynatrace.com/user/4669)

It is working indeed, by I think that shows the services running on the host. Quite useful, but not the case here. We want the services that send requests to the services running on the host.

BR

---

<div class="post-metadata">

**Author:** ![michiel\_otten](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michiel_otten/32/21987_2.png) [@michiel\_otten](https://community.dynatrace.com/u/michiel_otten)\
**Post date:** [December 29, 2025, 10:41am UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/6 "2025-12-29T10:41:19Z")

</div>

Hi there,

I haven’t double checked this but in theory you should be able to use relationships for this:

```python
builtin:service.requestCount.total:splitby("dt.entity.service"):filter(in("dt.entity.service", entitySelector("type(~"SERVICE~"),toRelationship.CALLS(type(~"SERVICE~"),fromRelationship.runsOnHost(type(~"HOST~"),entityName.contains(~"YOUR_HOST_HERE~")))")))

```

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [December 30, 2025, 10:38pm UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/7 "2025-12-30T22:38:35Z")

</div>

Solution by&nbsp;[@michiel\_otten](https://community.dynatrace.com/user/4669)&nbsp;will work, just keep in mind those are metrics for all the services, so it’s not count of the requests of service A calling service B, but total requests of service A where some of the requests (maybe only one in last two hours) called service B.

If you need to count only requests from service A calling service B, you need to use Multidimensional analysis / Service flow / Service backtrace or query spans (if you use Dynatrace SaaS with Traces in Grail).

I recommend tagging the services (using similar selector) and then using just these tags in Data Explorer.

---

<div class="post-metadata">

**Author:** ![Theodore\_x86](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/theodore_x86/32/17620_2.png) [@Theodore\_x86](https://community.dynatrace.com/u/Theodore_x86)\
**Post date:** [December 30, 2025, 11:55pm UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/8 "2025-12-30T23:55:00Z")

</div>

Hi&nbsp;[@Julius\_Loman](https://community.dynatrace.com/user/3364). Very interesting comment:

_**keep in mind those are metrics for all the services, so it’s not count of the requests of service A calling service B, but total requests of service A where some of the requests (maybe only one in last two hours) called service B.**_

This had totally skipped my mind! If that is the case then I do not see how tagging would help. It will sjow again the service metrics for all calls not only from Service A to Service B.

BR

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [December 31, 2025, 8:18am UTC](https://community.dynatrace.com/t/entity-selector-service-to-service-relationship/54488/9 "2025-12-31T08:18:42Z")

</div>

[@Theodore\_x86](https://community.dynatrace.com/user/50066)&nbsp;tagging does not help to overcome this, it just makes data explorer usage a little easier.

So if you want just count of the requests of service A calling service B, it’s not possible to do that with data explorer. Use MDA / service flow to get the numbers (not possible to have that on a dashboard) or DQL on spans if you use SaaS with Grail.
