Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
rule: Rules with YAML `|2` indentation cannot be parsed #3545
Comments
|
The error seems to happen in the
Care filling an issue in upstream Prometheus? Then, we could pull the fixes to Thanos once it is fixed there. |
|
Prometheus 2.22.1 (and all previous versions going back to 1.x) can load the same rules just fine. Something happens along the way, note that the rule file that fails to load is given as |
|
How can I get at this intermediate rule file? |
|
We parse, then remove field and generate, then Prometheus parses and fails, so it's ruler bug. I don't think this is required, I think this issue has all the things to investigate fix it. Thanks for reporting Help wanted. The easiest is to just write unit test and adjust the marshaller/remove field. |


Thanos, Prometheus and Golang version used:
built at revision d616214. We saw the same effect in production with v0.15.0, haven't tried again in 0.17.2.
Prometheus version N/A.
Object Storage Provider: N/A
What happened:
A rule file like
passes
thanos tools rules-checkbut cannot be loaded correctly:What you expected to happen:
This YAML is valid, it should be loaded correctly. This is a moderately popular PromQL formatting style and we use it a lot.
How to reproduce it (as minimally and precisely as possible):
With the rules file above,
Full logs to relevant components:
full example
Anything else we need to know:
I don't know where the error is being produced –
pkg/rules/manager.godoes not have 946 lines!?