<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Davis Forcast Issue in raising violation event in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249620#M991</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/63691"&gt;@amita&lt;/a&gt;&amp;nbsp;- I hope the above answers were help you to solve your issue, if so,&amp;nbsp;&lt;SPAN&gt;please 'accept as solution', to help us close this community question.&amp;nbsp;&lt;BR /&gt;Thanks, Penny&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Jul 2024 06:36:53 GMT</pubDate>
    <dc:creator>PennyScully</dc:creator>
    <dc:date>2024-07-02T06:36:53Z</dc:date>
    <item>
      <title>Davis Forcast Issue in raising violation event</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249083#M979</link>
      <description>&lt;P&gt;We are trying to raise violation event using Davis Forecaster in Workflow.&lt;/P&gt;&lt;P&gt;However getting below error for violation task "&lt;STRONG&gt;An error of type UNCAUGHT_EXCEPTION occurred in an imported library: 400: Constraints violated.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at EventsClient.createEvent (file:///opt/sdk_modules/@dynatrace-sdk/client-classic-environment-v2/esm/index.js:9655:17)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;at eventLoopTick (ext:core/01_core.js:169:"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Below is the "violation event" task code&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;import { eventsClient, EventIngestEventType } from "@dynatrace-sdk/client-classic-environment-v2";&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;import { execution } from '@dynatrace-sdk/automation-utils';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#333399"&gt;export default async function ({ execution_id }) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;const exe = await execution(execution_id);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;const checkResult = await exe.result('check_prediction');&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;const violations = await checkResult.violations;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;// Raise an event for each violation&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;violations.forEach(function (violation) {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;eventsClient.createEvent({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;body : {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;eventType: EventIngestEventType.ResourceContentionEvent,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;title: 'Custom Dummy Problem for Demo(kindlyignore)',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;entitySelector: 'type(MEMORY),entityId("' + violation['dt.runtime.jvm.memory.free'] + '")',&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;properties: {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;'dt.entity.process_group_instance' : violation['dt.entity.process_group_instance']&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;});&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;});&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#333399"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The DQL is&lt;FONT color="#000080"&gt; 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"}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Let us know if something is missing or need to change here&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Thanks in Advance&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Regards&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;Amita&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 07:34:54 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249083#M979</guid>
      <dc:creator>amita</dc:creator>
      <dc:date>2024-06-25T07:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Davis Forcast Issue in raising violation event</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249274#M980</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/63691"&gt;@amita&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;It's possible that the body has misconfigured information, which would result in a 400 range error (bad request). You could try an API development tool such as Insomnia or Postman to ensure that communication to the endpoint is working as expected. Have you checked out the &lt;A href="https://developer.dynatrace.com/develop/data/ingest-data/#events-davis-events" target="_blank" rel="noopener"&gt;guide for ingesting Davis events&lt;/A&gt; yet? It includes an example of ingesting events.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;BR /&gt;Sarah&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 10:42:35 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249274#M980</guid>
      <dc:creator>SarahFaustmann</dc:creator>
      <dc:date>2024-06-27T10:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Davis Forcast Issue in raising violation event</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249370#M985</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/63691"&gt;@amita&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;to get more information, can you try to wrap the "eventsClient.createEvent" code in a try/catch block? You can find more information and examples in the docs:&amp;nbsp;&lt;A href="https://developer.dynatrace.com/preview/reference/sdks/#error-handling" target="_blank"&gt;https://developer.dynatrace.com/preview/reference/sdks/#error-handling&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 09:06:19 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249370#M985</guid>
      <dc:creator>Roberto_Tonino</dc:creator>
      <dc:date>2024-06-28T09:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Davis Forcast Issue in raising violation event</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249620#M991</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/63691"&gt;@amita&lt;/a&gt;&amp;nbsp;- I hope the above answers were help you to solve your issue, if so,&amp;nbsp;&lt;SPAN&gt;please 'accept as solution', to help us close this community question.&amp;nbsp;&lt;BR /&gt;Thanks, Penny&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 06:36:53 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249620#M991</guid>
      <dc:creator>PennyScully</dc:creator>
      <dc:date>2024-07-02T06:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Davis Forcast Issue in raising violation event</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249798#M992</link>
      <description>&lt;P&gt;Thanks for the suggestions .Will try and get back to you incase of any query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Amita&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jul 2024 07:43:46 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Davis-Forcast-Issue-in-raising-violation-event/m-p/249798#M992</guid>
      <dc:creator>amita</dc:creator>
      <dc:date>2024-07-03T07:43:46Z</dc:date>
    </item>
  </channel>
</rss>

