Navigation

Get an Alert

Base URL: https://cloud.mongodb.com/

Syntax

GET /api/public/v1.0/groups/{GROUP-ID}/alerts/{ALERT-ID}

Request Path Parameters

Parameter Required/Optional Description
GROUP-ID Required Group identifier.
ALERT-ID Required Alert identifier.

Request Query Parameters

Field Required/Optional Description
pageNum Optional. The page to return.
itemsPerPage Optional. Maximum number of items to return per page. Default is 100.
envelope Optional. A boolean that specifies whether or not to wrap the response in an envelope.

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response Elements

The fields in the return document depend on the alert type:

Name Type Description
id string Unique identifier.
groupId string ID of the group that this alert was opened for.
alertConfigId string ID of the alert configuration that triggered this alert.
eventTypeName string

The name of the event that triggered the alert.

  • Host alerts support these values:
    • HOST_DOWN
    • HOST_RECOVERING
    • VERSION_BEHIND
    • HOST_EXPOSED
    • OUTSIDE_METRIC_THRESHOLD
  • Agent alerts support these values:
    • MONITORING_AGENT_DOWN
    • MONITORING_AGENT_VERSION_BEHIND
    • BACKUP_AGENT_DOWN
    • BACKUP_AGENT_VERSION_BEHIND
    • BACKUP_AGENT_CONF_CALL_FAILURE
  • Backup alerts support these values:
    • OPLOG_BEHIND
    • CLUSTER_MONGOS_IS_MISSING
    • RESYNC_REQUIRED
    • BAD_CLUSTERSHOTS
  • Group alerts support these values:
    • USERS_AWAITING_APPROVAL
    • USERS_WITHOUT_MULTI_FACTOR_AUTH
  • Replica set alerts support these values:
    • CONFIGURATION_CHANGED
    • PRIMARY_ELECTED
    • TOO_FEW_HEALTHY_MEMBERS
    • TOO_MANY_UNHEALTHY_MEMBERS
    • NO_PRIMARY
  • Sharded cluster alerts support this value:
    • CLUSTER_MONGOS_IS_MISSING
  • User alerts support these values:
    • JOINED_GROUP
    • REMOVED_FROM_GROUP
typeName string This field is deprecated and will be ignored.
status string

The current state of the alert. Possible values are:

  • TRACKING

    The alert condition exists but has not persisted beyond the defined notification delay. For details, see Request Query Parameters.

  • OPEN

  • CLOSED

  • CANCELLED

acknowledgedUntil date The date through which the alert has been acknowledged. Will not be present if the alert has never been acknowledged.
acknowledgementComment string The comment left by the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
acknowledgingUsername string The username of the user who acknowledged the alert. Will not be present if the alert has never been acknowledged.
created date When the alert was opened.
updated date When the alert was last updated.
resolved date When the alert was closed. Only present if the status is CLOSED.
lastNotified date When the last notification was sent for this alert. Only present if notifications have been sent.
hostnameAndPort string The hostname and port of each host to which the alert applies. Only present for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
hostId string ID of the host to which the metric pertains. Only present for alerts of type HOST, HOST_METRIC, and REPLICA_SET.
replicaSetName string Name of the replica set. Only present for alerts of type HOST, HOST_METRIC, BACKUP, and REPLICA_SET.
metricName string

The name of the measurement whose value went outside the threshold. Only present if eventTypeName is set to OUTSIDE_METRIC_THRESHOLD.

For possible values, see below.

currentValue object The current value of the metric that triggered the alert. Only present for alerts of type HOST_METRIC.
currentValue.number number The value of the metric.
currentValue.units string

The units for the value. Depends on the type of metric. For example, a metric that measures memory consumption would have a byte measurement, while a metric that measures time would have a time unit. Possible values are:

  • RAW
  • BITS
  • BYTES
  • KILOBITS
  • KILOBYTES
  • MEGABITS
  • MEGABYTES
  • GIGABITS
  • GIGABYTES
  • TERABYTES
  • PETABYTES
  • MILLISECONDS
  • SECONDS
  • MINUTES
  • HOURS
  • DAYS
clusterId string The ID of the cluster to which this alert applies. Only present for alerts of type BACKUP, REPLICA_SET, and CLUSTER.
clusterName string The name the cluster to which this alert applies. Only present for alerts of type BACKUP, REPLICA_SET, and CLUSTER.
sourceTypeName string

For alerts of the type BACKUP, the type of server being backed up. Possible values are:

  • REPLICA_SET
  • SHARDED_CLUSTER
  • CONFIG_SERVER

Measurement Types for Alerts

The alerts resource returns measurement types in the metricName field. The field is present only if eventTypeName is set to OUTSIDE_METRIC_THRESHOLD.

Host Measurements

  • ASSERT_REGULAR
  • ASSERT_WARNING
  • ASSERT_MSG
  • ASSERT_USER
Measure the rate of asserts for a MongoDB process, as collected from the MongoDB serverStatus command’s asserts document.
  • BACKGROUND_FLUSH_AVG
Measurement found on the host’s background flush avg chart. To view the chart, see View Metrics.
  • CACHE_BYTES_READ_INTO
  • CACHE_BYTES_WRITTEN_FROM
  • CACHE_USAGE_DIRTY
  • CACHE_USAGE_USED
  • TICKETS_AVAILABLE_READS
  • TICKETS_AVAILABLE_WRITES
Apply to a MongoDB process’s WiredTiger storage engine, as collected from the MongoDB serverStatus command’s wiredTiger.cache and wiredTiger.concurrentTransactions documents.
  • CONNECTIONS
Measures connections to a MongoDB process, as collected from the MongoDB serverStatus command’s connections document.
  • CURSORS_TOTAL_OPEN
  • CURSORS_TOTAL_TIMED_OUT
