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

Service request counts per host server

CharlesPerez
Participant

Hi All,

I would like to know if it is possible to split the service request counts of a multi-hosted service, per host server.

For example: AppServer 1, AppServer 2, AppServer 3, AppServer4, with Service1 running on all four servers
I want to create a table that will look like this

Host Service Request Count
AppServer 1 Service1 56k
AppServer 2 Service1 54k
AppServer 3 Service1 81k
AppServer 4 Service1 59k

 

Do you know a DQL to get this?

 

14 REPLIES 14

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

You can see that information already seeing requests:

AntonPineiro_0-1752055290691.png

You can see information per instance.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

I think perhaps Charles is asking  is it possible to do it via DQL

That is correct sir. Apologies, I was not able to mention it on my earlier inquiry.

Thank you for pointing that out 😊

Regards,
Charles

Hi,

I have just added DQL reference in message, and move it to DQL forum.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Thank you for the assistance Sir @AntonPineiro!! 😊

Hi AntonPineiro,

Yes, we already saw this. But client requires to see the distribution of request count per host machine.

I can do this with processes, but client wants to do it with Services.

CharlesPerez_0-1752109636183.png

 

Regards,
Charles 

 

Hi,

I think @sia_h has already pointing you to a solution.

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

lubrman
Advisor

Hi @CharlesPerez 

You should be able to create a tag within each server’s process. Based on that tag, it should then be possible to divide individual services. This way, you can also create the following table.

sia_h
Dynatrace Champion
Dynatrace Champion

Try this:

fetch dt.entity.process_group_instance
| fieldsAdd service.id = runs [dt.entity.service], process.name = entity.name, belongs_to
| fieldsAdd dt.entity.host = belongs_to[dt.entity.host]
| fieldsAdd dt.entity.host.name = entityAttr(dt.entity.host, "entity.name")
| expand service.id
| lookup [
timeseries sum(dt.service.request.count),
by:{
dt.entity.service, 
dt.entity.process_group 
}
], sourceField:service.id, lookupField:dt.entity.service, prefix: "metric."

Hi @sia_h 

Thank you for this! Will simulate this first on my end and see if it matches our requirements.

Hopefully this is what they are looking for 😁

Regards,
Charles Perez 

Hi @sia_h,

I tried to simplify the table, but the service seems to appear Null.

CharlesPerez_1-1752200948944.png

Only the host name and process name have data.  Would like to seek help on how I can fix this. Thank you! 

 

Regards,
Charles Perez

 

sia_h
Dynatrace Champion
Dynatrace Champion

You could add 

| filter isNotNull(service.id)

to the end of the query. Processes with a null Service Name either have no services, or had no services in the timeframe you're looking in.

Hi Everyone,

 

I have resolved the Query. Thank you @AntonPineiro , @sia_h , @waikeat_chan , @lubrman  for the assistance.

Pasting here the final DQL that I have used, and the result from the Demo Environment.

Hope this helps other engineers! 😁

 

DQL:

timeseries by:{dt.entity.service}, request_count = sum(dt.service.request.count)
| summarize by:{dt.entity.service}, `Request Count` = sum(arraySum(request_count))
| fieldsAdd `Service Name` = entityAttr(dt.entity.service, "entity.name")
| lookUp
[
fetch dt.entity.service
| expand dt.entity.host=runs_on[dt.entity.host]
| fieldsAdd dt.entity.host.name = entityAttr(dt.entity.host, "entity.name")
], lookupField:id, sourceField:dt.entity.service
| fieldsRename `Host Name` = lookup.dt.entity.host.name
| filter isNotNull(`Host Name`)
| fields `Host Name`, `Service Name`, `Request Count`


Result:

CharlesPerez_0-1752205858109.png

 

Regards,
Charles Perez

looking for something similar but need to aggregate or sum up all the requests count for each host (disregarding service name, not needed), so that the table would just have a single count value per server

Featured Posts