Skip to content

Rules Wiki

This project evaluates Prometheus metrics using declarative TOML rules from automated-rules/.

Use this wiki to understand what rule types exist and how to write new rules.

Start Here

Minimal Rule Skeleton

rule_type = "gauge_threshold"
metric_name = "my_metric_name"
display_name = "my_metric_name"
description = "What this metric means"

[thresholds]
low = 100
high = 1000
higher_is_worse = true

[messages]
green = "{value:.0f} healthy"
yellow = "{value:.0f} elevated"
red = "{value:.0f} critical"

Validate Rules

# Build CLI
make build

# Validate all rules
./bin/metrics-analyzer validate ./automated-rules

Quick Test With Metrics

./bin/metrics-analyzer analyze --rules ./automated-rules testdata/fixtures/sample_metrics.txt