Measure the number of cursors for a MongoDB process, as collected from the MongoDB serverStatus command’s metrics.cursor document.
  • EXTRA_INFO_PAGE_FAULTS
  • GLOBAL_ACCESSES_NOT_IN_MEMORY
  • GLOBAL_PAGE_FAULT_EXCEPTIONS_THROWN
Measurements found on the host’s Record Stats and Page Faults charts. To view the charts, see View Metrics.
  • GLOBAL_LOCK_CURRENT_QUEUE_TOTAL
  • GLOBAL_LOCK_CURRENT_QUEUE_READERS
  • GLOBAL_LOCK_CURRENT_QUEUE_WRITERS
Measure operations waiting on locks, as collected from the MongoDB serverStatus command. Cloud Manager computes these values based on the type of storage engine.
  • GLOBAL_LOCK_PERCENTAGE
Applicable only to hosts running MongoDB 2.0 and earlier. Measures operations waiting on the global lock, as collected from the MongoDB serverStatus command.
  • INDEX_COUNTERS_BTREE_ACCESSES
  • INDEX_COUNTERS_BTREE_HITS
  • INDEX_COUNTERS_BTREE_MISSES
  • INDEX_COUNTERS_BTREE_MISS_RATIO
Measurements found on the host’s btree chart. To view the chart, see View Metrics.
  • JOURNALING_COMMITS_IN_WRITE_LOCK
  • JOURNALING_MB
  • JOURNALING_WRITE_DATA_FILES_MB
Measurements found on the host’s journal - commits in write lock chart and journal stats chart. To view the charts, see View Metrics.
  • MEMORY_RESIDENT
  • MEMORY_VIRTUAL
  • MEMORY_MAPPED
  • COMPUTED_MEMORY
Measure memory for a MongoDB process, as collected from the MongoDB serverStatus command’s mem document.
  • NETWORK_BYTES_IN
  • NETWORK_BYTES_OUT
  • NETWORK_NUM_REQUESTS
Measure throughput for MongoDB process, as collected from the MongoDB serverStatus command’s network document.
  • OPLOG_SLAVE_LAG_MASTER_TIME
  • OPLOG_MASTER_TIME
  • OPLOG_MASTER_LAG_TIME_DIFF
  • OPLOG_RATE_GB_PER_HOUR
Measurements that apply to the MongoDB process’s oplog.
  • DB_STORAGE_TOTAL
  • DB_DATA_SIZE_TOTAL
Measurements displayed on the host’s db storage chart. To view the chart, see View Metrics.
  • OPCOUNTER_CMD
  • OPCOUNTER_QUERY
  • OPCOUNTER_UPDATE
  • OPCOUNTER_DELETE
  • OPCOUNTER_GETMORE
  • OPCOUNTER_INSERT
Measure the rate of database operations on a MongoDB process since the process last started, as collected from the MongoDB serverStatus command’s opcounters document.
  • OPCOUNTER_REPL_CMD
  • OPCOUNTER_REPL_UPDATE
  • OPCOUNTER_REPL_DELETE
  • OPCOUNTER_REPL_INSERT
Measure the rate of database operations on MongoDB secondaries, as collected from the MongoDB serverStatus command’s opcountersRepl document.
  • DOCUMENT_RETURNED
  • DOCUMENT_INSERTED
  • DOCUMENT_UPDATED
  • DOCUMENT_DELETED
The average rate per second of documents returned, inserted, updated, or deleted for a selected time period. These measurements are found on the host’s Document Metrics chart. To view the chart, see View Metrics.
  • OPERATIONS_SCAN_AND_ORDER
For a selected time period, the average rate per second for operations that perform a sort but cannot perform the sort using an index. This measurement is found on the host’s Scan and Order chart. To view the chart, see View Metrics.
  • AVG_READ_EXECUTION_TIME
  • AVG_WRITE_EXECUTION_TIME
  • AVG_COMMAND_EXECUTION_TIME
Available to hosts running MongoDB v3.4+. The average execution time in milliseconds per read, write, or command operation over the selected time period. These measurements are found on the host’s Operation Execution Times chart. To view the chart, see View Metrics.
  • QUERY_EXECUTOR_SCANNED
The average rate per second to scan index items during queries and query-plan evaluations. This rate is driven by the same value as totalKeysExamined in the output of explain. This measurement is found on the host’s Query Executor chart, accessed when viewing metrics.
  • QUERY_EXECUTOR_SCANNED_OBJECTS
The average rate per second to scan documents during queries and query-plan evaluations. Cloud Manager derives the rate using the explain output’s totalDocsExamined value. This measurement is found on the host’s Query Executor chart, accessed when viewing metrics.
  • QUERY_TARGETING_SCANNED_PER_RETURNED
The ratio of the number of index items scanned to the number of documents returned. This measurement is found on the host’s Query Targeting chart, accessed when viewing metrics.
  • QUERY_TARGETING_SCANNED_OBJECTS_PER_RETURNED
The ratio of the number of documents scanned to the number of documents returned. This measurement is found on the host’s Query Targeting chart, accessed when viewing metrics.

Example Request

curl  -X GET -u "username:apiKey" --digest "https://cloud.mongodb.com/api/public/v1.0/groups/5196d3628d022db4cbc26d9e/alerts/533cb4b8e4b0f1820cdabc7f"

Example Response

{
  "id" : "533cb4b8e4b0f1820cdabc7f",
  "groupId" : "5196d3628d022db4cbc26d9e",
  "eventTypeName" : "OPLOG_BEHIND",
  "status" : "CLOSED",
  "created" : "2014-04-03T01:09:12Z",
  "updated" : "2014-04-03T01:14:12Z",
  "resolved" : "2014-04-03T01:14:12Z",
  "links" : [ ... ]
}