Alerting profiles API - POST a profile
This API is deprecated. Use the Settings API instead. Look for the Problem alerting profiles (builtin:alerting.profile
) schema.
Creates a new alerting profile.
The request consumes and produces an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/alertingProfiles |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/alertingProfiles | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/alertingProfiles |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
The body must not provide an ID. An ID is assigned automatically by Dynatrace.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | AlertingProfile | The JSON body of the request. Contains parameters of the new alerting profile. | body | optional |
Request body objects
The AlertingProfile
object
Configuration of an alerting profile.
Element | Type | Description | Required |
---|---|---|---|
displayName | string | The name of the alerting profile, displayed in the UI. | required |
eventTypeFilters | AlertingEventTypeFilter[] | The list of event filters. For all filters that are negated inside of these event filters, that is all "Predefined" as well as "Custom" (Title and/or Description) ones the AND logic applies. For all non-negated ones the OR logic applies. Between these two groups, negated and non-negated, the AND logic applies. If you specify both severity rule and event filter, the AND logic applies. | optional |
id | string | The ID of the alerting profile. | optional |
metadata | ConfigurationMetadata | Metadata useful for debugging | optional |
mzId | string | The ID of the management zone to which the alerting profile applies. | optional |
rules | AlertingProfileSeverityRule[] | A list of severity rules. The rules are evaluated from top to bottom. The first matching rule applies and further evaluation stops. If you specify both severity rule and event filter, the AND logic applies. | optional |
The AlertingEventTypeFilter
object
Configuration of the event filter for the alerting profile.
You have two mutually exclusive options:
- Select an event type from the list of the predefined events. Specify it in the predefinedEventFilter field.
- Set a rule for custom events. Specify it in the customEventFilter field.
Element | Type | Description | Required |
---|---|---|---|
customEventFilter | AlertingCustomEventFilter | Configuration of a custom event filter. Filters custom events by title or description. If both specified, the AND logic applies. | optional |
predefinedEventFilter | AlertingPredefinedEventFilter | Configuration of a predefined event filter. | optional |
The AlertingCustomEventFilter
object
Configuration of a custom event filter.
Filters custom events by title or description. If both specified, the AND logic applies.
Element | Type | Description | Required |
---|---|---|---|
customDescriptionFilter | AlertingCustomTextFilter | Configuration of a matching filter. | optional |
customTitleFilter | AlertingCustomTextFilter | Configuration of a matching filter. | optional |
The AlertingCustomTextFilter
object
Configuration of a matching filter.
Element | Type | Description | Required |
---|---|---|---|
caseInsensitive | boolean | The condition is case sensitive ( If not set, then | required |
enabled | boolean | The filter is enabled ( | required |
negate | boolean | Reverses the comparison operator. For example it turns the begins with into does not begin with. | required |
operator | string | Operator of the comparison. You can reverse it by setting negate to
| required |
value | string | The value to compare to. | required |
The AlertingPredefinedEventFilter
object
Configuration of a predefined event filter.
Element | Type | Description | Required |
---|---|---|---|
eventType | string | The type of the predefined event.
| required |
negate | boolean | The alert triggers when the problem of specified severity arises while the specified event is happening ( For example, if you chose the Slowdown ( Consider the following use case as an example. The Slowdown (
| required |
The ConfigurationMetadata
object
Metadata useful for debugging
Element | Type | Description | Required |
---|---|---|---|
clusterVersion | string | Dynatrace version. | optional |
configurationVersions | integer[] | A sorted list of the version numbers of the configuration. | optional |
currentConfigurationVersions | string[] | A sorted list of version numbers of the configuration. | optional |
The AlertingProfileSeverityRule
object
A severity rule of the alerting profile.
A severity rule defines the level of severity that must be met before an alert is sent our for a detected problem. Additionally it restricts the alerting to certain monitored entities.
Element | Type | Description | Required |
---|---|---|---|
delayInMinutes | integer | Send a notification if a problem remains open longer than X minutes. | required |
severityLevel | string | The severity level to trigger the alert.
| required |
tagFilter | AlertingProfileTagFilter | Configuration of the tag filtering of the alerting profile. | required |
The AlertingProfileTagFilter
object
Configuration of the tag filtering of the alerting profile.
Element | Type | Description | Required |
---|---|---|---|
includeMode | string | The filtering mode:
| required |
tagFilters | TagFilter[] | A list of required tags. | optional |
The TagFilter
object
A tag-based filter of monitored entities.
Element | Type | Description | Required |
---|---|---|---|
context | string | The origin of the tag, such as AWS or Cloud Foundry. Custom tags use the
| required |
key | string | The key of the tag. Custom tags have the tag value here. | required |
value | string | The value of the tag. Not applicable to custom tags. | optional |
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
1{2 "displayName": "sampleAlertingProfile",3 "eventTypeFilters": [4 {5 "predefinedEventFilter": {6 "eventType": "OSI_HIGH_CPU",7 "negate": true8 }9 },10 {11 "customEventFilter": {12 "customDescriptionFilter": {13 "caseInsensitive": false,14 "enabled": false,15 "negate": true,16 "operator": "CONTAINS",17 "value": "filterValue"18 },19 "customTitleFilter": {20 "caseInsensitive": true,21 "enabled": true,22 "negate": false,23 "operator": "EQUALS",24 "value": "filterValue"25 }26 }27 }28 ],29 "id": "12345678-abcd-1234-abcd-1234567890ab",30 "mzId": "1",31 "rules": [32 {33 "delayInMinutes": 60,34 "severityLevel": "AVAILABILITY",35 "tagFilter": {36 "includeMode": "INCLUDE_ALL",37 "tagFilters": [38 {39 "context": "AWS",40 "key": "tagKey",41 "value": "tagValue"42 }43 ]44 }45 }46 ]47}
Response
Response codes
Code | Type | Description |
---|---|---|
201 | EntityShortRepresentation | Success. The new alerting profile has been created. The response contains the ID of the new alerting profile. |
400 | ErrorEnvelope | Failed. The input is invalid. |
Response body objects
The EntityShortRepresentation
object
The short representation of a Dynatrace entity.
Element | Type | Description |
---|---|---|
description | string | A short description of the Dynatrace entity. |
id | string | The ID of the Dynatrace entity. |
name | string | The name of the Dynatrace entity. |
Response body JSON model
1{2 "description": "Dynatrace entity for the REST API example",3 "id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a",4 "name": "Dynatrace entity"5}
Validate payload
We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.
The request consumes an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/alertingProfiles/validator |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/alertingProfiles/validator | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/alertingProfiles/validator |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Response
Response codes
Code | Type | Description |
---|---|---|
204 | - | Validated. The submitted alerting profile is valid. Response doesn't have a body |
400 | ErrorEnvelope | Failed. The input is invalid. |
Example
In this example, the request creates a new alerting profile with the following parameters:
- Severity level: Availability, triggers after 2 minutes
- Applies to monitored entities with MainApp tag.
- Triggers when the Browser monitor global outage event is occurring.
The API token is passed in the Authorization header.
Because the request body is lengthy, it is truncated in this example Curl section. See the full body in the Request body section. You can download or copy the example request body to try it out on your own. Before using it, make sure that you're using tags that are available in your environment.
Curl
1curl -X POST \2 https://mySampleEnv.live.dynatrace.com/api/config/v1/alertingProfiles \3 -H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \4 -H 'Content-Type: application/json' \5 -d '{<truncated - see the Request body section >}'
Request URL
1https://mySampleEnv.live.dynatrace.com/api/config/v1/alertingProfiles
Request body
1{2 "displayName": "App availability",3 "rules": [4 {5 "severityLevel": "AVAILABILITY",6 "tagFilter": {7 "includeMode": "INCLUDE_ANY",8 "tagFilters": [9 {10 "context": "CONTEXTLESS",11 "key": "MainApp"12 }13 ]14 },15 "delayInMinutes": 216 }17 ],18 "mzId": "9130632296508575249",19 "eventTypeFilters": [20 {21 "predefinedEventFilter": {22 "eventType": "SYNTHETIC_GLOBAL_OUTAGE",23 "negate": false24 }25 }26 ]27}
Response body
1{2 "id": "19e50c27-8aed-408f-ad44-d6a1bf856f49",3 "name": "App availability"4}
Response code
201
Result
The new alerting profile looks like this in the UI: