- API >
- Public API Resources >
- Metrics
Metrics¶
On this page
Endpoints¶
Get All Available Metrics¶
Get a list of all available metrics for the host. Each entity in the
list will be a partial metric entity. No data is
returned, but each entity contains a self
link which you may follow
to retrieve the full metric entity.
Get a Host Metric¶
Get the data points for the specified host and metric. If no additional query parameters are given, then the minute-level data for the past hour is returned.
The METRIC-NAME
may be any of the supported values listed for
the metricName
field, above. Note that if the provided metric is a
database-level metric (ie, DB_LOCK_PERCENTAGE
) or a hardware metric
for a specific device (ie, its name begins with MUNIN_IOSTAT
), then the
response entity will contain a list of links to all available database (or
hardware device) metrics. You may also provide additional query parameters:
granularity
: The size of the epoch. Acceptable values are:MINUTE
,HOUR
, andDAY
. The default isMINUTE
.period
- The ISO-8601 formatted time period that specifies how far back in the past to query. For example, to request the last 36 hours of hour-level data, you must specify:granularity=HOUR&period=P1DT12H
.
Get a Database Metric¶
Get the data points for the specified host, database metric, and
database name. The only available database-level metric is
DB_LOCK_PERCENTAGE
.
You may also provide additional query parameters:
granularity
- The size of the epoch. Acceptable values are:MINUTE
,HOUR
, andDAY
. The default isMINUTE
.period
- The ISO-8601 formatted time period that specifies how far back in the past to query. For example, to request the last 36 hours of hour-level data, you must specify:granularity=HOUR&period=P1DT12H
.
Get a Hardware Metric¶
Get the data points for the specified host, hardware metric, and device name.
The device-specific hardware metrics include the supported values for the
metricName
field that begin with MUNIN_IOSTAT_
.
You may also provide additional query parameters:
granularity
- The size of the epoch. Acceptable values are:MINUTE
,HOUR
, andDAY
. The default isMINUTE
.period
- The ISO-8601 formatted time period that specifies how far back in the past to query. For example, to request the last 36 hours of hour-level data, you must specify:granularity=HOUR&period=P1DT12H
.
Sample Entity¶
Entity Fields¶
Name | Type | Description |
---|---|---|
hostId |
string | ID of the host to which this metric pertains. |
groupId |
string | ID of the group that owns this host. |
metricName |
string | The name of the metric. Possible values are:
|
units |
string | The units in which the metric values are expressed. Possible values are:
|
granularity |
string | The size of the epoch covered by each data point. Possible values are:
|
deviceName |
string | The name of the device. Only present for hardware (ie, Munin) metrics. |
databaseName |
string | The name of the database. Only present for database-level metrics. |
dataPoints |
object array | An array of objects, where each object represents a single metric data point. When there is no data point available for a particular epoch, then it will simply be missing from the array. For example, if you request minute-level data points for 1:30PM through 2:00PM, but Ops Manager does not have a 1:31PM sample, then: dataPoints[0].timestamp = ‘…T13:30:00Z’; dataPoints[1].timestamp = ‘…T13:32:00Z’; dataPoints[2].timestamp = ‘…T13:33:00Z’; etc. |
dataPoints.$.timestamp |
date | The timestamp of the beginning of the epoch represented by this data point. |
dataPoints.$.value |
number | The value of the data point. |
Links¶
Relation | Description |
---|---|
self |
Me |
http://mms.mongodb.com/group |
The group that the host belongs to. |
http://mms.mongodb.com/host |
The host to which the metric pertains. |