Alerting profiles API - PUT a profile
Updates the specified alerting profile. If an alerting profile with the specified ID doesn't exist, a new profile is created.
The request consumes and produces an application/json
payload.
This request is an Early Adopter release and may be changed in non-compatible way.
PUT | Managed | https://{your-domain}/e/{your-environment-id}/api/config/v1/alertingProfiles/{id} |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/alertingProfiles/{id} | |
Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/alertingProfiles/{id} |
Authentication
To execute this request, you need an access token with Write configuration (WriteConfig
) scope. To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
id | string | The ID of the alerting profile to be updated. | path | required |
body | Alerting | The JSON body of the request. Contains updated parameters of the alerting profile. | body | optional |
Request body objects
The AlertingProfile
object
Configuration of an alerting profile.
Element | Type | Description |
---|---|---|
metadata | Configuration | Metadata useful for debugging Can be |
id | string | The ID of the alerting profile. Can be |
displayName | string | The name of the alerting profile, displayed in the UI. |
rules | Alerting | 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. Can be |
mzId | string | The ID of the management zone to which the alerting profile applies. Can be |
eventTypeFilters | Alerting | 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. Can be |
The ConfigurationMetadata
object
Metadata useful for debugging
Element | Type | Description |
---|---|---|
configurationVersions | integer[] | A sorted list of the version numbers of the configuration. Can be |
currentConfigurationVersions | string[] | A sorted list of version numbers of the configuration. Can be |
clusterVersion | string | Dynatrace version. Can be |
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 |
---|---|---|
severityLevel | string | The severity level to trigger the alert. |
tagFilter | Alerting | Configuration of the tag filtering of the alerting profile. |
delayInMinutes | integer | Send a notification if a problem remains open longer than X minutes. |
The AlertingProfileTagFilter
object
Configuration of the tag filtering of the alerting profile.
Element | Type | Description |
---|---|---|
includeMode | string | The filtering mode:
|
tagFilters | Tag | A list of required tags. Can be |
The TagFilter
object
A tag-based filter of monitored entities.
Element | Type | Description |
---|---|---|
context | string | The origin of the tag, such as AWS or Cloud Foundry. Custom tags use the |
key | string | The key of the tag. Custom tags have the tag value here. |
value | string | The value of the tag. Not applicable to custom tags. Can be |
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 |
---|---|---|
predefinedEventFilter | Alerting | Configuration of a predefined event filter. Can be |
customEventFilter | Alerting | Configuration of a custom event filter. Filters custom events by title or description. If both specified, the AND logic applies. Can be |
The AlertingPredefinedEventFilter
object
Configuration of a predefined event filter.
Element | Type | Description |
---|---|---|
eventType | string | The type of the predefined event. |
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 (
|
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 |
---|---|---|
customTitleFilter | Alerting | Configuration of a matching filter. Can be |
customDescriptionFilter | Alerting | Configuration of a matching filter. Can be |
The AlertingCustomTextFilter
object
Configuration of a matching filter.
Element | Type | Description |
---|---|---|
enabled | boolean | The filter is enabled ( |
value | string | The value to compare to. |
operator | string | Operator of the comparison. You can reverse it by setting negate to |
negate | boolean | Reverses the comparison operator. For example it turns the begins with into does not begin with. |
caseInsensitive | boolean | The condition is case sensitive ( If not set, then |
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.
{
"id": "12345678-abcd-1234-abcd-1234567890ab",
"displayName": "sampleAlertingProfile",
"mzId": "1",
"rules": [
{
"severityLevel": "AVAILABILITY",
"tagFilter": {
"includeMode": "INCLUDE_ALL",
"tagFilters": [
{
"context": "AWS",
"key": "tagKey",
"value": "tagValue"
}
]
},
"delayInMinutes": 60
}
],
"eventTypeFilters": [
{
"predefinedEventFilter": {
"eventType": "OSI_HIGH_CPU",
"negate": true
}
},
{
"customEventFilter": {
"customTitleFilter": {
"enabled": true,
"value": "filterValue",
"operator": "EQUALS",
"negate": false,
"caseInsensitive": true
},
"customDescriptionFilter": {
"enabled": false,
"value": "filterValue",
"operator": "CONTAINS",
"negate": true,
"caseInsensitive": false
}
}
}
]
}
Response
Response codes
Code | Type | Description |
---|---|---|
201 | Entity | Success. The new alerting profile has been created. The response contains the ID of the new alerting profile. |
204 | - | Success. The alerting profile has been updated. Response doesn't have a body. |
400 | Error | Failed. The input is invalid. |
Response body objects
The EntityShortRepresentation
object
The short representation of a Dynatrace entity.
Element | Type | Description |
---|---|---|
id | string | The ID of the Dynatrace entity. |
name | string | The name of the Dynatrace entity. Can be |
description | string | A short description of the Dynatrace entity. Can be |
Response body JSON model
{
"id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a",
"name": "Dynatrace entity",
"description": "Dynatrace entity for the REST API example"
}
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.
This request is an Early Adopter release and may be changed in non-compatible way.
POST | Managed | https://{your-domain}/e/{your-environment-id}/api/config/v1/alertingProfiles/{id}/validator |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/alertingProfiles/{id}/validator | |
Environment ActiveGate | https://{your-activegate-domain}/e/{your-environment-id}/api/config/v1/alertingProfiles/{id}/validator |
Authentication
To execute this request, you need an access token with Write configuration (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 | Error | Failed. The input is invalid. |
Example
In this example, the request updates the alerting profile from the POST request example. It makes the following changes:
- Reduces delay to 1 minute.
- Adds a second tag of monitored entities: MobileApp.
- Adds a second event filter that requires Unexpected low traffic to not be present.
The API token is passed in the Authorization header.
You can download or copy the example request body to try it out on your own. By sure to replace tags with some that you have in your environment.
Curl
curl -X PUT \
https://mySampleEnv.live.dynatrace.com/api/config/v1/alertingProfiles/19e50c27-8aed-408f-ad44-d6a1bf856f49 \
-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{<truncated - see the Request body section >}
'
Request URL
https://mySampleEnv.live.dynatrace.com/api/config/v1/alertingProfiles/19e50c27-8aed-408f-ad44-d6a1bf856f49
Request body
{
"displayName": "App availability",
"rules": [
{
"severityLevel": "AVAILABILITY",
"tagFilter": {
"includeMode": "INCLUDE_ANY",
"tagFilters": [
{
"context": "CONTEXTLESS",
"key": "MainApp"
},
{
"context": "CONTEXTLESS",
"key": "MobileApp"
}
]
},
"delayInMinutes": 1
}
],
"mzId": "9130632296508575249",
"eventTypeFilters": [
{
"predefinedEventFilter": {
"eventType": "SYNTHETIC_GLOBAL_OUTAGE",
"negate": false
}
},
{
"predefinedEventFilter": {
"eventType": "APPLICATION_UNEXPECTED_HIGH_LOAD",
"negate": true
}
}
]
}
Response code
204
Result
The updated alerting profile has the following parameters: