Navigation

Get Measurements for a MongoDB Process

Get measurements for a specific Atlas MongoDB process. A Atlas MongoDB process can be either a mongod or mongos.

The Atlas API uses HTTP Digest Authentication. Provide your Atlas username and group API key as the username and password when constructing the HTTP request.

For complete documentation on configuring API access for an Atlas group, see Configure Atlas API Access.

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

Resource

GET api/atlas/v1.0/groups/{GROUP-ID}/processes/{HOST}:{PORT}/measurements

Request Path Parameters

Parameter Required/Optional Description
GROUP-ID Required ID of the group that owns this Atlas MongoDB process.
HOST Required The hostname of the machine running the Atlas MongoDB process.
PORT Required The port to which the Atlas MongoDB process listens.

Request Query Parameters

Field Required/Optional Description
granularity Required

An ISO-8601-formatted time period that specifies the interval between measurement data points. For example, PT1M specifies 1-minute granularity.

The supported values for this parameter are:

  • PT1M
  • PT5M
  • PT1H
  • P1D

When you specify granularity, you must specify either period or start and end.

period Required An ISO-8601-formatted time period that specifies the length of time in the past to query. For example, to request the last 36 hours, specify: period=P1DT12H. Mutually exclusive with start and end.
start Required The time at which to start retrieving measurements, as specified by an ISO-8601 timestamp string. If you specify start you must also specify end. Mutually exclusive with period.
end Required The time at which to stop retrieving measurements, as specified by an ISO-8601 timestamp string. If you specify end you must also specify start. Mutually exclusive with period.
m Optional

Specifies which measurements to return. If m is not specified, all measurements are returned.

To specify multiple values for m, you must repeat the m parameter. For example:

../measurements?m=<measurement>&m=<measurement>&m=...

You must specify measurements that are valid for the host. Atlas returns an error if any specified measurements are invalid For available measurements, see Measurement Values.

pageNum Optional.

The page to return.

Defaults to 1.

itemsPerPage Optional.

Maximum number of items to return per page.

Defaults to 100.

envelope Optional.

A boolean that specifies whether or not to wrap the response in an envelope.

Defaults to false.

pretty Optional

A boolean that specifies whether or not to return a “pretty-printed” JSON document.

Defaults to false.

Request Body Parameters

This endpoint does not use HTTP request body parameters.

Response Elements

Free Tier

M0 Free Tier clusters return a subset of the metrics documented here.

If you set the query element envelope to true, the response is wrapped by the content object.

The HTTP response returns a JSON document that includes the following objects:

Name Type Description
end string The end of the period for which to retrieve measurements, specified as an ISO-8601 timestamp.
granularity string An ISO-8601-formatted time period that specifies the size of the interval covered by each data point. For example, PT5M specifies a 5-minute granularity.
groupId string ID of the group that owns the Atlas MongoDB process.
hostId string The hostname of the machine running the Atlas MongoDB process.
links array An array of documents, representing a link to one or more sub-resources and/or related resources such as list pagination. See Linking for more information.
measurements object array An array of measurements and their data points.
measurements.dataPoints object array An array of objects, where each object represents a single data point. If there is no data point available for a particular moment in time (i.e., a timestamp), the value field is set to null.
measurements.dataPoints.timestamp string The timestamp of the beginning of the time interval represented by this data point.
measurements.dataPoints.value float The value of the data point.
measurements.name string The name of the measurement. For possible values, see Measurement Values below on this page.
measurements.units string

How the measurement is quantified. Possible units are:

  • PERCENT
  • MILLISECONDS
  • BYTES
  • GIGABYTES
  • BYTES_PER_SECOND
  • MEGABYTES_PER_SECOND
  • GIGABYTES_PER_HOUR
  • SCALAR_PER_SECOND
  • SCALAR
processId string The hostname and port of the machine running the Atlas MongoDB process.
start string The start of the period for which to retrieve measurements, specified as an ISO-8601 timestamp.

Measurement Values

  • ASSERT_REGULAR
  • ASSERT_WARNING
  • ASSERT_MSG
  • ASSERT_USER
Measures the rate of asserts for a MongoDB process, as collected from the MongoDB serverStatus command’s asserts document.
  • CACHE_BYTES_READ_INTO
  • CACHE_BYTES_WRITTEN_FROM
  • CACHE_USAGE_DIRTY
  • CACHE_USAGE_USED
Applies 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
Measures the number of cursors for a MongoDB process, as collected from the MongoDB serverStatus command’s metrics.cursor document.
  • DB_STORAGE_TOTAL
  • DB_DATA_SIZE_TOTAL
Measures the database’s on-disk storage space, as collected from the MongoDB dbStats command.
  • DOCUMENT_METRICS_RETURNED
  • DOCUMENT_METRICS_INSERTED
  • DOCUMENT_METRICS_UPDATED
  • DOCUMENT_METRICS_DELETED
The average rate per second of documents returned, inserted, updated, or deleted for a selected time period.
  • EXTRA_INFO_PAGE_FAULTS
Measurements on page faults related to the host.
  • GLOBAL_LOCK_CURRENT_QUEUE_TOTAL
  • GLOBAL_LOCK_CURRENT_QUEUE_READERS
  • GLOBAL_LOCK_CURRENT_QUEUE_WRITERS
