Docs Menu

Update One Alert Configuration

On this page

  • Syntax
  • Request Path Parameters
  • Request Query Parameters
  • Request Body Parameters
  • Response Elements
  • Serverless Measurements
  • Example Request
  • Example Response
Note

Groups and projects are synonymous terms. Your {GROUP-ID} is the same as your project ID. For existing groups, your group/project ID remains the same. The resource and corresponding endpoints use the term groups.

Base URL: https://cloud.mongodb.com/api/atlas/v1.0

PUT /groups/{GROUP-ID}/alertConfigs/{ALERT-CONFIG-ID}
Note

To enable or disable the alert configuration, see Enable/Disable Alert Configuration.

Parameter
Type
Necessity
Description
GROUP-ID
string
Required
Unique identifier for the Project.
ALERT-CONFIG-ID
string
Required
Unique identifier for the alert configuration.

This endpoint might use any of the HTTP request query parameters available to all Atlas Administration API resources. All of these are optional.

Name
Type
Necessity
Description
Default
pretty
boolean
Optional
Flag indicating whether the response body should be in a prettyprint format.
false
envelope
boolean
Optional

Flag indicating if Atlas should wrap the response in a JSON envelope.

This option may be needed for some API clients. These clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

For endpoints that return one result, the response body includes:

status
HTTP response code
envelope
Expected response body
false

Alert configurations depend why you want Atlas to raise an alert. Alerts can be triggered if either:

  • a particular condition is met or
  • a particular metric exceeded a particular value.

To simplify the differences between condition and metrics, click one of the following tabs:

matchers
array of objects
Required

Rules to apply when matching an object against this alert configuration. Only entities that match all these rules are checked for an alert condition.

Atlas limits filtering alerts using matchers when the eventTypeName specifies an event for the following:

  • a host,
  • a replica set, or
  • a sharded cluster.

To add one or more matchers, see Filter Results.

notifications
array of objects
Required

One or more targets for Atlas to send notifications when an alert condition is detected. You can configure any number of notifications for each alert condition.

To add one or more notifications, see Set Notifications.

matchers
.[n].fieldName
string
Required

Name of the field in the target object that you wanted this configuration to match. Atlas accepts the following values:

Host
Replica set
Sharded cluster
TYPE_NAME
HOSTNAME
PORT
HOSTNAME_AND_PORT
REPLICA_SET_NAME
REPLICA_SET_NAME
SHARD_NAME
CLUSTER_NAME
CLUSTER_NAME
SHARD_NAME
matchers
.[n].operator
string
Optional

Comparison operator to apply when checking the current metric value against matcher.[n].value. Atlas accepts the following values:

  • EQUALS
  • NOT_EQUALS
  • CONTAINS
  • NOT_CONTAINS
  • STARTS_WITH
  • ENDS_WITH
  • REGEX
matchers
.[n].value
string
Optional

Value against which the specified operator compares.

If you set matchers.[n].fieldName to TYPE_NAME, you can match on the following values:

  • PRIMARY
  • SECONDARY
  • STANDALONE
  • CONFIG
  • MONGOS
notifications.[n]
.apiToken
string
Conditional

Slack API token.

If the token later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the token.

Set this value if you set notifications.[n].typeName to SLACK.

notifications.[n]
.channelName
string
Conditional

Slack channel name.

Set this value if you set notifications.[n].typeName to SLACK.

notifications.[n]
.datadogApiKey
string
Conditional

Datadog API Key. Found in the Datadog dashboard.

Set this value if you set notifications.[n].typeName to DATADOG.

notifications.[n]
.datadogRegion
string
Conditional

Region that indicates which API URL to use. Atlas accepts the following values:

  • US
  • EU

The default Datadog region is US.

Set this value if you set notifications.[n].typeName to DATADOG.

notifications.[n]
.delayMin
integer
Conditional
Number of minutes to wait after an alert condition is detected before sending out the first notification.
notifications.[n]
.emailAddress
string
Conditional

Email address to which alert notifications are sent.

Set this value if you set notifications.[n].typeName to EMAIL.

You don't need to set this value to send emails to specific users, users with specific project roles, users with specific organization roles, or teams. Use the notifications.[n].emailEnabled parameter for that purpose.

