Docs Menu
Docs Home
/ /
MongoDB Command Line Interface
/ / /

mongocli ops-manager metrics process

On this page

  • Syntax
  • Options
  • Example

The metrics process command lists metrics for MongoDB processes running on a specified Ops Manager host. A MongoDB process can be either a mongod or mongos.

You can get the hostnames associated with a particular Ops Manager project with the process list command.

mongocli ops-manager|om metrics process <hostID>
--granularity <granularity> --period <period>
--start <start> --end <end>
[--type <type>]
[ --output|-o <output-format> ]
[ --profile|-P <profile-name> ]
[ --projectId <project-ID> ]

Note

Use -h or --help to view the command-line help for this command.

Option
Type
Description
Required?
<hostID>
String
The host ID of the server running the Atlas MongoDB process for which to retrieve metrics. You can obtain the host ID string with the process list command.
yes
granularity
String

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

The following subset of ISO-8601-formatted time periods are supported:

  • PT1M

  • PT5M

  • PT1H

  • P1D

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

yes
--output, -o
string

Command output format. Valid values are:

  • json for output in JSON format

  • go-template for custom output using the Go template

  • go-template-file for custom output specified using Go template file

If omitted, the command returns output in the default format.

no
period
String
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.
yes
start
String
The time at which to start retrieving metrics, as specified by an ISO-8601 timestamp string. If you specify start you must also specify end. Mutually exclusive with period.
yes
end
String
The time at which to stop retrieving metrics, as specified by an ISO-8601 timestamp string. If you specify end you must also specify start. Mutually exclusive with period.
yes
type
String

Specifies which metric to return. If type is not specified, all metrics are returned.

You must specify metrics that are valid for the host. Atlas returns an error if any specified metrics are invalid.

The following metric values are valid:

  • 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.
no

The command prints the following fields in the specified format to the terminal if the command succeeds. If the command prints an error, see Troubleshooting for recommended solutions.

Important

Free Tier

M0 Free Tier and M2/M5 shared-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 metrics, 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 project that owns the Atlas MongoDB process.
hostId
string
The hostname of the machine running the Atlas MongoDB process.
links
document array
One or more links to sub-resources and/or related resources. The relations between URLs are explained in the Web Linking Specification.
measurements
object array
An array of metrics 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 metric.
measurements.units
string

Units of measurement. Possible units are:

  • PERCENT

  • MILLISECONDS

  • BYTES

  • GIGABYTES

  • BYTES_PER_SECOND

  • MEGABYTES_PER_SECOND

  • GIGABYTES_PER_HOUR

  • SCALAR_PER_SECOND

  • SCALAR

partitionName
string
Name of the disk or partition to which the metrics pertain.
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 metrics, specified as an ISO-8601 timestamp.

The following example uses the mongocli ops-manager metrics process command to retrieve the CONNECTIONS process measurement for a host with ID myOmHost.example.com, listening on port 27017. The granularity is set to one minute, with a period of one minute. The command uses the default profile where the project ID and the Programmatic API Keys are stored.

mongocli ops-manager metrics process \
myOmHost.example.com:27017 \
--granularity PT1M --period PT1M --type CONNECTIONS --output json

The previous command produces the following output.

{
"end": "2020-04-22T17:27:27Z",
"granularity": "PT1M",
"groupId": "5dd5a6b6f10fab1d71a58495",
"hostId": "myOmHost.example.com:27017",
"links": [
{
"rel": "self",
"href": "https://myOmHost.example.com/api/public/v1.0/groups/5dd5a6b6f10fab1d71a58495/processes/myOmHost.example.com:27017/measurements?granularity=PT1M\u0026m=CONNECTIONS\u0026period=PT1M"
},
{
"rel": "http://mms.mongodb.com/host",
"href": "https://myOmHost.example.com/api/public/v1.0/groups/5dd5a6b6f10fab1d71a58495/processes/myOmHost.example.com:27017"
}
],
"measurements": [
{
"dataPoints": [
{
"timestamp": "2020-04-22T17:27:27Z",
"value": 7
}
],
"name": "CONNECTIONS",
"units": "SCALAR"
}
],
"processId": "myOmHost.example.com:27017",
"start": "2020-04-22T17:27:27Z"
}

Back

Metrics