Back to Technical Guides
Grafana & Time Series Reading time: 7 min

Data Transformations in Grafana: The Guide to On-the-Fly Calculations

Most Grafana users treat panels as passive viewers for raw database responses. Yet Grafana ships with a powerful in-memory ETL pipeline: the Transformations tab. It allows you to join disparate data sources, compute cross-query SLA ratios, and reshape columns without writing backend glue code.

1. Understanding Grafana's Internal Data Model: Data Frames

Regardless of the queried backend (Prometheus PromQL, Elasticsearch, PostgreSQL, or a REST API), Grafana normalizes every response into typed tabular structures called Data Frames (Time, Number, String columns). Transformations operate sequentially on these Data Frames right before rendering.

2. The 4 Essential Production Transformations

3. Step-by-Step Recipe: Multi-Source Executive Table (Prometheus + SQL)

To build a unified operations table blending live telemetry with business metadata:

1
Step 1 — Mixed Data Sources:
Select the -- Mixed -- data source in your panel. Configure Query A against Prometheus (Format: Table, Type: Instant) and Query B against PostgreSQL.
2
Step 2 — In-Memory Outer Join:
Add the Join by field (MODE: Outer) transformation keyed on your shared service_id label.
3
Step 3 — Field Organization & Overrides:
Add Organize fields to reorder and rename columns, then apply a Field Override to render the SLA percentage column as a color-coded Gauge cell.

When to Compute in the Data Source vs Grafana Transformations?

Heavy data reduction (aggregating millions of raw samples into an average) should always happen inside the data source (via PromQL sum/avg or Elasticsearch STATS). Use Grafana Transformations on already-aggregated results to join heterogeneous backends, compute cross-source ratios, and format executive views.

Master These Techniques in Our 2-Day Hands-On Course

This topic is practiced extensively in our Data Analysis & Monitoring with Grafana (2-Day Course). Leave with production-ready templates and query optimization workflows tailored to your stack (On-site corporate or Live Virtual Classroom).

More Technical Guides

Kibana & Elasticsearch

ES|QL vs KQL vs Lucene: Which Query Language Should You Choose for Kibana?

Comprehensive architectural comparison between Lucene, KQL, and Elasticsearch's piped vector engine ES|QL: advantages, drawbacks, structural limits, and production recommendations.

Read Guide
Kibana & Elasticsearch

Runtime Fields in Kibana: Calculating Metrics Without Reindexing

Learn how to extract unmapped fields from raw logs or compute custom business indicators at query time using Painless and Kibana Lens without reindexing terabytes of data.

Read Guide
Grafana & Time Series

5 Common PromQL Mistakes Slowing Down Your Grafana Dashboards

High cardinality explosions, unanchored regex matchers, misconfigured rate() windows, and heavy subqueries: how to audit and tune PromQL queries before they crash Prometheus.

Read Guide