cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Querying services related to an entity

DamianJankowski
Observer

I want to create a line chart that displays the response time metric for a selected service. I need it to be dynamic, so I’ve set up a variable. Here’s the variable definition:

 

 

fetch dt.entity.service
| fields entity.name

 

 

When the user selects an entity.name, the line chart should update and display the corresponding metric for that service.

 

I’ve tried the following query:

 

 

timeseries response_time = percentile(dt.service.request.response_time, 50),
by: { dt.entity.service },
filter: { in(id, classicEntitySelector("type(service),fromRelationship.IS_SERVICE_OF(type(CLOUD_APPLICATION),entityName.equals($Entity'))")) }

 

 

2 REPLIES 2

krzysztof_hoja
Dynatrace Pro
Dynatrace Pro

I see few problem with this query:

  • $Entity is string variable, so it should be explicitly concatenated with the rest of entity select expressions
  • If you want to filter by service name (variable values query suggests it), entity selector is incorrect
  • the identification of the service id in metric is dt.entity.service, so it should be used in in() filtering expression

This query should work better:

timeseries response_time = percentile(dt.service.request.response_time, 50),
by: { dt.entity.service },
filter: { in(dt.entity.service, classicEntitySelector(concat("type(service),entityName.equals(",$Entity,")"))) }

Result looks like this:

krzysztof_hoja_0-1727337003922.png

 

 

yep, thanks a lot 🙂 I finally figured it out. 

Featured Posts