13 Apr 2023 03:36 PM - last edited on 02 May 2023 02:31 PM by educampver
Hi,
I'm trying to use the monitoredEntitiesMonitoringStateClient (Classic Environment V2 | Dynatrace Developer)
But i'm getting a 540 error running in a Notebook, while using others (like problemsClient) from the same sdk is just working properly. How can troubleshoot further whats going on? Is there any place to get more details around the errors?
Solved! Go to Solution.
17 Apr 2023 09:36 AM - edited 17 Apr 2023 09:39 AM
Can you provide your example please?
I tested following example which works.
import { monitoredEntitiesMonitoringStateClient } from '@dynatrace-sdk/client-classic-environment-v2';
export default async function () {
return await monitoredEntitiesMonitoringStateClient.getStates({ entitySelector: 'type("PROCESS_GROUP_INSTANCE")'});
}
17 Apr 2023 04:43 PM
This monitoring state client really does not have pagination support or filtering on states which are not ok? I could not find any way how to use it effectively in a larger environment (>500 PGI) since the API returns 500 results at maximum.
17 Apr 2023 04:49 PM
You can return the PGI with unhealthy states, with:
import { monitoredEntitiesMonitoringStateClient } from '@dynatrace-sdk/client-classic-environment-v2';
export default async function () {
return monitoredEntitiesMonitoringStateClient.getStates({entitySelector: 'type("PROCESS_GROUP_INSTANCE"),healthState("UNHEALTHY")'});
}
17 Apr 2023 05:11 PM
Well, this does not work the expected way. I've never seen any entity in any environment in the UNHEALTH healthState.
For example in the demo live environment, this returns empty result with querying the UNHEALTHY state, but there are process groups having issue (state: "WARNING").
17 Apr 2023 04:05 PM
Thank you! I was missing the entitySelector literal, thus not working!
Just tested an is working as well! Many thanks!!!