Dashboarding
Dynatrace dashboards, notebooks, and data explorer explained.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Entity Selector - Service to Service Relationship

Theodore_x86
Advisor

Hello.

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

 

BR

 

Houston, we have a problem.
8 REPLIES 8

Hi theodore,

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

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

#Performance matter!

Hello @michiel_otten.

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

Houston, we have a problem.

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

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

 

#Performance matter!

Hi @michiel_otten 

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

Houston, we have a problem.

Hi there,

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

 

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~")))")))

 

#Performance matter!

Solution by @michiel_otten 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.

Dynatrace Ambassador | Alanata a.s., Slovakia, Dynatrace Master Partner

Hi @Julius_Loman. 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

Houston, we have a problem.

@Theodore_x86 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.  

Dynatrace Ambassador | Alanata a.s., Slovakia, Dynatrace Master Partner

Featured Posts