Add custom sphinx extension for rendering and filtering Prometheus rules #2558
Description
Component:
'Basic alerting', 'docs'
Why this is needed:
See entire comments here: #2542 (review) as posted by @gdemonet
Our current implementation of the tooling to extract default Prometheus alerting rules
makes use of a CSV file to generate documentation in a tabular format using the sphinx csv-table
extension.
Currently, Prometheus alerting rules are saved as JSON. Even if a JSON format is deemed good,
a flat list representation of this data in JSON is not sufficient given that we might want to
group and/or filter certain rules be it alerting or recording rules.
What should be done:
Build a sphinx extension that reads the full result dump of Prometheus rules
currently saved as tools/rule_extractor/rules.json
. The extension should be able to render the JSON output, to show a subset of fields we choose within the documentation potentially in a tabular manner.
Implementation proposal (strongly recommended):
Test plan: