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"
}
}
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 theheader_
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\"}))"
# ...
}