Perform service discovery for the given job name and report the results, including relabeling.
Flags
标志
描述
Default
--timeout
The time to wait for discovery results.
30s
Arguments
参数
描述
Required
config-file
The prometheus config file.
Yes
job
The job to run service discovery for.
Yes
promtool check config
Check if the config files are valid or not.
Flags
标志
描述
Default
--syntax-only
Only check the config file syntax, ignoring file and content validation referenced in the config
--lint
Linting checks to apply to the rules/scrape configs specified in the config. Available options are: all, duplicate-rules, none, too-long-scrape-interval. Use --lint=none to disable linting
duplicate-rules
--lint-fatal
Make lint errors exit with exit code 3.
false
--ignore-unknown-fields
Ignore unknown fields in the rule groups read by the config files. This is useful when you want to extend rule files with custom metadata. Ensure that those fields are removed before loading them into the Prometheus server as it performs strict checks by default.
Linting checks to apply. Available options are: all, duplicate-rules, none. Use --lint=none to disable linting
duplicate-rules
--lint-fatal
Make lint errors exit with exit code 3.
false
--ignore-unknown-fields
Ignore unknown fields in the rule files. This is useful when you want to extend rule files with custom metadata. Ensure that those fields are removed before loading them into the Prometheus server as it performs strict checks by default.
false
Arguments
参数
描述
rule-files
The rule files to check, default is read from standard input.
promtool check metrics
Pass Prometheus metrics over stdin to lint them for consistency and correctness, and optionally perform cardinality analysis.
Push metrics to a prometheus remote write (for testing purpose only).
Flags
标志
描述
Default
--label
Label to attach to metrics. Can be specified multiple times.
job=promtool
--timeout
The time to wait for pushing metrics.
30s
--header
Prometheus remote write header.
--protobuf_message
Protobuf message to use when writing (prometheus.WriteRequest or io.prometheus.write.v2.Request).
prometheus.WriteRequest
Arguments
参数
描述
Required
remote-write-url
Prometheus remote write url to push metrics.
Yes
metric-files
The metric files to push, default is read from standard input.
promtool test
单元测试。
Flags
标志
描述
--junit
File path to store JUnit XML test results.
promtool test rules
Unit tests for rules.
Flags
标志
描述
Default
--run...
If set, will only run test groups whose names match the regular expression. Can be specified multiple times.
--debug
Enable unit test debugging.
false
--diff
[Experimental] Print colored differential output between expected & received output.
false
--ignore-unknown-fields
Ignore unknown fields in the test files. This is useful when you want to extend rule files with custom metadata. Ensure that those fields are removed before loading them into the Prometheus server as it performs strict checks by default.
false
Arguments
参数
描述
Required
test-rule-file
The unit test file.
Yes
promtool tsdb
运行 tsdb 命令。
promtool tsdb bench
Run benchmarks.
promtool tsdb bench write
Run a write performance benchmark.
Flags
标志
描述
Default
--out
Set the output path.
benchout
--metrics
Number of metrics to read.
10000
--scrapes
Number of scrapes to simulate.
3000
Arguments
参数
描述
Default
file
Input file with samples data, default is (../../tsdb/testdata/20kseries.json).