Showing results for 
Show  only  | Search instead for 
Did you mean: 

Create an Alerting Profile for an API


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?




DynaMight Guru
DynaMight Guru


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?


Have a nice day!

It is monitored by OneAgent

Hi @Munzir

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": {
"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"


Dynatrace Participant
Dynatrace Participant

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.

Featured Posts