notifications.[n]
.emailEnabled
boolean
Conditional

Flag indicating if email notifications should be sent to this user's email address.

Set this value if you set notifications.[n].typeName to GROUP, ORG, or USER.

notifications.[n]
.flowdockApiToken
string
Conditional

Flowdock personal API token.

If the token later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the token.

Set this value if you set notifications.[n].typeName to FLOWDOCK.

notifications.[n]
.flowName
string
Conditional

Flowdock flow name in lower-case letters. The flow name appears after the organization name in the URL string:

www.flowdock.com/app/<organization-name>/<flow-name>.

Set this value if you set notifications.[n].typeName to FLOWDOCK.

notifications.[n]
.intervalMin
integer
Required

Number of minutes to wait between successive notifications for unacknowledged alerts that are not resolved. The minimum value is 5.

Note

PagerDuty, VictorOps, and OpsGenie notifications don't return this element. You must configure and manage the notification interval within each external service.

notifications.[n]
.mobileNumber
string
Conditional

Mobile number to which alert notifications are sent.

Set this value if you set notifications.[n].typeName to SMS.

You don't need to set this value to send emails to specific users, users with specific project roles, users with specific organization roles, or teams. Use the notifications.[n].smsEnabled parameter for that purpose.

notifications.[n]
.notificationToken
string
Conditional

HipChat API token.

Set this value if you set notifications.[n].typeName to HIP_CHAT.

If the token later becomes invalid, Atlas sends an email to the Project owner and eventually removes the token.

notifications.[n]
.opsGenieApiKey
string
Conditional

Opsgenie API Key.

If the key later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the key.

Set this value if you set notifications.[n].typeName to OPS_GENIE.

notifications.[n]
.opsGenieRegion
string
Conditional

Region that indicates which API URL to use. Atlas accepts the following values:

  • US
  • EU

The default Opsgenie region is US.

Set this value if you set notifications.[n].typeName to OPS_GENIE.

notifications.[n]
.orgName
string
Conditional

Flowdock organization name in lower-case letters. This is the name that appears after www.flowdock.com/app/ in the URL string.

Set this value if you set notifications.[n].typeName to FLOWDOCK.

notifications.[n]
.roles
array of strings
Conditional

One or more roles that receive the configured alert. Atlas accepts the following values:

  • GROUP_CLUSTER_MANAGER
  • GROUP_DATA_ACCESS_ADMIN
  • GROUP_DATA_ACCESS_READ_ONLY
  • GROUP_DATA_ACCESS_READ_WRITE
  • GROUP_OWNER
  • GROUP_READ_ONLY
  • ORG_OWNER
  • ORG_MEMBER
  • ORG_GROUP_CREATOR
  • ORG_BILLING_ADMIN
  • ORG_READ_ONLY

If you include this field, Atlas sends alerts only to users assigned the roles you specify in the array. If you omit this field, Atlas sends alerts to users assigned any role.

Set this value if you set notifications.[n].typeName to GROUP or ORG.

notifications.[n]
.roomName
string
Conditional

HipChat room name.

Set this value if you set notifications.[n].typeName to HIP_CHAT.

notifications.[n]
.serviceKey
string
Conditional

PagerDuty service key.

If the key later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the key.

Set this value if you set notifications.[n].typeName to PAGER_DUTY.

notifications.[n]
.smsEnabled
boolean
Conditional

Flag indicating if text message notifications should be sent to this user's mobile phone.

Set this value if you set notifications.[n].typeName to ORG, GROUP, or USER.

notifications.[n]
.teamId
string
Conditional

Unique identifier of a team.

Set this value if you set notifications.[n].typeName to TEAM.

notifications.[n]
.typeName
string
Required

Means by which you want Atlas to send you notification of an alert. Atlas accepts the following values:

  • EMAIL
  • SMS
  • PAGER_DUTY
  • SLACK
  • FLOWDOCK
  • DATADOG
  • OPS_GENIE
  • VICTOR_OPS
  • WEBHOOK
  • USER
  • TEAM
  • GROUP (Project)
  • ORG
  • MICROSOFT_TEAMS
notifications.[n]
.username
string
Conditional

Name of the Atlas user to which to send notifications. This user must belong in the project that owns the alert configuration.

