Skip to content

eval: PromQL and metrics for end-to-end runs in classic tables (#204 P2) - #208

Merged
milindsrivastava1997 merged 1 commit into
mainfrom
eval/e2e-promql
Oct 11, 2026
Merged

milindsrivastava1997 merged 1 commit into
mainfrom
eval/e2e-promql

Conversation

@milindsrivastava1997

@milindsrivastava1997 milindsrivastava1997 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Before this PR

The workload tables in rqe-optimizer/results/autosketch-vs-asap-hydra/inputs/tables/ are built as RQEs directly. They name queries (sum_by_job) but have no PromQL, and they don't say which metrics and labels to generate. ASAPQuery can't run a saved plan end to end without both (ProjectASAP/ASAPQuery#824).

After this PR

export_autosketch_eval_table.py --synthetic adds workloads[0].e2e to every classic table:

  • e2e.queries: one {promql, interval_secs, rqes} per query and repeat interval. Template 10's ratio quantile_over_time(0.9, data[w]) / quantile_over_time(0.5, data[w]) reads two RQEs. Classic base: 54 queries over 50 RQEs.
  • e2e.metrics: gauge data (sums, quantiles, top-k by sum) and counter data_total (rates), or data_i / data_i_total in the metric copies. Labels use the schemas format: job (10) and label_0 (1,000 per job, child_of: job, so 1e4 series), plus 200 samples/s per series and each stream's value shape.

The runner does not read e2e. The existing schemas and per-RQE grouping fields are not reused, because the runner reads them and they would allow roll-ups and change the plans.

  • The four committed classic tables now carry the block; their RQEs are unchanged (checked), so the plans in plans/ still match them, and each keeps its sketch_bench_revision. The pre-commit hook added a trailing newline to each.
  • rqe-optimizer/README.md documents the block.
  • Multi-grouping and all tables get no block: those templates have no PromQL yet.

ASAPQuery#824 builds its ControllerConfig from e2e and uses e2e.queries to link its RQEs to the plan's RQE ids.

Note: in the r = 8 table, 47 PromQL strings repeat at more than one interval and read different RQEs. ASAPQuery's inference config is keyed by query string, so #824 B2 refuses them. The base table has none.

Closes P2 of #204.

Example

Excerpt of workloads[0].e2e in synthetic-templatesclassic-shared1.json: 4 of the 54 queries (a spatial sum, a rate, a top-k and template 10's ratio, which reads two RQEs) and both metrics in full. View the whole block with jq '.workloads[0].e2e' <table>.

{
  "queries": [
    {
      "interval_secs": 1,
      "promql": "sum by (job) (data)",
      "rqes": [
        "synthetic/templates=classic/shared=1/sum_by_job/keys/1s"
      ]
    },
    {
      "interval_secs": 60,
      "promql": "topk(32, sum by (label_0) (sum_over_time(data[15m])))",
      "rqes": [
        "synthetic/templates=classic/shared=1/topk32_sum_by_label0_sum_over_time/keys/15m"
      ]
    },
    {
      "interval_secs": 60,
      "promql": "sum by (job) (rate(data_total[15m]))",
      "rqes": [
        "synthetic/templates=classic/shared=1/sum_by_job_rate/keys/15m"
      ]
    },
    {
      "interval_secs": 60,
      "promql": "quantile_over_time(0.9, data[15m]) / quantile_over_time(0.5, data[15m])",
      "rqes": [
        "synthetic/templates=classic/shared=1/quantile_over_time_p0.9/values/15m",
        "synthetic/templates=classic/shared=1/quantile_over_time_p0.5/values/15m"
      ]
    }
  ],
  "metrics": {
    "data": {
      "labels": [
        {
          "cardinality": 10,
          "name": "job"
        },
        {
          "cardinality": 1000,
          "child_of": "job",
          "name": "label_0"
        }
      ],
      "samples_per_sec_per_series": 200,
      "type": "gauge",
      "values": {
        "dist": {
          "pareto": 2
        },
        "value": {
          "keys": 10000,
          "zipf": 1.1
        }
      }
    },
    "data_total": {
      "labels": [
        {
          "cardinality": 10,
          "name": "job"
        },
        {
          "cardinality": 1000,
          "child_of": "job",
          "name": "label_0"
        }
      ],
      "samples_per_sec_per_series": 200,
      "type": "counter",
      "values": {
        "increment": {
          "keys": 10000,
          "zipf": 1.1
        }
      }
    }
  }
}

Validation

  • python3 scripts/test_export_autosketch_eval_table.py: 26 tests pass. New: every classic RQE is read by a query and no query names an unknown RQE, the 54-query count, template 10's ratio, intervals, and the block's presence and metrics per table. The byte-for-byte test against the older committed tables ignores e2e.
  • On main before the change, --synthetic regenerates all 12 committed tables and plan.tsv exactly; after it, they match apart from e2e.

🤖 Generated with Claude Code

export_autosketch_eval_table.py --synthetic adds workloads[0].e2e to classic
tables: each PromQL query with its repeat interval and the RQEs it reads
(template 10's ratio reads two), and the metrics to generate (gauge data,
counter data_total; job and label_0 child_of job). The runner does not read
it, so the RQEs and the committed plans are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@milindsrivastava1997
milindsrivastava1997 merged commit 4b76c0f into main Oct 11, 2026
2 checks passed
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