June 20-22 Announcing HashiConf Europe full schedule: keynotes, sessions, labs & more Register Now
  • Overview
    • Batch Processing Workloads
    • Edge Workload Management
    • Non-Containerized Application Orchestration
    • Simple Container Orchestration
  • Enterprise
  • Tutorials
  • Docs
  • API
  • Plugins
  • Tools
  • Community
GitHub—Stars on GitHub
Download
    • Overview
      • Overview
      • apm
      • dynamic_application_sizing
      • http
      • nomad
      • policy
      • policy_eval
      • source
      • strategy
      • target
      • telemetry
    • API
    • CLI
    • Policy
    • Telemetry
      • Overview
        • Overview
        • Datadog
        • Nomad API
        • Prometheus
        • Overview
        • Dynamic Application Sizing Average
        • Dynamic Application Sizing Max
        • Dynamic Application Sizing Percentile
        • Fixed Value
        • Pass-Through
        • Target Value
        • Threshold
        • Overview
        • Amazon Web Services Autoscaling Group
        • Azure Virtual Machine Scale Set
        • Dynamic Application Sizing
        • Google Cloud Engine Managed Instance Group
        • Nomad Task Group
      • Community
      • Overview
      • Checks
      • Node Selector Strategy
        • Overview
        • Base
        • APM
        • Strategy
        • Target
Type '/' to Search

»Prometheus APM Plugin

The prometheus APM plugin allows querying for metrics stored in a Prometheus server.

»Agent Configuration Options

apm "prometheus" {
  driver = "prometheus"

  config = {
    address = "http://prometheus.my.endpoint.io:9090"

    ca_cert = "/path/to/ca.crt"

    basic_auth_user     = "user"
    basic_auth_password = "secret"

    header_X-Scope-OrgID   = "my-org"
    header_X-Custom-Header = "custom-header"
  }
}
apm "prometheus" {
  driver = "prometheus"

  config = {
    address = "http://prometheus.my.endpoint.io:9090"

    ca_cert = "/path/to/ca.crt"

    basic_auth_user     = "user"
    basic_auth_password = "secret"

    header_X-Scope-OrgID   = "my-org"
    header_X-Custom-Header = "custom-header"
  }
}
  • address (string: "http://127.0.0.1:9090") - The address of the Prometheus endpoint used to perform queries.

  • basic_auth_user (string: "") - The HTTP basic auth user to use when making requests to Prometheus.

  • basic_auth_password (string: "") - The HTTP basic auth password to use when making requests to Prometheus.

  • ca_cert (string: "") - Path to a PEM encoded CA cert file to use to connect to the Prometheus server.

  • header_* (string: "") - Additional HTTP headers to set when making requests to Prometheus. Several headers may be specified and the final header name will be set as the key with the header_ prefix removed.

  • skip_verify (bool: false) - Do not verify TLS certificates when connecting to the Prometheus server. This is strongly discouraged.

»Policy Configuration Options

check {
  source = "prometheus"
  query  = "avg((haproxy_server_current_sessions{backend=\"http_back\"}))"
  # ...
}
check {
  source = "prometheus"
  query  = "avg((haproxy_server_current_sessions{backend=\"http_back\"}))"
  # ...
}
github logoEdit this page
DocsAPIResourcesPrivacySecurityPress KitConsent Manager