Set this value if you set notifications.[n].typeName to USER.

notifications.[n]
.victorOpsApiKey
string
Conditional

VictorOps API key.

If the key later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the key.

Set this value if you set notifications.[n].typeName to VICTOR_OPS.

notifications.[n]
.victorOpsRoutingKey
string
Conditional

VictorOps routing key.

If the key later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the key.

Set this value if you set notifications.[n].typeName to VICTOR_OPS.

notifications.[n]
.microsoftTeamsWebhookUrl
string
Conditional

Microsoft Teams channel incoming webhook URL.

Set this value if you set notifications.[n].typeName to MICROSOFT_TEAMS.

The response includes the alert configuration details:

Note

Alert configurations vary. An alert configuration may only include a subset of these elements.

Name
Type
Description
created
string
Timestamp in ISO 8601 date and time format in UTC when this alert configuration was created.
enabled
boolean
Flag indicating this alert configuration enabled.
eventTypeName
string
Human-readable label that indicates the type of event.
groupId
string
Unique identifier of the Project that owns this alert configuration.
id
string
Unique identifier of the alert configuration.
links
array of objects

One or more uniform resource locators that link to sub-resources and/or related resources. The Web Linking Specification explains the relation-types between URLs.

matchers
array of objects
Rules to apply when matching an object against this alert configuration.
matchers
.[n].fieldName
string
Name of the field in the target object that you wanted this configuration to match.
matchers
.[n].operator
string
Comparison operator to apply when checking the current metric value against matcher.[n].value.
matchers
.[n].value
string
Value to match or exceed using matchers.[n].operator.
metricThreshold
object
Value and means of comparison that triggers an alert.
metricThreshold
.metricName
string

Name of the metric to check. Supports the same values as the metricName field of the alerts resource.

To learn more about the available metrics, see Host Metrics.

Note

If you set eventTypeName to OUTSIDE_SERVERLESS_METRIC_THRESHOLD, you can specify only metrics available for serverless. To learn more, see Serverless Measurements.

metricThreshold
.mode
string
Average value of this metric.
metricThreshold
.operator
string
Comparison operator that Atlas applied when checking the current metric value against the threshold value.
metricThreshold
.threshold
number
Value of metricThreshold.metricName that, when exceeded, triggers an alert.
metricThreshold
.units
string
Units of capacity or time that define the scope of the metricThreshold.threshold.
notifications
array of objects
One or more targets for Atlas to send notifications when an alert condition is detected.
notifications.[n]
.apiToken
string
Slack API token token. Atlas returns this value if you set notifications.[n].typeName to SLACK.
notifications.[n]
.channelName
string
Slack channel name. Atlas returns this value if you set notifications.[n].typeName to SLACK.
notifications.[n]
.datadogApiKey
string
DataDog API Key. Atlas returns this value if you set notifications.[n].typeName to DATADOG.
notifications.[n]
.datadogRegion
string
Region that indicates which API URL to use.
notifications.[n]
.delayMin
number
Number of minutes to wait after an alert condition is detected before sending out the first notification.
notifications.[n]
.emailAddress
string
Email address to which to send notification. Atlas returns this value if you set notifications.[n].typeName to EMAIL.
notifications.[n]
.emailEnabled
boolean
Flag indicating email notifications must be sent. Atlas returns this value if you set notifications.[n].typeName to ORG, GROUP, or USER.
notifications.[n]
.flowdockApiToken
string
Flowdock personal API token. Atlas returns this value if you set notifications.[n].typeName to FLOWDOCK.
notifications.[n]
.flowName
string
Name of the Flowdock flow. Atlas returns this value if you set notifications.[n].typeName to FLOWDOCK.
notifications.[n]
.intervalMin
number

Number of minutes to wait between successive notifications for unacknowledged alerts that are not resolved.

Note

PagerDuty, VictorOps, and OpsGenie notifications don't return this element. You must configure and manage the notification interval within each external service.

notifications.[n]
.mobileNumber
string
Mobile number to which alert notifications are sent. Atlas returns this value if you set notifications.[n].typeName to SMS.
notifications.[n]
.microsoftTeamsWebhookUrl
string
Microsoft Teams incoming webhook URL. Atlas returns this value if you set notifications.[n].typeName to MICROSOFT_TEAMS.
notifications.[n]
.notificationToken
string

