Skip to content
HALOWERK

Codewerk

promtool rules

Runs "promtool check rules --lint=all" on your rule file (syntax, PromQL parsing, template rendering, duplicate rules) and, if you send unit tests in promtool format, "promtool test rules" against it. Results are reported per message. Additional convention checks are listed separately as conventions: alerts without a for duration, without a severity label or without summary/description annotations, recording rule names that do not follow the level:metric:operations pattern recommended in the.

POST https://code.halowerk.com/v1/promtool-rules

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
rulesstringYesPrometheus rule file (YAML with groups).
testsstringNoOptional promtool unit test file; its rule_files entry is replaced by the submitted rules.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "rules"
  ],
  "properties": {
    "rules": {
      "type": "string",
      "minLength": 10,
      "maxLength": 1000000,
      "description": "Prometheus rule file (YAML with groups)."
    },
    "tests": {
      "type": "string",
      "maxLength": 1000000,
      "description": "Optional promtool unit test file; its rule_files entry is replaced by the submitted rules."
    }
  }
}

Open original schema

Published input example

{
  "rules": "groups:\n  - name: api\n    rules:\n      - alert: HighErrorRate\n        expr: sum(rate(http_requests_total{status=~\"5..\"}[5m])) / sum(rate(http_requests_total[5m])) > 0.05\n        for: 10m\n        labels: { severity: page }\n        annotations: { summary: High error rate }\n"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’