DQL
Questions about Dynatrace Query Language
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to filter the service request with a particular request name?

Hillman
Helper

We have a process group which include a bunch of process. The processes are started but only 1 of them is the active process and would initiate a particular web request. The other processes are standby and will not trigger that web request.

I try to count the number of that request to detect if there are less than 1 or more than 1 request being triggered. If yes, alerts will be triggered.

In the past I can use Calculated Service Metrics to achieve this:

Hillman_0-1783325563656.png

 

However, in the DQL, I cannot find any dimension like "Request Name". Is there any way I can achieve that? 

6 REPLIES 6

t_pawlak
Leader

Hi,
in DQL the equivalent of Request Name is usually endpoint.name for the new dt.service.request.* metrics.

try this:

timeseries requests = sum(dt.service.request.count),
by: { dt.entity.service, endpoint.name }
| filter dt.entity.service == "SERVICE-9C186B48B0905E85"
| filter endpoint.name == "oteldemo.CurrencyService.Convert"

 

t_pawlak_0-1783329386833.png

 

@t_pawlak hmm...it is weird that when I try to query for the endpoint.name, all it returns are "NON_KEY_REQUESTS" instead of the "Request Name"

Hillman_0-1783331024445.png

 

Show me your DQL, please

The DQL is as follow:

timeseries { sum(dt.service.request.count), value.A = avg(dt.service.request.count, scalar: true) }, by: { dt.entity.process_group, endpoint.name }
| filter: { matchesValue(entityAttr(dt.entity.process_group, "entity.name"), "*<process_group_name>") }
| fieldsAdd dt.entity.process_group.name = entityName(dt.entity.process_group)


where <process_group_name> is the name of our process group

Hi,
@Naveenkumar_Dalready explained why this happens.
But if endpoint.name is being aggregated as NON_KEY_REQUESTS in dt.service.request.count, you could try querying the spans instead of the metric. Spans expose the individual requests/endpoints rather than the aggregated metric.

try this:

fetch spans
| filter matchesValue(entityName(dt.entity.process_group), "*nginx*")
| filter contains(endpoint.name, "easytravel")
| summarize requests = count(), by: { endpoint.name, dt.entity.process_group }
| fieldsAdd process_group_name = entityName(dt.entity.process_group)

If this doesn't return any results, I'd first verify which fields are available in your spans (for example endpoint.name vs span.name), as the available attributes can vary depending on the technology and instrumentation.

In my case, this query returns the expected results:

t_pawlak_0-1783332520202.png

 

Naveenkumar_D
Dynatrace Enthusiast
Dynatrace Enthusiast

@Hillman The reason is previously, only manually configured key requests got individual metrics, while everything else was aggregated into a single NON_KEY_REQUEST bucket.

Enhanced endpoints eliminates that limitation.
Check out this doc, You can also see @t_pawlak another post reply here

Featured Posts