HipChat API token. Atlas returns this value if you set notifications.[n].typeName to HIP_CHAT.

If the token later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the token.

notifications.[n]
.opsGenieApiKey
string
Opsgenie API Key. Atlas returns this value if you set notifications.[n].typeName to OPS_GENIE.
notifications.[n]
.opsGenieRegion
string
Region that indicates which API URL to use. Atlas returns this value if you set notifications.[n].typeName to OPS_GENIE.
notifications.[n]
.orgName
string
Name of the Flowdock organization. Atlas returns this value if you set notifications.[n].typeName to FLOWDOCK.
notifications.[n]
.roles
array of strings
Atlas role in current Project or Organization. Atlas returns this value if you set notifications.[n].typeName to ORG or GROUP.
notifications.[n]
.roomName
string
HipChat room name. Atlas returns this value if "notifications.typeName" : "HIP_CHAT.
notifications.[n]
.serviceKey
string
PagerDuty service key. Atlas returns this value if you set notifications.[n].typeName to PAGER_DUTY.
notifications.[n]
.smsEnabled
boolean
Flag indicating text notifications must be sent. Atlas returns this value if you set notifications.[n].typeName to ORG, GROUP, or USER.
notifications.[n]
.teamId
string
Unique identifier of the team that receives this notification.
notifications.[n]
.teamName
string
Label for the team that receives this notification.
notifications.[n]
.typeName
string
Means by which you want Atlas to send you notification of an alert.
notifications.[n]
.username
string
Name of an Atlas user to which to send notifications. Atlas returns this value if you set notifications.[n].typeName to USER.
notifications.[n]
.victorOpsApiKey
string

VictorOps API key.

If the key later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the key.

Atlas returns this value if you set notifications.[n].typeName to VICTOR_OPS.

notifications.[n]
.victorOpsRoutingKey
string

VictorOps routing key.

If the key later becomes invalid, Atlas sends an email to the Project Owner and eventually removes the key.

Atlas returns this value if you set notifications.[n].typeName to VICTOR_OPS.

threshold
object
Threshold that triggers an alert. Atlas returns this value if eventTypeName is any value other than OUTSIDE_METRIC_THRESHOLD.
threshold
.operator
string
Comparison operator that Atlas applied when checking the current metric value against the threshold value.
threshold
.threshold
number
Value that, when exceeded, Atlas triggers an alert.
threshold
.units
string
Units of capacity or time that define the scope of the threshold.threshold.
typeName
string
This field is deprecated and is ignored.
updated
string
Timestamp in ISO 8601 date and time format in UTC when this alert configuration was last updated.
Metric Name
Description
SERVERLESS_CONNECTIONS
Number of active connections to the serverless instance meets the specified average.
SERVERLESS_CONNECTIONS_PERCENT
Number of open connections to the serverless instance exceeds the specified percentage threshold.
SERVERLESS_DATA_SIZE_TOTAL
Approximate size of all documents (and their paddings) meets the specified threshold.
SERVERLESS_NETWORK_BYTES_IN
Number of bytes sent to MongoDB meets the specified threshold.
SERVERLESS_NETWORK_BYTES_OUT
Number of bytes sent from MongoDB meets the specified threshold.
SERVERLESS_NETWORK_NUM_REQUESTS
Number of requests sent to MongoDB meets the specified average.
SERVERLESS_OPCOUNTER_CMD
Rate of commands performed meets the specified threshold.
SERVERLESS_OPCOUNTER_DELETE
Rate of deletes meets the specified threshold.
SERVERLESS_OPCOUNTER_GETMORE
Rate of getmore operations to retrieve the next cursor batch meets the specified threshold.
SERVERLESS_OPCOUNTER_INSERT
Rate of inserts meets the specified threshold.
SERVERLESS_OPCOUNTER_QUERY
Rate of queries meets the specified threshold.
SERVERLESS_OPCOUNTER_UPDATE
Rate of updates meets the specified threshold.
SERVERLESS_TOTAL_READ_UNITS
Total read units meet the specified threshold.
←  Get an Alert ConfigurationEnable/Disable Alert Configuration →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.