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

Dynatrace Metric API (API v2): how Dynatrace order target hosts

ntanaka
Guide

Hi,


I have a question about Dynatrace Metric API (API v2)

We are capturing builtin:host.cpu.user.

We wonder how Dynatrace order target hosts.

We use scope function, but the order is different from scope.


example

scope=entity(Host1,Host2,Host3)

response: Host2 -> Host3 -> Host1


Best Regards,

Natsumi Tanaka



2 REPLIES 2

Dt may use order from it’s database by default. This order for you is always the same, or it’s randomized somehow?

Sebastian


Thank you for your response!
In our environment, hosts are sorted by IP address like this.

HOST-7395C0805A33209F172.16.74.51
HOST-E09873E2C4EB8658172.16.74.85
HOST-389551CF7323D34E172.16.75.54
HOST-B25461C52627701A172.16.133.212


However, I understood there is no guarantee as to the sorting order of these results.
I asked the same question via chat and got answer from the team.

"The short answer is there is no guarantee as to the sorting order of these results.
Conceptually, your scope expression filters a sorted list of hosts, and the resulting list is still sorted. The sorting order in which you get the results on a single page of metric query cannot be known for sure in advance. Some metric queries are split into sub-queries and these are carried out in parallel - so there's no way of knowing which sub-query will finish first.
It would be best not to rely on the order as this is an internal implementation of our underlying infrastructure and such things might change in the future."