Skip to content

Commit 418e633

Browse files
committed
Add documentation for the command
1 parent d04d627 commit 418e633

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,22 @@ This command will load each rule group in the specified files and load them into
6060

6161
cortextool rules load ./example_rules_one.yaml ./example_rules_two.yaml ...
6262

63+
#### Rules Prepare
64+
65+
This command prepares a rules file for upload to Cortex. It lints all your PromQL expressions and adds an specific label to your PromQL query aggregations in the file. Unlike, the previous command this one does not interact with your Cortex cluster.
66+
67+
cortextool rules prepare -i ./example_rules_one.yaml ./example_rules_two.yaml ...
68+
69+
There are two flags of note for this command:
70+
- `-i` which allows you to edit in place, otherwise a a new file with a `.output` extension is created with the results of the run.
71+
- `-l` which allows you specify the label you want you add for your aggregations, it is `cluster` by default.
72+
73+
At the end of the run, the command tells you whenever the operation was a success in the form of
74+
75+
INFO[0000] SUCESS: 194 rules found, 0 modified expressions
76+
77+
It is important to note that a modification can be a PromQL expression lint or a label add to your aggregation.
78+
6379
# chunktool
6480

6581
This repo also contains the `chunktool`. A client meant to interact with chunks stored and indexed in cortex backends.

0 commit comments

Comments
 (0)