Measures operations waiting on locks, as collected from the MongoDB serverStatus command.
  • MEMORY_RESIDENT
  • MEMORY_VIRTUAL
  • MEMORY_MAPPED
Measures memory for a MongoDB process, as collected from the MongoDB serverStatus command’s mem document.
  • NETWORK_BYTES_IN
  • NETWORK_BYTES_OUT
  • NETWORK_NUM_REQUESTS
Measures throughput for MongoDB process, as collected from the MongoDB serverStatus command’s network document.
  • OPCOUNTER_CMD
  • OPCOUNTER_QUERY
  • OPCOUNTER_UPDATE
  • OPCOUNTER_DELETE
  • OPCOUNTER_GETMORE
  • OPCOUNTER_INSERT
Measures 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
Measures the rate of database operations on MongoDB secondaries, as collected from the MongoDB serverStatus command’s opcountersRepl document.
  • 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.
  • OP_EXECUTION_TIME_READS
  • OP_EXECUTION_TIME_WRITES
  • OP_EXECUTION_TIME_COMMANDS
Available to hosts running MongoDB v3.4+. The execution time in milliseconds per read, write, or command operation over the selected time period.
  • OPLOG_MASTER_TIME
  • OPLOG_RATE_GB_PER_HOUR
Measurements that apply to the MongoDB process’s oplog.
  • 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.
  • TICKETS_AVAILABLE_READS
  • TICKETS_AVAILABLE_WRITES
Measurement of the WiredTiger storage engine wiredTiger.cache and wiredTiger.concurrentTransactions documents as collected from the MongoDB serverStatus command.
  • PROCESS_CPU_USER
  • PROCESS_CPU_KERNEL
  • PROCESS_CPU_CHILDREN_USER
  • PROCESS_CPU_CHILDREN_KERNEL
The CPU usage of MongoDB. For servers with more than 1 CPU core, these values can exceed 100%.
  • PROCESS_NORMALIZED_CPU_USER
  • PROCESS_NORMALIZED_CPU_KERNEL
  • PROCESS_NORMALIZED_CPU_CHILDREN_USER
  • PROCESS_NORMALIZED_CPU_CHILDREN_KERNEL
The CPU usage of MongoDB, scaled to a range of 0-100% by dividing by the number of CPU cores.
  • SYSTEM_CPU_USER
  • SYSTEM_CPU_KERNEL
  • SYSTEM_CPU_NICE
  • SYSTEM_CPU_IOWAIT
  • SYSTEM_CPU_IRQ
  • SYSTEM_CPU_SOFTIRQ
  • SYSTEM_CPU_GUEST
  • SYSTEM_CPU_STEAL
CPU usage of processes on the host server. For servers with more than 1 CPU core, this value can exceed 100%.
  • SYSTEM_NORMALIZED_CPU_USER
  • SYSTEM_NORMALIZED_CPU_KERNEL
  • SYSTEM_NORMALIZED_CPU_NICE
  • SYSTEM_NORMALIZED_CPU_IOWAIT
  • SYSTEM_NORMALIZED_CPU_IRQ
  • SYSTEM_NORMALIZED_CPU_SOFTIRQ
  • SYSTEM_NORMALIZED_CPU_GUEST
  • SYSTEM_NORMALIZED_CPU_STEAL
CPU usage of processes on the host server, scaled to a range of 0-100% by dividing by the number of CPU cores.

Example Request

The following example request sets a granularity and period of one minute. Replace the information in brackets {} with your own Atlas information to execute this example request:

curl -u "<ATLAS-USERNAME>:<API-KEY>" --digest -i "https://cloud.mongodb.com/api/atlas/v1.0/groups/{GROUP-ID}/processes/{HOST}:{PORT}}/measurements?granularity=PT1M&period=PT1M&pretty=true"

Example Response

HTTP/1.1 200 OK
Vary: Accept-Encoding
Cache-Control: no-cache, no-transform, must-revalidate, proxy-revalidate, max-age=0
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: Tue, 22 Aug 2017 20:31:22 GMT
Connection: keep-alive
Content-Length: 16848

{
  "end" : "2017-08-22T20:31:14Z",
  "granularity" : "PT1M",
  "groupId" : "12345678",
  "hostId" : "shard-00-00.mongodb.net:27017",
  "links" : [ {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/12345678/processes/shard-00-00.mongodb.net:27017/measurements?granularity=PT1M&period=PT1M&pretty=true",
    "rel" : "self"
  }, {
    "href" : "https://cloud.mongodb.com/api/atlas/v1.0/groups/12345678/processes/shard-00-00.mongodb.net:27017",
    "rel" : "http://mms.mongodb.com/host"
  } ],
  "measurements" : [ {
    "dataPoints" : [ {
      "timestamp" : "2017-08-22T20:31:12Z",
      "value" : null
    }, {
      "timestamp" : "2017-08-22T20:31:14Z",
      "value" : null
    } ],
    "name" : "ASSERT_REGULAR",
    "units" : "SCALAR_PER_SECOND"
  }, {
    ...
  }],
  "processId" : "shard-00-00.mongodb.net:27017",
  "start" : "2017-08-22T20:30:45Z"
}