ASAPQuery is a drop-in query accelerator for queries in various languages like PromQL and SQL. ASAPQuery delivers:
- 100x latency reduction for various complex aggregate queries such as quantiles
- Configurable query accuracy
- Ease-of-use with your existing tech stack
ASAPQuery sits between Prometheus and Grafana. It intercepts queries from Grafana and answers them using streaming sketches, instead of scanning large volumes of raw data in Prometheus. It ingests data using Prometheus' remote_write interface. ASAPQuery also targets other observability systems (e.g. VictoriaMetrics) and time-series databases (e.g. Clickhouse, Elastic).
Try ASAPQuery in 5 minutes with our self-contained demo:
cd asap-quickstart
docker compose up -dOpen http://localhost:3000 and see ASAPQuery vs Prometheus side-by-side!
Full quickstart instructions at Quickstart Guide
Already have Prometheus and Grafana running? Use the drop-in instead:
cd asap-dropin
# Edit .env to point at your Prometheus, then:
docker compose up -dFull drop-in instructions at Drop-in Guide
Prometheus (and most time-series analytics) struggle with:
- High-cardinality metrics that slow down queries
- Complex aggregations such as percentiles
- Long time windows -
quantile_over_time(...[1h])can take seconds or fail - Memory pressure - Loading all raw timeseries required for query computation
ASAPQuery uses streaming sketches to:
- Pre-compute approximate summaries as data arrives
- Answer queries in milliseconds using compact sketches instead of raw data
- Bound memory usage - sketches are fixed-size regardless of data volume
- Maintain high accuracy - configurable error bounds (typically <1% error)
ASAPQuery has two main components: asap-planner-rs analyzes your PromQL query workload and generates sketch configurations, and asap-query-engine intercepts PromQL queries and serves them from pre-computed sketches. The query engine includes a built-in precompute engine that continuously builds sketches directly from live metrics via Prometheus remote_write — no external streaming infrastructure required.
- asap-planner-rs - Analyzes a PromQL query workload and auto-generates sketch configurations for asap-query-engine
- asap-query-engine - Intercepts incoming PromQL queries and serves them from pre-computed sketches, falling back to Prometheus for unsupported queries; includes a built-in precompute engine that continuously builds sketches from live metrics via Prometheus
remote_write
├── asap-quickstart/ # Self-contained demo (start here!)
├── asap-dropin/ # Drop-in for existing Prometheus-Grafana stacks
├── asap-planner-rs/ # Auto-configuration service
└── asap-query-engine/ # Query serving and sketch precomputation engine
- Drop-in ASAPQuery artifact that accelerates Clickhouse queries
ASAPQuery is currently alpha. There are missing features, known bugs, and possible performance issues. We will continue to work on these and create a more mature artifact.
ASAPQuery is part of ProjectASAP, a joint effort by researchers at Carnegie Mellon University and University of Maryland. ASAPQuery is based on academic research on query processing and sketching algorithms. If you are a researcher interested in using or contributing to ASAPQuery, please contact us. We are happy to help you.
ASAPQuery is licensed under the MIT License.
We are extremely grateful to the following sources of funding support for ASAPQuery and the academic research that underpins it:
- Laude Institute's Slingshot grant
- Juniper Networks
- U.S. NSF grants CNS-2431093, CNS-2415758, CNS-2132639, CNS-2111751, and CNS-2106214
- U.S. Army Research Office and U.S. Army Research Laboratory Grant W911NF-25-2-0028
Open a Github issue or email us at contact@projectasap.dev
