github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/api-docs/metrics.mdx (about)

     1  ---
     2  layout: api
     3  page_title: Metrics - HTTP API
     4  sidebar_title: Metrics
     5  description: The /metrics endpoint is used to view metrics for Nomad
     6  ---
     7  
     8  # Metrics HTTP API
     9  
    10  The `/metrics` endpoint returns metrics for the current Nomad process.
    11  
    12  | Method | Path          | Produces           |
    13  | ------ | ------------- | ------------------ |
    14  | `GET`  | `/v1/metrics` | `application/json` |
    15  
    16  The table below shows this endpoint's support for
    17  [blocking queries](/api-docs#blocking-queries) and
    18  [required ACLs](/api-docs#acls).
    19  
    20  | Blocking Queries | ACL Required |
    21  | ---------------- | ------------ |
    22  | `NO`             | `none`       |
    23  
    24  ### Parameters
    25  
    26  - `format` `(string: "")` - Specifies the metrics format to be other than the
    27    JSON default. Currently, only `prometheus` is supported as an alternative
    28    format. This is specified as a query string parameter.
    29  
    30  ### Sample Request
    31  
    32  ```shell-sessioncurl https://localhost:4646/v1/metrics
    33  
    34  ```
    35  
    36  ```shell-sessioncurl https://localhost:4646/v1/metrics?format=prometheus
    37  
    38  ```
    39  
    40  ### Sample Response
    41  
    42  ```json
    43  {
    44    "Counters": [
    45      {
    46        "Count": 11,
    47        "Labels": {},
    48        "Max": 1.0,
    49        "Mean": 1.0,
    50        "Min": 1.0,
    51        "Name": "nomad.nomad.rpc.query",
    52        "Stddev": 0.0,
    53        "Sum": 11.0
    54      }
    55    ],
    56    "Gauges": [
    57      {
    58        "Labels": {
    59          "node_id": "cd7c3e0c-0174-29dd-17ba-ea4609e0fd1f",
    60          "datacenter": "dc1"
    61        },
    62        "Name": "nomad.client.allocations.blocked",
    63        "Value": 0.0
    64      },
    65      {
    66        "Labels": {
    67          "datacenter": "dc1",
    68          "node_id": "cd7c3e0c-0174-29dd-17ba-ea4609e0fd1f"
    69        },
    70        "Name": "nomad.client.allocations.migrating",
    71        "Value": 0.0
    72      }
    73    ],
    74    "Samples": [
    75      {
    76        "Count": 20,
    77        "Labels": {},
    78        "Max": 0.03544100001454353,
    79        "Mean": 0.023678050097078084,
    80        "Min": 0.00956599973142147,
    81        "Name": "nomad.memberlist.gossip",
    82        "Stddev": 0.005445327799243976,
    83        "Sum": 0.4735610019415617
    84      },
    85      {
    86        "Count": 1,
    87        "Labels": {},
    88        "Max": 0.0964059978723526,
    89        "Mean": 0.0964059978723526,
    90        "Min": 0.0964059978723526,
    91        "Name": "nomad.nomad.client.update_status",
    92        "Stddev": 0.0,
    93        "Sum": 0.0964059978723526
    94      }
    95    ]
    96  }
    97  ```