09 Jul 2025
02:33 AM
- last edited on
11 Jul 2025
12:07 PM
by
Karolina_Linda
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?
Solved! Go to Solution.
09 Jul 2025 11:01 AM
Hi,
You can see that information already seeing requests:
You can see information per instance.
Best regards
10 Jul 2025 02:02 AM
I think perhaps Charles is asking is it possible to do it via DQL
10 Jul 2025 02:17 AM
That is correct sir. Apologies, I was not able to mention it on my earlier inquiry.
Thank you for pointing that out 😊
Regards,
Charles
10 Jul 2025 09:46 AM
Hi,
I have just added DQL reference in message, and move it to DQL forum.
Best regards
10 Jul 2025 10:00 AM
Thank you for the assistance Sir @AntonPineiro!! 😊
10 Jul 2025 02:07 AM
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.
Regards,
Charles
10 Jul 2025 09:43 AM
Hi,
I think @sia_h has already pointing you to a solution.
Best regards
09 Jul 2025 01:23 PM
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.
10 Jul 2025 05:09 AM - edited 10 Jul 2025 05:09 AM
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."
10 Jul 2025 09:57 AM
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
11 Jul 2025 03:30 AM
Hi @sia_h,
I tried to simplify the table, but the service seems to appear Null.
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
11 Jul 2025 04:33 AM
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.
11 Jul 2025 04:33 AM - edited 11 Jul 2025 04:51 AM
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:
Regards,
Charles Perez
26 Aug 2025 03:27 PM
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