Navigation

Get Measurements of a Disk for a MongoDB Process

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.

Retrieve measurements of a disk or partition for a specific MongoDB process. An Atlas MongoDB process can be either a mongod or mongos.

The Atlas API authenticates using HTTP Digest Authentication. Provide a programmatic API public key and corresponding private key as the username and password when constructing the HTTP request.

To learn how to configure API access for an Atlas project, see Configure Atlas API Access.

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

GET /groups/{GROUP-ID}/processes/{HOST}:{PORT}/disks/{DISK-NAME}/measurements
Parameter
Type
Necessity
Description
GROUP-ID
string
Required
Unique 24-hexadecimal digit string that identifies the project that owns this Atlas MongoDB process.
HOST
string
Required
Hostname, FQDN, IPv4 address, or IPv6 address of the machine running the Atlas MongoDB process.
PORT
number
Required
IANA port to which the Atlas MongoDB process listens.
DISK-NAME
string
Required
Label that identifies the disk or partition from which you want to retrieve measurements.
Name
Type
Necessity
Description
Default
pageNum
integer
Optional
Page number, starting with one, that Atlas returns of the total number of objects.
1
itemsPerPage
integer
Optional
Number of items that Atlas returns per page, up to a maximum of 500.
100
includeCount
boolean
Optional
Flag that indicates whether Atlas returns the totalCount parameter in the response body.
true
pretty
boolean
Optional
Flag that indicates whether Atlas returns the JSON response in the prettyprint format.
false
envelope
boolean
Optional

Flag that indicates whether Atlas wraps the response in an envelope.

Some API clients cannot access the HTTP response headers or status code. To remediate this, set envelope=true in the query.

Endpoints that return a list of results use the results object as an envelope. Atlas adds the status parameter to the response body.

false
granularity
string
Required

Duration in ISO 8601 notation that specifies the interval between measurement data points.

Example

PT1M specifies 1-minute granularity.

Atlas supports the following subset of ISO 8601-formatted time periods:

  • PT1M
  • PT5M
  • PT1H
  • P1D

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

period
string
Required

Duration in ISO 8601 notation that specifies the length of time in the past to query. Mutually exclusive with start and end.

Example

To request the last 36 hours, specify: period=P1DT12H.

start
string
Required
Timestamp in ISO 8601 date and time format in UTC when to start retrieving measurements. If you specify start you must also specify end. Mutually exclusive with period.
end
string
Required

Timestamp in ISO 8601 date and time format in UTC when to stop retrieving measurements.

If you specify end you must also specify start. Mutually exclusive with period.

m
string
Optional

Type of measurements this endpoint return. If you don't set m, the endpoint returns all measurements.

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

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.

The Measurement Values section details these metrics.

This endpoint doesn't use HTTP request body parameters.

Important
Limited Metrics for Free/Shared Tier Clusters

M0/M2/M5 clusters return a subset of the metrics documented.

If you set the query parameter to envelope=true, the resource wraps the response in a content object.

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

Name
Type
Description
end
string

Timestamp in ISO 8601 date and time format in UTC when to stop retrieving measurements.

If you specify end you must also specify start. Mutually exclusive with period.

granularity
string

Duration in ISO 8601 notation that specifies the interval between measurement data points.

Example

PT1M specifies 1-minute granularity.

Atlas supports the following subset of ISO 8601-formatted time periods:

  • PT1M
  • PT5M
  • PT1H
  • P1D

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

groupId
string
Unique 24-hexadecimal digit string that identifies the project that owns the Atlas MongoDB process.
hostId
string
Hostname and port of the host running the Atlas MongoDB process.
links
array

One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification

measurements
array
List of measurements recorded and their data points.
measurements
.dataPoints
array
Value of and metadata provided for one data point. If Atlas has no data point for a particular moment in time, the value field is set to null.
measurements
.dataPoints
.timestamp
string
Timestamp in ISO 8601 date and time format in UTC when this time interval that this data point represents began.
measurements
.dataPoints
.value
number
Value this data point provides.
measurements
.name
string

Name of the measurement that this data point covers.

The Measurement Values section details these metrics.

measurements
.units
string

Magnitude by which Atlas quanitifies the measurement. Atlas uses units of throughput, storage, and time that include:

  • PERCENT
  • MILLISECONDS
  • BYTES
  • GIGABYTES
  • BYTES_PER_SECOND
  • MEGABYTES_PER_SECOND
  • GIGABYTES_PER_HOUR
  • SCALAR_PER_SECOND
  • SCALAR
processId
string
Hostname and port of the machine running the Atlas MongoDB process.
start
string
Timestamp in ISO 8601 date and time format in UTC when to start retrieving measurements. If you specify start you must also specify end. Mutually exclusive with period.
partitionName
string
Name of the disk or partition to which the measurements apply.
DISK_PARTITION_IOPS_READ
DISK_PARTITION_IOPS_WRITE
DISK_PARTITION_IOPS_TOTAL
Measures throughput of I/O operations for the disk partition used for MongoDB.
DISK_PARTITION_UTILIZATION
The percentage of time during which requests are being issued to and serviced by the partition. This includes requests from any process, not just MongoDB processes.
DISK_PARTITION_LATENCY_READ
DISK_PARTITION_LATENCY_WRITE
Measures latency per operation type of the disk partition used by MongoDB.
DISK_PARTITION_SPACE_FREE
DISK_PARTITION_SPACE_USED
DISK_PARTITION_SPACE_PERCENT_FREE
DISK_PARTITION_SPACE_PERCENT_USED
Measures the free disk space and used disk space on the disk partition used by MongoDB.

Replace the information in brackets {} with your own Atlas information to execute this example request:

curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \
--header "Content-Type: application/json" \
--include \
--request GET "https://cloud.mongodb.com/api/atlas/v1.0/groups/{GROUP-ID}/disks/{DISK-NAME}/measurements?granularity=PT1M&period=PT1M&pretty=true"
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
1{
2 "end":"2021-04-09T18:07:45Z",
3 "granularity":"PT1M",
4 "groupId":"48c769055fd770eb6e6b18d0",
5 "hostId":"shard-00-00.mongodb.net:27017",
6 "links":[],
7 "measurements":[
8 {
9 "dataPoints":[
10 {
11 "timestamp":"2021-04-09T18:07:45Z",
12 "value":0.0
13 }
14 ],
15 "name": "DISK_PARTITION_IOPS_READ",
16 "units":"SCALAR_PER_SECOND"
17 }
18 ],
19 "partitionName":"xvdb",
20 "processId":"shard-00-00.mongodb.net:27017",
21 "start":"2021-04-09T18:07:45Z"
22}
Give Feedback