# creation of a custom alert for a specific API

**URL:** <https://community.dynatrace.com/t/creation-of-a-custom-alert-for-a-specific-api/49590>\
**Category:** Alerting\
**Tags:** dynatrace-managed, threshold, anomaly-detection\
**Created:** [January 7, 2025, 12:33pm UTC](https://community.dynatrace.com/t/creation-of-a-custom-alert-for-a-specific-api/49590 "2025-01-07T12:33:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mehakpuri01](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@mehakpuri01](https://community.dynatrace.com/u/mehakpuri01)\
**Post date:** [January 7, 2025, 12:33pm UTC](https://community.dynatrace.com/t/creation-of-a-custom-alert-for-a-specific-api/49590/1 "2025-01-07T12:33:50Z")

</div>

Hi,

I am tasked with the creation of a custom alert for a specific API, wherein I want to set the alert based on this:  
1. should have auto-adaptive threshold  
2. For each time frame, the past week’s traffic data should be reviewed, identify the highest traffic value, and set the alert threshold 25% above that maximum.

I have configured a alert, wherein i am to able to set the threshold using static threshold only, but this does not solve my use case. I even created a calculate service metric but still i can set only static thresholds.

 ![mehakpuri01_0-1736253159249.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/deca0cef8880f65b57d0a48cba1ed6536037ea66.png)

---

<div class="post-metadata">

**Author:** ![mizso74](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mizso74/32/41729_2.png) [@mizso74](https://community.dynatrace.com/u/mizso74)\
**Post date:** [January 8, 2025, 5:58am UTC](https://community.dynatrace.com/t/creation-of-a-custom-alert-for-a-specific-api/49590/2 "2025-01-08T05:58:24Z")

</div>

Hi&nbsp;[@mehakpuri01](https://community.dynatrace.com/user/85042)

I thnik you can use auto-adaptive threshold only with metric selector type. Create your metric expression from your metric in the Data explorer advance mode.

 ![Mizs_0-1736315817571.png](https://global.discourse-cdn.com/dynatrace/original/3X/3/f/3fda16d3028657059ece62038b2e16ff736c7e41.png)

Best regards,

János
