promtool command - Promtool command with extras
DESCRIPTION
Section titled “DESCRIPTION”ie
- driven by
environment-variable - Prometheus Kubernetes Operator CRD aware
EXAMPLE
Section titled “EXAMPLE”cat metrics.prom | promtool check metricscurl -s http://localhost:9090/metrics | promtool check metricspromtool test rules test.ymlThe files (metrics.prom, test.yml) should be in the current directory.
EXECUTION
Section titled “EXECUTION”The PromTool is executed with:
- the Prometheus docker image
- where only the working directory tree is available
EXTRAS
Section titled “EXTRAS”PrometheusRule Check
Section titled “PrometheusRule Check”The command check prometheusRule prometheusRuleFile permits to check
a Prometheus Rule
PrometheusRule test
Section titled “PrometheusRule test”This command enhances
the promtool test command so that
the
rule_files is generated
from Prometheus Rule.
The command test prometheusRule testFile will:
- scan all directory recursively for Prometheus Rule
- create a temporary rule file from them
- inject it into the
testFileas value of therule_filesproperty.
The url flag
Section titled “The url flag”This script will set the --url flag (The URL for the Prometheus server)
if the KUBEE_PROM_URL is set (default to http://localhost:9090)
Basic Auth
Section titled “Basic Auth”This script will set the --http.config.file (It defines the HTTP client configuration file for promtool to connect to
Prometheus)
with Basic Auth configuration.
The Basic Auth credentials should be stored in pass
- For the basic_auth user: the env
KUBEE_PROM_BASIC_AUTH_PASS_USERgives its path
# ie this command should return the userpass "$KUBEE_PROM_BASIC_AUTH_PASS_USER"- For the basic_auth password: the env
KUBEE_PROM_BASIC_AUTH_PASS_PASSWORDgives its path
# ie this command should return the passwordpass "$KUBEE_PROM_BASIC_AUTH_PASS_PASSWORD"