Scroll to navigation

PROMTOOL(1) Prometheus PROMTOOL(1)

NAME

promtool - Tooling for the Prometheus monitoring system

SYNOPSIS

DESCRIPTION

Tooling for the Prometheus monitoring system.

OPTIONS

Show context-sensitive help (also try --help-long and --help-man).
Show application version.
Enable experimental commands.
Comma separated feature names to enable (only PromQL related and no-default-scrape-port). See https://prometheus.io/docs/prometheus/latest/feature_flags/ for the options and more details.

COMMANDS

help [<command>...]

Show help.

check service-discovery [<flags>] <config-file> <job>

Perform service discovery for the given job name and report the results, including relabeling.

The time to wait for discovery results.

check config [<flags>] <config-files>...

Check if the config files are valid or not.

Only check the config file syntax, ignoring file and content validation referenced in the config
Linting checks to apply to the rules specified in the config. Available options are: all, duplicate-rules, none. Use --lint=none to disable linting
Make lint errors exit with exit code 3.
Check config file for Prometheus in Agent mode.

check web-config <web-config-files>...

Check if the web config files are valid or not.

check healthy [<flags>]

Check if the Prometheus server is healthy.

HTTP client configuration file for promtool to connect to Prometheus.
http://localhost:9090
The URL for the Prometheus server.

check ready [<flags>]

Check if the Prometheus server is ready.

HTTP client configuration file for promtool to connect to Prometheus.
http://localhost:9090
The URL for the Prometheus server.

check rules [<flags>] [<rule-files>...]

Check if the rule files are valid or not.

Linting checks to apply. Available options are: all, duplicate-rules, none. Use --lint=none to disable linting
Make lint errors exit with exit code 3.

check metrics

Pass Prometheus metrics over stdin to lint them for consistency and correctness.

examples:

$ cat metrics.prom | promtool check metrics

$ curl -s http://localhost:9090/metrics | promtool check metrics

query instant [<flags>] <server> <expr>

Run instant query.

Query evaluation time (RFC3339 or Unix timestamp).

query range [<flags>] <server> <expr>

Run range query.

Extra headers to send to server.
Query range start time (RFC3339 or Unix timestamp).
Query range end time (RFC3339 or Unix timestamp).
Query step size (duration).

query series --match=MATCH [<flags>] <server>

Run series query.

Series selector. Can be specified multiple times.
Start time (RFC3339 or Unix timestamp).
End time (RFC3339 or Unix timestamp).

query labels [<flags>] <server> <name>

Run labels query.

Start time (RFC3339 or Unix timestamp).
End time (RFC3339 or Unix timestamp).
Series selector. Can be specified multiple times.

query analyze --server=SERVER --type=TYPE --match=MATCH [<flags>]

Run queries against your Prometheus to analyze the usage pattern of certain metrics.

Prometheus server to query.
Type of metric: histogram.
Time frame to analyze.
Query time (RFC3339 or Unix timestamp), defaults to now.
Series selector. Can be specified multiple times.

debug pprof <server>

Fetch profiling debug information.

debug metrics <server>

Fetch metrics debug information.

debug all <server>

Fetch all debug information.

push metrics [<flags>] <remote-write-url> [<metric-files>...]

Push metrics to a prometheus remote write (for testing purpose only).

Label to attach to metrics. Can be specified multiple times.
The time to wait for pushing metrics.
Prometheus remote write header.

test rules [<flags>] <test-rule-file>...

Unit tests for rules.

If set, will only run test groups whose names match the regular expression. Can be specified multiple times.
[Experimental] Print colored differential output between expected & received output.

tsdb bench write [<flags>] [<file*>]

Run a write performance benchmark.

Set the output path.
Number of metrics to read.
Number of scrapes to simulate.

tsdb analyze [<flags>] [<db path*>] [<block id>]

Analyze churn, label pair cardinality and compaction efficiency.

How many items to show in each list.
Run extended analysis.
Series selector to analyze. Only 1 set of matchers is supported now.

tsdb list [<flags>] [<db path*>]

List tsdb blocks.

Print human readable values.

tsdb dump [<flags>] [<db path*>]

Dump samples from a TSDB.

Root directory where a sandbox directory would be created in case WAL replay generates chunks. The sandbox directory is cleaned up at the end.
Minimum timestamp to dump.
Maximum timestamp to dump.
Series selector. Can be specified multiple times.

tsdb dump-openmetrics [<flags>] [<db path*>]

[Experimental] Dump samples from a TSDB into OpenMetrics text format, excluding native histograms and staleness markers, which are not representable in OpenMetrics.

Root directory where a sandbox directory would be created in case WAL replay generates chunks. The sandbox directory is cleaned up at the end.
Minimum timestamp to dump.
Maximum timestamp to dump.
Series selector. Can be specified multiple times.

tsdb create-blocks-from openmetrics <input file> [<output directory*>]

Import samples from OpenMetrics input and produce TSDB blocks. Please refer to the storage docs for more details.

tsdb create-blocks-from rules --start=START [<flags>] <rule-files>...

Create blocks of data for new recording rules.

HTTP client configuration file for promtool to connect to Prometheus.
http://localhost:9090
The URL for the Prometheus API with the data where the rule will be backfilled from.
The time to start backfilling the new rule from. Must be a RFC3339 formatted date or Unix timestamp. Required.
If an end time is provided, all recording rules in the rule files provided will be backfilled to the end time. Default will backfill up to 3 hours ago. Must be a RFC3339 formatted date or Unix timestamp.
Output directory for generated blocks.
How frequently to evaluate rules when backfilling if a value is not set in the recording rule files.

promql format <query>

Format PromQL query to pretty printed form.

promql label-matchers set [<flags>] <query> <name> <value>

Set a label matcher in the query.

Type of the label matcher to set.

promql label-matchers delete <query> <name>

Delete a label from the query.

February 2025 prometheus 2.53.1+ds