# Create an Alerting Profile for an API

**URL:** <https://community.dynatrace.com/t/create-an-alerting-profile-for-an-api/42346>\
**Category:** Alerting\
**Tags:** problems-classic, dynatrace-api\
**Created:** [October 30, 2023, 6:56am UTC](https://community.dynatrace.com/t/create-an-alerting-profile-for-an-api/42346 "2023-10-30T06:56:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Munzir](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Munzir](https://community.dynatrace.com/u/Munzir)\
**Post date:** [October 30, 2023, 6:56am UTC](https://community.dynatrace.com/t/create-an-alerting-profile-for-an-api/42346/1 "2023-10-30T06:56:10Z")

</div>

Want to create an alerting profile (send an email) for an API if the failure rate of that API goes above 10%, how can we do that?

Thanks

---

<div class="post-metadata">

**Author:** ![radek\_jasinski](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/radek_jasinski/32/10432_2.png) [@radek\_jasinski](https://community.dynatrace.com/u/radek_jasinski)\
**Post date:** [October 30, 2023, 8:15am UTC](https://community.dynatrace.com/t/create-an-alerting-profile-for-an-api/42346/2 "2023-10-30T08:15:40Z")

</div>

[@Munzir](https://community.dynatrace.com/user/67998)

Can you explain for which API you want to create alerting profile? Is this element monitored by OneAgent? Is it an API of some other solution?

Radek

---

<div class="post-metadata">

**Author:** ![Munzir](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@Munzir](https://community.dynatrace.com/u/Munzir)\
**Post date:** [October 30, 2023, 8:29am UTC](https://community.dynatrace.com/t/create-an-alerting-profile-for-an-api/42346/3 "2023-10-30T08:29:02Z")

</div>

It is monitored by OneAgent

---

<div class="post-metadata">

**Author:** ![JamesD09](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/jamesd09/32/24700_2.png) [@JamesD09](https://community.dynatrace.com/u/JamesD09)\
**Post date:** [November 7, 2023, 1:35pm UTC](https://community.dynatrace.com/t/create-an-alerting-profile-for-an-api/42346/4 "2023-11-07T13:35:57Z")

</div>

To set up an alert on an API service which triggers at \>10% failure rate you can follow these steps.

1. Identify the API service  
2. Open a custom multidimensional analysis

3. select “failure rate” form the metric selector (top left of the multidimensional analysis)

4. Click on create metric - you have now created a metric which looks at the failure rate of your API service.

5. Navigate to settings \> anomaly detection \> metric events

6. Create your custom metric event based on the metric you just created, specifying your thresholds in the monitoring strategy section.

---

<div class="post-metadata">

**Author:** ![shubham1413](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@shubham1413](https://community.dynatrace.com/u/shubham1413)\
**Post date:** [November 7, 2023, 1:48pm UTC](https://community.dynatrace.com/t/create-an-alerting-profile-for-an-api/42346/5 "2023-11-07T13:48:19Z")

</div>

Hi [@Munzir](https://community.dynatrace.com/user/67998)

Please find the api for creation the custome metrix for perticular api

-----++++++--------+++++--------  
curl -X ‘POST’ \  
‘https://{my-domain}/e/{my-environment}//api/v2/settings/objects?validateOnly=true’ \  
-H ‘accept: application/json; charset=utf-8’ \  
-H ‘Authorization: Api-Token {my-token}’ \  
-H ‘Content-Type: application/json; charset=utf-8’ \  
-d '[  
{  
“schemaId”: “builtin:anomaly-detection.metric-events”,  
“scope”: “environment”,  
“schemaVersion”: “1.0.15”,  
“value”: {  
“enabled”: true,  
“summary”: “Summary of custom metric”,  
“queryDefinition”: {  
“type”: “METRIC\_KEY”,  
“metricKey”: “builtin:service.keyRequest.errors.server.rate”,  
“aggregation”: “AVG”,  
“entityFilter”: {  
“dimensionKey”: “dt.entity.service\_method”,  
“conditions”: [  
{  
“type”: “NAME”,  
“operator”: “EQUALS”,  
“value”: “API name with key request”  
}  
]  
},  
“dimensionFilter”: []  
},  
“modelProperties”: {  
“type”: “STATIC\_THRESHOLD”,  
“threshold”: 10,  
“alertOnNoData”: false,  
“alertCondition”: “ABOVE”,  
“violatingSamples”: 3,  
“samples”: 5,  
“dealertingSamples”: 5  
},  
“eventTemplate”: {  
“title”: “Title which requried -5xx-ErrorCount)”,  
“description”: “The {metricname} value of {severity} was {alert\_condition} your custom threshold of {threshold}.”,  
“eventType”: “CUSTOM\_ALERT”,  
“davisMerge”: true,  
“metadata”: []  
},  
“eventEntityDimensionKey”: “dt.entity.service\_method”  
}  
}  
]

-----++++++--------+++++--------
