Presenters

Source

Supercharge Your Grafana Dashboards: Say Goodbye to Loading Lag with ASAPQuery! 🚀

Are you tired of staring at loading spinners while your Grafana dashboards struggle to keep up? Milind, a PhD student at Carnegie Mellon and leader of ProjectASAP, has a game-changing solution that promises orders of magnitude faster Grafana dashboards and lower query costs. Get ready to meet ASAPQuery! ✨

The Pain of Slow Dashboards 😫

We’ve all been there. You’ve painstakingly set up your Prometheus-Grafana stack to monitor your deployments. But every time you adjust a time range or refresh your dashboard, you’re met with that frustrating loading lag. And as you expand your query window, that lag only gets worse. What if this entire experience could be instant?

Introducing ASAPQuery: The Instant Refresh Button You’ve Been Dreaming Of! 💡

ASAPQuery is an open-source, drop-in query accelerator designed to seamlessly integrate into your existing Prometheus-Grafana setup. Imagine this: your Grafana dashboard refreshes, and BAM! – it’s loaded. That’s the power of ASAPQuery. It intercepts queries from Grafana to Prometheus, delivering answers at lightning speed. The best part? You don’t need to change a single thing in Grafana, other than pointing it to ASAPQuery.

The Secret Sauce: Understanding Sketches 🧠

So, how does ASAPQuery achieve these incredible speeds? The magic lies in something called sketches.

Beyond Exact and Sampled: The Power of Sketches 📊

Let’s use an analogy. Imagine you’re on a safari.

  • Exact Query Computation: This is like trying to remember every single animal you saw. It’s accurate but incredibly taxing on your memory (or system resources).
  • Sampling: This is like only remembering every fifth animal. You can cover more ground, but you might miss something rare, like a giraffe.
  • Sketches: This is the revolutionary approach! Sketches are compact data structures that summarize large streams of data. Think of them as intelligent summaries. For example, a Bloom filter can tell you with high probability if you saw a particular animal. Other sketches can tell you how many times you saw an animal or even the top animals you encountered.

These sketches are approximate summaries, but they can be configured to answer queries with remarkable accuracy while consuming orders of magnitude fewer resources than storing all raw data.

Applying Sketches to Metrics Observability 🛠️

The same principles behind animal sketches can be applied to your metrics. Instead of animals, think of CPU usage metrics annotated with labels like host and services. ASAPQuery uses purpose-built sketches to answer common PromQL queries, such as:

  • “What’s the average CPU usage across services?”
  • “What is the P90 CPU usage across hosts?”

ASAPQuery bridges the gap between these powerful, lower-level algorithmic primitives and the practical needs of modern observability. The result? Faster dashboards, lower CPU and memory costs, and ultimately, reduced infrastructure spend. 💰

ASAPQuery Architecture: A Closer Look 🏗️

Here’s a high-level overview of how ASAPQuery fits into your stack:

  1. asap-planner (The Brains 🧠): This module analyzes the queries coming from Grafana. It looks at aggregation patterns, query frequency, labels, and time ranges to create a query plan. This plan maps high-level PromQL queries down to specific sketches.
  2. asap-sketch-ingest (Ingest Time Magic ✨): When Prometheus scrapes metrics and performs a remote_write to ASAPQuery, this module computes sketches in a streaming manner at ingest time. This happens before any queries even hit Prometheus, ensuring data is ready.
  3. query-engine (The Interceptor 📡): This module sits between Grafana and Prometheus. It intercepts incoming queries from Grafana. Using the pre-computed sketches, it delivers answers instantly. If a query can’t be answered by sketches (for now), it intelligently forwards the query to Prometheus, which still holds all the raw data, and then sends the result back to Grafana.

See it in Action: The ASAPQuery Demo 🎬

Milind showcased a compelling demo that puts ASAPQuery head-to-head with a traditional Prometheus setup. The results are striking:

  • ASAPQuery loads dashboards almost instantly.
  • Prometheus takes several seconds to load the same dashboard.

This difference is consistent across all queries and dashboard refreshes. The best part? No changes to your existing dashboards or queries are required.

Get Started with ASAPQuery Today! 🌐

ASAPQuery is open-source and available on GitHub! You can try out the quickstart guide with a simple docker-compose up command. The team is actively working on making it even easier to integrate without manual configuration. They’re also planning blog posts diving deeper into sketches and ASAPQuery’s internals.

Ready to banish dashboard lag forever?

  • GitHub: [Link to ASAPQuery GitHub Repository]
  • Website: [Link to ASAPQuery Website]

Have questions, thoughts, or feedback? Reach out to Milind at the conference, via email, or on LinkedIn. Let’s make our observability faster and cheaper, together! 👨‍💻

Appendix