github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/tools/autoscaling/plugins/apm/prometheus.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: 'Autoscaling Plugins: Prometheus'
     4  description: The "prometheus" APM plugin queries a Prometheus server.
     5  ---
     6  
     7  # Prometheus APM Plugin
     8  
     9  The `prometheus` APM plugin allows querying for metrics stored in a
    10  [Prometheus][prometheus_io] server.
    11  
    12  ## Agent Configuration Options
    13  
    14  ```hcl
    15  apm "prometheus" {
    16    driver = "prometheus"
    17  
    18    config = {
    19      address = "http://prometheus.my.endpoint.io:9090"
    20  
    21      ca_cert = "/path/to/ca.crt"
    22  
    23      basic_auth_user     = "user"
    24      basic_auth_password = "secret"
    25  
    26      header_X-Scope-OrgID   = "my-org"
    27      header_X-Custom-Header = "custom-header"
    28    }
    29  }
    30  ```
    31  
    32  - `address` `(string: "http://127.0.0.1:9090")` - The address of the Prometheus
    33    endpoint used to perform queries.
    34  
    35  - `basic_auth_user` `(string: "")` - The HTTP basic auth user to use when
    36    making requests to Prometheus.
    37  
    38  - `basic_auth_password` `(string: "")` - The HTTP basic auth password to use
    39    when making requests to Prometheus.
    40  
    41  - `ca_cert` `(string: "")` - Path to a PEM encoded CA cert file to use to
    42    connect to the Prometheus server.
    43  
    44  - `header_*` `(string: "")` - Additional HTTP headers to set when making
    45    requests to Prometheus. Several headers may be specified and the final header
    46    name will be set as the key with the `header_` prefix removed.
    47  
    48  - `skip_verify` `(bool: false)` - Do not verify TLS certificates when
    49    connecting to the Prometheus server. This is strongly discouraged.
    50  
    51  ## Policy Configuration Options
    52  
    53  ```hcl
    54  check {
    55    source = "prometheus"
    56    query  = "avg((haproxy_server_current_sessions{backend=\"http_back\"}))"
    57    # ...
    58  }
    59  ```
    60  
    61  [prometheus_io]: https://prometheus.io/