topk1(5, sum by (pod)2 (rate(node_cpu_seconds_total{mode=~".*"3}[3h]4)))
pedantic.run reads a PromQL or DataPrime query and returns, over a single HTTP call, the patterns that get expensive at runtime — negative-regex matchers, unfiltered aggregations, high-cardinality groupings.
Send a query; receive JSON findings. No auth. No state. No opinions it cannot defend.
topk(5, sum by (pod) (rate(node_cpu_seconds_total{mode=~".*"}[3h])))
topk(5, sum by (pod) (rate(node_cpu_seconds_total{mode=~".*"}[3h])))
{
"query": "topk(5, sum by (pod) (rate(node_cpu_seconds_total{mode=~\".*\"}[3h])))",
"summary": { "slow": 3, "moderate": 1 },
"findings": [
{
"selector": "node_cpu_seconds_total{mode=~\".*\"}",
"category": "aggregation",
"verdict": "slow",
"codes": [ { "code": "HIGH_CARD_GROUPING" }, { "code": "SORT_AGGREGATION" } ]
},
{
"selector": "node_cpu_seconds_total{mode=~\".*\"}",
"category": "matchers",
"verdict": "slow",
"codes": [ { "code": "REGEX_MATCHER" }, { "code": "CATCHALL_MATCHER" }, { "code": "UNANCHORED_REGEX" } ]
},
{ "category": "range_vectors", "verdict": "slow", "codes": [ { "code": "LONG_RANGE_VECTOR" } ] },
{ "category": "range_vectors", "verdict": "moderate", "codes": [ ] }
]
}
$ curl -s https://pedantic.run/api/promql/analyze \
-H 'content-type: application/json' \
-d '{"query":"topk(5, rate(container_memory_usage_bytes{pod=~\".*\"}[10m]))"}'
The query is read from the first of these that is present — in order, no negotiation:
POST /api/promql/analyze?q=rate(…)
{"query": "rate(…)"}
POST body: rate(…)
A terminal client for the same endpoint. Type a query, press ctrl+enter, and read a colour-coded breakdown of where it will hurt — same verdicts, same objections, never touching your Prometheus.
$ go install github.com/schultyy/pedantic.run_cli@latest $ pedantic
Or download a prebuilt binary (Linux & macOS, amd64 & arm64) from the releases page.
topk(10, sum by (pod) (rate(container_cpu_usage_seconds_total{env="prod"}[5m])))
Cost breakdown
████████████████ ● 1 slow ● 1 moderate ● 2 fast
│ SLOW · aggregation
│ container_cpu_usage_seconds_total{env="prod"}
│ • High-cardinality grouping (HIGH_CARD_GROUPING)
│ Grouping by an unbounded label (request_id, trace_id, pod, …).
│ • Sorting aggregation (SORT_AGGREGATION)
│ topk / bottomk / quantile must sort the full result set.
A DataPrime query is a pipeline of stages. Each finding is anchored to the stage (groupby, orderby, …) it applies to — same verdict scale, same JSON shape, same single POST.
source logs | groupby path aggregate avg(duration) | orderby _avg desc
{
"query": "source logs | groupby path aggregate avg(duration) | orderby _avg desc",
"summary": { "slow": 2, "runtime_dependent": 1 },
"findings": [
{
"stage": "groupby",
"verdict": "slow",
"detail": "path",
"code": { "code": "HIGH_CARD_GROUPING" }
},
{
"stage": "orderby",
"verdict": "slow",
"detail": null,
"code": { "code": "SORT_MATERIALIZE" }
},
{
"stage": "groupby",
"verdict": "runtime_dependent",
"detail": null,
"code": { "code": "MISSING_FILTER_BEFORE_AGG" }
}
]
}