Rapid-fire: Prometheus and promtool commands every SRE should know.
BeginnerConceptBest Practices & Rapid-Fire Commands
Answer
promtool check rules slo-rules.yaml # syntax and validity
promtool test rules slo-rules.test.yaml # unit test alerts
promtool check config prometheus.yml
promtool query instant http://localhost:9090 'slo:sli_error:ratio_rate1h'
curl -s localhost:9090/api/v1/rules | jq '.data.groups[].name'
curl -s localhost:9090/api/v1/alerts | jq '.data.alerts[] | {alertname: .labels.alertname, state}'
curl -X POST localhost:9090/-/reload # needs --web.enable-lifecycle
More on Best Practices & Rapid-Fire Commands
What are your top SLO and alerting best practices?IntermediateWhat are your top incident-management best practices?IntermediateRapid-fire: Alertmanager and amtool commands.BeginnerRapid-fire: k6 commands and flags.BeginnerRapid-fire: Chaos Mesh and kubectl commands for chaos experiments.IntermediateRapid-fire: commands to check service health quickly during an incident on Kubernetes.Intermediate