We are trying to raise violation event using Davis Forecaster in Workflow.
However getting below error for violation task "An error of type UNCAUGHT_EXCEPTION occurred in an imported library: 400: Constraints violated.
at EventsClient.createEvent (file:///opt/sdk_modules/@dynatrace-sdk/client-classic-environment-v2/esm/index.js:9655:17)
at eventLoopTick (ext:core/01_core.js:169:"
Below is the “violation event” task code
import { eventsClient, EventIngestEventType } from “@dynatrace-sdk/client-classic-environment-v2”;
import { execution } from ‘@dynatrace-sdk/automation-utils’;
export default async function ({ execution_id }) {
const exe = await execution(execution_id);
const checkResult = await exe.result(‘check_prediction’);
const violations = await checkResult.violations;
// Raise an event for each violation
violations.forEach(function (violation) {
eventsClient.createEvent({
body : {
eventType: EventIngestEventType.ResourceContentionEvent,
title: ‘Custom Dummy Problem for Demo(kindlyignore)’,
entitySelector: ‘type(MEMORY),entityId("’ + violation[‘dt.runtime.jvm.memory.free’] + ‘")’,
properties: {
‘dt.entity.process_group_instance’ : violation[‘dt.entity.process_group_instance’]
}
}
});
});
};
The DQL is timeseries exhausted_memory=avg(dt.runtime.jvm.memory.free) , by: { dt.entity.process_group_instance } , filter: { dt.entity.process_group_instance==“PROCESS_GROUP_INSTANCE-ID”}
Let us know if something is missing or need to change here
Thanks in Advance
Regards
Amita