github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/commands/operator/metrics.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Commands: operator metrics'
     4  sidebar_title: metrics
     5  ---
     6  
     7  # Command: operator metrics
     8  
     9  The `operator metrics` command queries the [metrics API endpoint](/api-docs/metrics).
    10  
    11  ## Usage
    12  
    13  ```plaintext
    14  nomad operator metrics [options]
    15  ```
    16  
    17  ## General Options
    18  
    19  @include 'general_options_no_namespace.mdx'
    20  
    21  ## Metrics Specific Options
    22  
    23  - `-pretty`: Pretty prints the JSON output
    24  - `-format <format>`: Specify output format (`prometheus`)
    25  - `-json`: Output the allocation in its JSON format.
    26  - `-t`: Format and display allocation using a Go template.
    27  
    28  ## Output
    29  
    30  The output of `nomad operator metrics` is a JSON representation of the
    31  [metrics API endpoint](/api-docs/metrics).
    32  
    33  ```shell-session
    34  $ nomad operator metrics -pretty
    35  {
    36    "Counters": [
    37      {
    38        "Count": 11,
    39        "Labels": {},
    40        "Max": 1.0,
    41        "Mean": 1.0,
    42        "Min": 1.0,
    43        "Name": "nomad.nomad.rpc.query",
    44        "Stddev": 0.0,
    45        "Sum": 11.0
    46      }
    47    ],
    48    "Gauges": [
    49      {
    50        "Labels": {
    51          "node_id": "cd7c3e0c-0174-29dd-17ba-ea4609e0fd1f",
    52          "datacenter": "dc1"
    53        },
    54        "Name": "nomad.client.allocations.blocked",
    55        "Value": 0.0
    56      },
    57      {
    58        "Labels": {
    59          "datacenter": "dc1",
    60          "node_id": "cd7c3e0c-0174-29dd-17ba-ea4609e0fd1f"
    61        },
    62        "Name": "nomad.client.allocations.migrating",
    63        "Value": 0.0
    64      }
    65    ],
    66    "Samples": [
    67      {
    68        "Count": 20,
    69        "Labels": {},
    70        "Max": 0.03544100001454353,
    71        "Mean": 0.023678050097078084,
    72        "Min": 0.00956599973142147,
    73        "Name": "nomad.memberlist.gossip",
    74        "Stddev": 0.005445327799243976,
    75        "Sum": 0.4735610019415617
    76      },
    77      {
    78        "Count": 1,
    79        "Labels": {},
    80        "Max": 0.0964059978723526,
    81        "Mean": 0.0964059978723526,
    82        "Min": 0.0964059978723526,
    83        "Name": "nomad.nomad.client.update_status",
    84        "Stddev": 0.0,
    85        "Sum": 0.0964059978723526
    86      }
    87    ]
    88  }
    89  ```