Introduction
After 70 days of building a solid monitoring foundation with Prometheus and Grafana, it's time to work faster. Grafana tips and tricks: real-world lessons and examples will help you stop clicking through dashboards and start extracting insights in seconds. We've learned that the tools matter less than how we use them, and this article shares the patterns our teams have refined across production systems handling millions of events daily.
Explore for ad-hoc queries
The Explore view is Grafana's hidden productivity weapon. Instead of editing a dashboard panel every time you need to investigate an anomaly, Explore lets you write and test queries in isolation, then decide whether to add them to a dashboard later. This separation of concerns saves enormous time during incident response.
Here's a real scenario: it's 3 AM, your payment service is showing elevated latency, and you need to correlate response times with database connection pool usage. Opening Explore, you can quickly stack two queries side by side:
Query A: histogram_quantile(0.95, rate(http_request_duration_seconds_bucket{service="payments"}[5m]))
Query B: mysql_global_status_threads_connectedYou can see both metrics on the same timeline without modifying your existing dashboard. Once you've confirmed the correlation, you can save this view as a dashboard or share the URL with your team. The key advantage: you never lose context. You're not switching between panels, clicking edit buttons, or accidentally breaking something in production.
In Explore, use the Query Inspector to see exactly what Prometheus received, including your label matchers and any transformations Grafana applied. This is invaluable when queries behave unexpectedly. You can also switch between visualization types—graph, table, logs, traces—without leaving the view, which is critical when debugging multi-signal issues.
Transformations to join data
Most teams running multiple services find themselves needing to correlate metrics from different sources. A typical case: you want to show deployment timestamps overlaid on a performance graph, or match application logs with infrastructure metrics using a shared label.
Grafana's transformation engine handles this elegantly. Instead of writing complex Prometheus queries (which PromQL doesn't always support), you can fetch multiple series and join them in Grafana's data layer.
Example: you're tracking request duration by endpoint, and you want to overlay SLA targets that live in a separate data source. Your dashboard has two queries:
Query 1 (Prometheus):
rate(http_requests_duration_seconds_sum{service="api"}[5m]) / rate(http_requests_duration_seconds_count{service="api"}[5m])
Query 2 (PostgreSQL):
SELECT endpoint, sla_target_ms FROM sla_policiesWithout transformations, these two datasets are unrelated on your panel. With transformations, you can:
- Rename the Prometheus metric to
durationand ensure your label includesendpoint - Add a Merge transformation to combine both queries by
endpoint - Add a Math transformation to calculate
duration - sla_target_msand highlight where you're breaching SLA
This approach keeps your queries simple and your transformation logic auditable. When an engineer reviews your dashboard three months later, they can see exactly how data flows from source to visualization.
Another powerful pattern: use the Group by transformation to pivot data. If you're collecting metrics for multiple deployment regions and want to show them as separate columns instead of separate series, Group by gives you a table layout that's often easier to scan than overlapping lines on a graph.
Library panels for reuse
Once you've built a useful panel—say, a well-tuned query showing 99th percentile latency with the right colors and thresholds—you'll want to use it across multiple dashboards. Copy-paste works, but it breaks the connection: when you improve the panel, all the copies stay outdated.
Library panels solve this. Create a panel once, mark it as a library panel, and link it from any dashboard. When you update the library panel, all linked instances update automatically.
To create a library panel in Grafana:
- Build and test your panel on any dashboard
- Click the panel menu (top right) and select Create library panel
- Give it a meaningful name:
SLA: P99 API Latency by Endpoint, not justLatency - Select or create a folder to organize your library (critical for teams with 50+ shared panels)
In practice, we maintain a Shared Library folder with panels for every common pattern: error rates, throughput, resource utilization, and queue depths. New dashboards use these library panels as building blocks, which means:
- Consistency across the organization: every team's latency panel looks the same and uses the same thresholds
- Faster dashboard creation: drag a library panel instead of writing a query from scratch
- Lower maintenance: fix a query in the library panel once, and it's fixed everywhere
- Clear audit trail: library panel versions are tracked, so you can see what changed and when
One caveat: library panels are shared, so be intentional about ownership. A library panel tied to a specific service should live in a folder scoped to that team, not a global shared space. Shared libraries work best when there's clear governance about what goes in them.
Keyboard shortcuts
After 70 days of monitoring, you'll spend a lot of time in Grafana. Keyboard shortcuts are the difference between productive and exhausted. Our teams rely on a handful of shortcuts daily:
- Ctrl+K (Cmd+K on Mac): Open the command palette. Type "dashboard" to jump to any dashboard, or "new panel" to add a panel without clicking. This is a game-changer for large Grafana instances.
- D-L: Toggle graph legend on/off. Saves screen real estate when you're comparing many series and don't need labels visible.
- D-S: Open dashboard settings. Useful for adjusting refresh rates or time zones without clicking menus.
- D-R: Open the dashboard's refresh rate selector, so you can quickly switch between 10s and 1m polling without navigating settings.
- Ctrl+Shift+P (Cmd+Shift+P on Mac): Toggle all panels between edit and view mode at once. Saves clicks when you're tuning multiple panels.
- T-Z: Zoom in on a time range. Click and drag on a graph, then press T-Z to focus on that period. Press Escape to undo.
A pro tip: when investigating an incident with your team, share your screen and use keyboard shortcuts. It signals experience and keeps the pace fast, which matters when you're under pressure. We've also found that newer engineers learn to use Grafana much faster when they see shortcuts in action.
To see the full shortcut list, press ? on any Grafana page. Bookmark the ones that match your workflow. Your hands will thank you.
Common mistakes
Overcomplicating transformations: Teams sometimes string 5+ transformations together to avoid writing a proper query. If your transformation pipeline is complex, step back and consider whether your data source query should handle more of the work. Transformations shine for joining disparate sources, not for hiding weak queries.
Forgetting to name library panels clearly: A library panel called Panel 1 is useless when you're looking for it six months later. Invest 30 seconds in a descriptive name that includes the metric, threshold, or service context.
Exploring without saving: It's tempting to poke around in Explore and move on. But if you've found a useful query, save it to a dashboard or as an alert rule. Otherwise, you'll re-discover the same insights repeatedly.
Ignoring the Query Inspector: When a query returns unexpected results, many engineers assume the problem is in their PromQL. The Query Inspector shows you exactly what hit Prometheus, including time range, step interval, and label values. This saves hours of debugging.
Key takeaways
- Use Explore for ad-hoc queries during incidents; it keeps your dashboards clean and lets you iterate quickly without side effects.
- Transformations join data across sources elegantly; use them to correlate metrics, logs, and SLA targets on a single panel.
- Library panels scale your monitoring culture; one well-built panel can standardize thresholds across your entire organization.
- Keyboard shortcuts compound over time; learn five of them this week and you'll save hours per month.
- Name everything clearly: dashboards, panels, library panels, and alert rules. Your future self and your team will benefit immensely.
- Transformations and library panels require discipline; document ownership and govern shared resources to avoid chaos as Grafana grows.






Comments
Loading comments…