Files
magnus919_agent-skills/telemetry/fixtures/prometheus-rules.yml
T
Magnus HedemarkGitHubfactory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
f83d48ba53 feat(skill): add telemetry skill (Prometheus + OpenTelemetry + Loki) (#246) (#266)
Adds one top-level telemetry skill covering the observability stack that
deploys as one unit: Prometheus (scrape config, recording/alerting rules,
relabeling, retention, HA), the OpenTelemetry Collector (pipelines,
receivers/processors/exporters, sampling, trace/span correlation), and Loki
(ingest, LogQL, retention, labels).

Ships the read-only telemetry-check script (stdlib-only, --json): Prometheus
rule sanity mirroring promtool check rules plus scrape-target reachability
probes, fixture-tested with 16 unittest/pytest cases. Includes five dated
references, a human-facing README, and six eval cases covering rule authoring,
pipeline design, and retention. Routes up to platform-engineering and grafana
without duplicating their content. Regenerates the llms.txt / marketplace /
plugin catalogs and adds the README index entry.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-08-03 19:29:39 -04:00

30 lines
1.0 KiB
YAML

# Sample Prometheus recording and alerting rules used by telemetry-check.
# Mirrors the structure promtool check rules accepts: groups of recording and
# alerting rules with labels, annotations, and durations.
groups:
- name: api-slo
interval: 1m
rules:
- record: job:http_requests:rate5m
expr: sum by (job) (rate(http_requests_total{job="api"}[5m]))
- record: job:http_errors:rate5m
expr: sum by (job) (rate(http_requests_total{job="api",status=~"5.."}[5m]))
- alert: ApiHighErrorRate
expr: job:http_errors:rate5m / job:http_requests:rate5m > 0.05
for: 10m
labels:
severity: page
team: platform
annotations:
summary: "API error rate above 5% for 10 minutes"
runbook: "https://example.com/runbooks/api-high-error-rate"
- name: node-health
rules:
- alert: InstanceDown
expr: up == 0
for: 5m
labels:
severity: critical
annotations:
summary: "Instance {{ $labels.instance }} is down"