# Custom problem generate to predict resource outage  ger closed in 15 minutes automatically

**URL:** <https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933>\
**Category:** Alerting\
**Tags:** problem-detection, davis, problems, events\
**Created:** [March 27, 2025, 5:33pm UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933 "2025-03-27T17:33:17Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![heramb\_sawant](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@heramb\_sawant](https://community.dynatrace.com/u/heramb_sawant)\
**Post date:** [March 27, 2025, 5:33pm UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/1 "2025-03-27T17:33:17Z")

</div>

Hi&nbsp;  
I am following this blog and implemented the same workflow which identifies the entity having resource outage, it generate problem by creating event by js code.This event generations is creating problem for the prediction with entity details but that problem is getting closed after minutes automatically. Can somebody please help me to understand why?

Also is there way to add more details to problem like problem description of custom fields and also can we set how long problem should remain problem.

> **[Automate predictive capacity management with Davis AI for Workflows](https://www.dynatrace.com/news/blog/automate-predictive-capacity-management-with-davis-ai-for-workflows/)**
>
> This blog post introduces Davis® AI for Workflows, showing you how to fully automate prediction and remediation of your capacity demands.

---

<div class="post-metadata">

**Author:** ![heramb\_sawant](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@heramb\_sawant](https://community.dynatrace.com/u/heramb_sawant)\
**Post date:** [March 27, 2025, 5:53pm UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/2 "2025-03-27T17:53:54Z")

</div>

Please guide me on this.

---

<div class="post-metadata">

**Author:** ![marco\_irmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marco_irmer/32/3038_2.png) [@marco\_irmer](https://community.dynatrace.com/u/marco_irmer)\
**Post date:** [March 27, 2025, 11:05pm UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/3 "2025-03-27T23:05:47Z")

</div>

I believe you will need to amend your code to supply the [timeout parameter](https://docs.dynatrace.com/docs/discover-dynatrace/references/semantic-dictionary/model/davis#davis-events). The default value is 15 minutes unless you specify another value. This will set the timeout value to control how long the event will stay active without being refreshed (up to 6 hours). Please note that you can also keep the problem open by sending the same payload again (such as from a subsequent execution of the workflow).

---

<div class="post-metadata">

**Author:** ![heramb\_sawant](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@heramb\_sawant](https://community.dynatrace.com/u/heramb_sawant)\
**Post date:** [March 28, 2025, 12:30pm UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/4 "2025-03-28T12:30:56Z")

</div>

Thanks Marco for providing solution.

I tried adding&nbsp; in properties&nbsp; but getting error response.

violations.forEach(function (violation) {  
eventsClient.createEvent({  
body : {  
eventType: EventIngestEventType.ResourceContentionEvent,  
title: 'Prediction Alarm ',  
entitySelector: ‘type(host),entityId("’ + violation[‘dt.entity.host’] + ‘")’,  
properties: {  
‘dt.davis.timeout’ : 40,  
‘dt.entity.host’ : violation[‘dt.entity.host’],  
‘dt.entity.disk’ : violation[‘dt.entity.disk’]  
}  
}  
});  
});

Getting Below error ,

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:8056:17)  
at eventLoopTick (ext:core/01\_core.js:175:7)

---

<div class="post-metadata">

**Author:** ![heramb\_sawant](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@heramb\_sawant](https://community.dynatrace.com/u/heramb_sawant)\
**Post date:** [March 31, 2025, 2:14pm UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/5 "2025-03-31T14:14:15Z")

</div>

Hey ,  
Can somebody please help me to fix this issue.

---

<div class="post-metadata">

**Author:** ![heramb\_sawant](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@heramb\_sawant](https://community.dynatrace.com/u/heramb_sawant)\
**Post date:** [April 1, 2025, 8:31am UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/6 "2025-04-01T08:31:55Z")

</div>

Any help will be appreciated.

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [April 1, 2025, 10:19am UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/7 "2025-04-01T10:19:18Z")

</div>

Check if this give you additional information.

```javascript
violations.forEach(function (violation) {
    eventsClient.createEvent({
        body: {
            eventType: EventIngestEventType.ResourceContentionEvent,
            title: 'Prediction Alarm',
            entitySelector: 'type(host),entityId("' + violation['dt.entity.host'] + '")',
            properties: {
                'dt.davis.timeout': 40,
                'dt.entity.host': violation['dt.entity.host'],
                'dt.entity.disk': violation['dt.entity.disk']
            }
        }
    }).catch(error => {
        console.error('Error creating event:', error);
    });
});

```

---

<div class="post-metadata">

**Author:** ![marco\_irmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marco_irmer/32/3038_2.png) [@marco\_irmer](https://community.dynatrace.com/u/marco_irmer)\
**Post date:** [April 1, 2025, 10:41pm UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/8 "2025-04-01T22:41:48Z")

</div>

Hi,

Your amended code passes the paramter dt.davis.timeout within the properties object. This is incorrect per the documentation. The parameter should be passed as ‘timeout’ (excluding quotation marks) in the main section.

I have amended your code below:

```javascript
violations.forEach(function (violation) {
eventsClient.createEvent({
body : {
eventType: EventIngestEventType.ResourceContentionEvent,
title: 'Prediction Alarm ',
entitySelector: 'type(host),entityId("' + violation['dt.entity.host'] + '")',
timeout : 40,
properties: {
'dt.entity.host' : violation['dt.entity.host'],
'dt.entity.disk' : violation['dt.entity.disk']
}
}
});
});

```

---

<div class="post-metadata">

**Author:** ![heramb\_sawant](https://avatars.discourse-cdn.com/v4/letter/h/c4cdca/32.png) [@heramb\_sawant](https://community.dynatrace.com/u/heramb_sawant)\
**Post date:** [April 2, 2025, 7:19am UTC](https://community.dynatrace.com/t/custom-problem-generate-to-predict-resource-outage-ger-closed-in-15-minutes-automatically/50933/9 "2025-04-02T07:19:49Z")

</div>

Thanks Marco . That works&nbsp;:grinning\_face:
