| <codeclass="text-nowrap">-h</code>, <codeclass="text-nowrap">--help</code> | Show context-sensitive help (also try --help-long and --help-man). |
| <codeclass="text-nowrap">--version</code> | Show application version. |
| <codeclass="text-nowrap">--enable-feature</code> | 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
| Command | Description |
| --- | --- |
| help | Show help. |
| check | Check the resources for validity. |
| query | Run query against a Prometheus server. |
| debug | Fetch debug information. |
| test | Unit testing. |
| tsdb | Run tsdb commands. |
### `promtool help`
Show help.
#### Arguments
| Argument | Description |
| --- | --- |
| command | Show help on command. |
### `promtool check`
Check the resources for validity.
#### Flags
| Flag | Description |
| --- | --- |
| <codeclass="text-nowrap">--extended</code> | Print extended information related to the cardinality of the metrics. |
##### `promtool check service-discovery`
Perform service discovery for the given job name and report the results, including relabeling.
###### Flags
| Flag | Description | Default |
| --- | --- | --- |
| <codeclass="text-nowrap">--timeout</code> | The time to wait for discovery results. | `30s` |
###### Arguments
| Argument | Description | 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
| Flag | Description | Default |
| --- | --- | --- |
| <codeclass="text-nowrap">--syntax-only</code> | Only check the config file syntax, ignoring file and content validation referenced in the config | |
| <codeclass="text-nowrap">--lint</code> | Linting checks to apply to the rules specified in the config. Available options are: all, duplicate-rules, none. Use --lint=none to disable linting | `duplicate-rules` |
| <codeclass="text-nowrap">--lint-fatal</code> | Make lint errors exit with exit code 3. | `false` |
| <codeclass="text-nowrap">--agent</code> | Check config file for Prometheus in Agent mode. | |
###### Arguments
| Argument | Description | Required |
| --- | --- | --- |
| config-files | The config files to check. | Yes |
##### `promtool check web-config`
Check if the web config files are valid or not.
###### Arguments
| Argument | Description | Required |
| --- | --- | --- |
| web-config-files | The config files to check. | Yes |
| <codeclass="text-nowrap">--lint</code> | Linting checks to apply. Available options are: all, duplicate-rules, none. Use --lint=none to disable linting | `duplicate-rules` |
| <codeclass="text-nowrap">--lint-fatal</code> | Make lint errors exit with exit code 3. | `false` |
###### Arguments
| Argument | Description | Required |
| --- | --- | --- |
| rule-files | The rule files to check. | Yes |
##### `promtool check metrics`
Pass Prometheus metrics over stdin to lint them for consistency and correctness.
| <codeclass="text-nowrap">--http.config.file</code> | HTTP client configuration file for promtool to connect to Prometheus. | |
| <codeclass="text-nowrap">--url</code> | The URL for the Prometheus API with the data where the rule will be backfilled from. | `http://localhost:9090` |
| <codeclass="text-nowrap">--start</code> | The time to start backfilling the new rule from. Must be a RFC3339 formatted date or Unix timestamp. Required. | |
| <codeclass="text-nowrap">--end</code> | 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. | |
| <codeclass="text-nowrap">--eval-interval</code> | How frequently to evaluate rules when backfilling if a value is not set in the recording rule files. | `60s` |
###### Arguments
| Argument | Description | Required |
| --- | --- | --- |
| rule-files | A list of one or more files containing recording rules to be backfilled. All recording rules listed in the files will be backfilled. Alerting rules are not evaluated. | Yes |