Skip to content

test(promql): add a small o11y-bench-derived PromQL corpus - #136

Merged
zzylol merged 1 commit into
mainfrom
promql-corpus-o11y-bench
Jul 21, 2026
Merged

zzylol merged 1 commit into
mainfrom
promql-corpus-o11y-bench

Conversation

@zzylol

@zzylol zzylol commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds tests/observability/data/o11y_bench_promql.txt: 27 deduplicated PromQL queries extracted from grafana/o11y-bench's tasks-spec/**/*.yaml grading rubrics (fact.query where backend: prometheus) — realistic SRE incident-response queries (error ratios, burn-rate assessment, cache-lag/retry-backlog triage, capacity checks).
  • Adds tests/observability/o11y_bench_promql.rs, mirroring the existing awesome_prometheus_alerts.rs pattern: lowers every query (no execution) and asserts totality (Ok/clean Err, never panics). Since this corpus is small and hand-curated rather than a large statistical sample, it also pins full coverage (all 27 lower cleanly today) instead of a coverage floor.
  • Registers the new test target in crates/frontend-promql/Cargo.toml.

Licensing concern — not resolved by this PR

o11y-bench is AGPL-3.0, unlike this repo's other vendored corpora (awesome_prometheus_alerts.txt is MIT, promql_corpus_testdata.txt/promql_corpus_docs.txt are from Prometheus docs / PromLabs). Copying these short query-expression fixtures verbatim into a differently-licensed test suite raises an open question that this PR does not settle — tracked in #135. The corpus file and test module both carry a comment pointing at that issue.

Test plan

  • cargo test -p asap-frontend-promql --test o11y_bench_promql -- --nocapture — 1 passed, all 27 queries lower cleanly.
  • cargo test -p asap-frontend-promql — full crate suite (44 existing tests + new one) passes.
  • cargo clippy -p asap-frontend-promql --all-targets — clean.

🤖 Generated with Claude Code

27 deduplicated queries pulled from grafana/o11y-bench's task-grading
rubrics — realistic SRE incident/investigation PromQL (error ratios,
burn rate, cache-lag/retry-backlog triage, capacity checks). All 27
lower cleanly; asserts full coverage since the corpus is small and
hand-picked rather than a statistical sample.

o11y-bench is AGPL-3.0, unlike this repo's other MIT/Apache-2.0
corpora — that's an open question, tracked in #135, not resolved here.
@zzylol

zzylol commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

@milindsrivastava1997 FYI

@zzylol
zzylol merged commit ce400e5 into main Jul 21, 2026
1 check passed
@zzylol
zzylol deleted the promql-corpus-o11y-bench branch July 21, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant