13 Apr 2023
07:36 AM
- last edited on
02 May 2023
06:31 AM
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.
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")'});
}
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.
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")'});
}
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").
Thank you! I was missing the entitySelector literal, thus not working!
Just tested an is working as well! Many thanks!!!