2017-09-05 17:23:55 +00:00
|
|
|
---
|
2017-09-05 21:58:35 +00:00
|
|
|
layout: api
|
2017-09-05 17:23:55 +00:00
|
|
|
page_title: Metrics - HTTP API
|
2017-09-26 11:06:59 +00:00
|
|
|
sidebar_current: api-metrics
|
2017-09-05 17:23:55 +00:00
|
|
|
description: |-
|
|
|
|
The /metrics endpoint is used to view metrics for Nomad
|
|
|
|
---
|
|
|
|
|
|
|
|
# Metrics HTTP API
|
|
|
|
|
|
|
|
The `/metrics` endpoint returns metrics for the current Nomad process.
|
|
|
|
|
|
|
|
| Method | Path | Produces |
|
|
|
|
| ------- | --------------- | -------------------------- |
|
2018-02-20 15:00:56 +00:00
|
|
|
| `GET` | `/v1/metrics` | `application/json` |
|
2017-09-05 17:23:55 +00:00
|
|
|
|
|
|
|
The table below shows this endpoint's support for
|
|
|
|
[blocking queries](/api/index.html#blocking-queries) and
|
|
|
|
[required ACLs](/api/index.html#acls).
|
|
|
|
|
|
|
|
| Blocking Queries | ACL Required |
|
|
|
|
| ---------------- | ------------ |
|
|
|
|
| `NO` | `none` |
|
|
|
|
|
2017-09-11 13:54:26 +00:00
|
|
|
### Parameters
|
|
|
|
|
|
|
|
- `format` `(string: "")` - Specifies the metrics format to be other than the
|
2018-03-11 17:39:19 +00:00
|
|
|
JSON default. Currently, only `prometheus` is supported as an alternative
|
2017-09-11 13:54:26 +00:00
|
|
|
format. This is specified as a querystring parameter.
|
|
|
|
|
2017-09-05 17:23:55 +00:00
|
|
|
### Sample Request
|
|
|
|
|
|
|
|
```text
|
2018-01-29 16:27:52 +00:00
|
|
|
$ curl https://localhost:4646/v1/metrics
|
2017-09-05 17:23:55 +00:00
|
|
|
```
|
|
|
|
|
2017-09-11 13:54:26 +00:00
|
|
|
```text
|
2018-01-29 16:27:52 +00:00
|
|
|
$ curl https://localhost:4646/v1/metrics?format=prometheus
|
2017-09-11 13:54:26 +00:00
|
|
|
```
|
|
|
|
|
2017-09-05 17:23:55 +00:00
|
|
|
### Sample Response
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"Counters":[
|
|
|
|
{
|
2017-09-05 21:58:35 +00:00
|
|
|
"Count":11,
|
|
|
|
"Labels":{},
|
2017-09-05 17:23:55 +00:00
|
|
|
"Max":1.0,
|
|
|
|
"Mean":1.0,
|
|
|
|
"Min":1.0,
|
2017-09-05 21:58:35 +00:00
|
|
|
"Name":"nomad.nomad.rpc.query",
|
2017-09-05 17:23:55 +00:00
|
|
|
"Stddev":0.0,
|
2017-09-05 21:58:35 +00:00
|
|
|
"Sum":11.0
|
2017-09-05 17:23:55 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"Gauges":[
|
|
|
|
{
|
|
|
|
"Labels":{
|
|
|
|
"node_id":"cd7c3e0c-0174-29dd-17ba-ea4609e0fd1f",
|
|
|
|
"datacenter":"dc1"
|
|
|
|
},
|
|
|
|
"Name":"nomad.client.allocations.blocked",
|
|
|
|
"Value":0.0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Labels":{
|
|
|
|
"datacenter":"dc1",
|
|
|
|
"node_id":"cd7c3e0c-0174-29dd-17ba-ea4609e0fd1f"
|
|
|
|
},
|
|
|
|
"Name":"nomad.client.allocations.migrating",
|
|
|
|
"Value":0.0
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"Samples":[
|
|
|
|
{
|
|
|
|
"Count":20,
|
2017-09-05 21:58:35 +00:00
|
|
|
"Labels":{},
|
|
|
|
"Max":0.03544100001454353,
|
2017-09-05 17:23:55 +00:00
|
|
|
"Mean":0.023678050097078084,
|
|
|
|
"Min":0.00956599973142147,
|
|
|
|
"Name":"nomad.memberlist.gossip",
|
|
|
|
"Stddev":0.005445327799243976,
|
|
|
|
"Sum":0.4735610019415617
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"Count":1,
|
2017-09-05 21:58:35 +00:00
|
|
|
"Labels":{},
|
2017-09-05 17:23:55 +00:00
|
|
|
"Max":0.0964059978723526,
|
2017-09-05 21:58:35 +00:00
|
|
|
"Mean":0.0964059978723526,
|
2017-09-05 17:23:55 +00:00
|
|
|
"Min":0.0964059978723526,
|
|
|
|
"Name":"nomad.nomad.client.update_status",
|
|
|
|
"Stddev":0.0,
|
|
|
|
"Sum":0.0964059978723526
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
```
|
|
|
|
|