Grafana transformations for joining and reshaping query results

Grafana transformations reshape query results inside a panel, in list order, before the visualization is applied. This page explains which work belongs in a transformation, which belongs in the query or a recording rule, and how to set it up on a self-hosted instance.

On this page

Grafana transformations: when a panel needs data reshaped before it renders

A transformation manipulates the data a query returns before the visualization is applied. According to the Grafana transformations docs, transformations run in list order, and each one passes its result set to the next. That chaining is what makes them useful and also what makes them easy to misuse. Teams usually reach for them when a panel needs two queries shown side by side, a calculated column that the data source cannot produce, or a per-host summary built from rows that arrive one series at a time. Typical examples are joining a CPU query and a memory query by the host label, adding a field that divides used bytes by total bytes, or reducing a time series to its last value per host for a table. Each of these is a reasonable use, provided the dashboard owner knows which step produced which column.

Transformations are the wrong place for work that is expensive, repeated across many dashboards or needed by alerts. They run in the browser after the data has already been fetched, so a join over a long time range can move far more rows than the panel displays. If the same reduction appears on five dashboards, the logic belongs in the query, a recording rule or a view in the data source, where one definition serves every consumer. Alert rules do not run the visualization transformations at all, so a threshold built on a transformed column may not match what the dashboard shows. Before you build a complex chain, confirm which data source you are querying, how much data a typical time range returns, and whether an alert depends on the same numbers. Ask your Grafana team to document the order of steps on each shared panel so that a change to an early step does not silently break a later one.

Which transformation fits which reshaping job

This table matches each documented transformation to the reshaping job it handles, the input shape it expects, and the sign that a query or recording rule would do the work better. Read it as a checklist before adding a transformation to a panel that many users open.

TransformationJob it fitsInput shape it expectsSign a query or recording rule would serve better
Join by fieldCombine two or more result sets on a shared key such as host name or service IDMultiple frames or tables that each contain the join field with matching valuesThe join runs on every refresh over large series counts, or the same join appears in several panels
Group byAggregate rows by one or more fields, such as totals per team or per regionA table or frame with the grouping field and a numeric field to aggregateThe data source can group natively, or the grouped result is needed by alerts and not only by one panel
ReduceCollapse a series or table to summary values like last, max or mean for stat and gauge panelsTime series or rows with at least one numeric fieldA summary is needed in alert rules or in several dashboards, where a recording rule keeps the value consistent
Organize fields by nameRename, hide, reorder or remove columns for display in a tableA table with the fields to be shown or renamedDisplay changes are the only goal, which is usually cheap and fits a transformation well
Add field from calculationCompute a new column from existing numeric fields, such as a ratio or unit conversionNumeric fields with matching row alignment or time stampsThe calculation is needed as a stored metric for alerting or long-range history, not just one view
Merge series or tablesStack several series or tables into one table for side-by-side inspectionMultiple frames with compatible field names or the same time baseMerged output grows large, or the merge hides differences in labels that an alert should respect
Filter data by valuesDrop rows that match or miss conditions after the query returnsAny tabular or frame data with a value field to testThe filter removes most rows, so the query should return less data in the first place

When to move the work into the query or a recording rule

A transformation runs in the browser after the data has already left the data source, so it cannot reduce what the source has to scan or return. The cards below mark the points where a shared dashboard should stop reshaping results in the panel and move that logic into the query, a recording rule or a stored definition instead.

Large or high-cardinality result sets

If a query returns thousands of series or rows and a group by or reduce transformation then collapses them, the data source has already done the expensive part. Move the aggregation into the query itself, using the source's own grouping, so that only the summarized result is returned to Grafana. Before you change it, run the original and the aggregated query against your own data source and compare response size and load. Do not assume the savings without measuring them.

Values reused across many dashboards

When the same join, calculated field or filter is copied into dozens of panels, every copy drifts over time and each edit has to be repeated by hand. A value that many dashboards depend on belongs in the query, a shared recording rule or a data source definition that they all read. Check who owns that definition and how changes are reviewed before you move it.

Calculations that alerting also needs

A transformation only exists in the panel, so an alert rule that depends on the same ratio or derived value will not see it. If an alert and a dashboard disagree, the on-call engineer is left to work out which number is right. Put any calculation that drives a notification into the alert query or a recording rule, then point the dashboard at the same output.

Logic that hides from reviewers

A chain of transformations can change a result in ways that someone reading the panel's query editor will not see. Filters on values, renamed fields and merged frames are easy to miss during review. When the logic determines what a team relies on for decisions, keep it in a query or rule that can be read, versioned and tested, and document the remaining panel steps where they are used.

Work that depends on the query shape

Some joins and filters only make sense when the query returns a particular shape, such as one frame per series or a time-aligned table. Transformations can compensate for a shape that does not fit, but the fix is often a query change that the data source can run more efficiently. Test the query shape with a representative time range and a realistic number of series in your own environment.

Results that must stay consistent

Transformations run each time the panel renders, so the output can vary with the time range, the variables selected and the panel's options. Where a figure goes into a report, a ticket or a decision, a recording rule that is computed on a schedule gives every reader the same value. Confirm the refresh interval and retention you need for that figure before you decide where the calculation lives.

Set up a transformation chain on a self-hosted Grafana panel

This sequence builds a transformation chain on one panel so that a query's raw results become a table shaped for the visualization. Each step ends with a check in the panel editor, so a reviewer can see what every transformation did before the dashboard is saved and shared.

  1. Open the panel editor on the target dashboard

    Open the dashboard in your self-hosted Grafana instance with an account that has Editor rights on the folder holding it, then choose Edit on the panel you want to change. Confirm you are in the panel editor, not the dashboard view, by checking that the query, visualization and transformations tabs are visible at the bottom of the screen. If the edit controls are missing, check your role and folder permissions before continuing.

  2. Add the queries that feed the chain

    Select the data source and write the queries for the panel, giving each query a clear name so it is easy to recognize in the join and filter options later. Run the queries and confirm the raw results appear in the table view. Note the field names and types each query returns, because the join, group and calculation steps depend on them.

  3. Add transformations in the order they must run

    Open the Transformations tab and add transformations one at a time, starting with the step that changes the data shape first, such as joining queries by field. Transformations run in list order and each one passes its output to the next, so place filters before reductions when you want fewer rows to be processed. Move a transformation up or down in the list to change the order.

  4. Check each step output in the table view

    After adding each transformation, switch the panel preview to table view and compare the output with what you expected, looking at row counts, field names and values. A join that drops unmatched rows or a group-by that merges the wrong keys is easier to fix at this point than after several more steps. Only continue to the next transformation when the output of the current one is correct.

  5. Rename and reorder fields with organize fields

    Add the organize fields by name transformation last, or after the calculations, to hide intermediate fields, rename the remaining ones and set their order for the visualization. Confirm in the table view that the column headers match the labels your readers will see and that no field needed for a calculation has been hidden. Check the visualization itself, since its display options may still apply their own names and units.

  6. Save the dashboard and confirm the panel renders

    Save the dashboard and reload it as a viewer would, confirming the panel shows the same table and chart you checked in the editor. Record the dashboard version or save message so the change can be traced. Ask the team who owns the dashboard to confirm the result before it is used for operational decisions.

  7. Export the dashboard JSON into version control

    Dashboards that rely on transformations are hard to review from the UI alone, so export the dashboard JSON and store it in a Git repository your team controls, or move it into file-based provisioning. Grafana's provisioning docs describe how dashboards can be loaded from files at startup. Confirm that the exported file contains the transformation list in the expected order, and that any data source identifiers are set for your environment.

How the approach differs by data source and team

When many panels on a dashboard display different views of the same query result, it is tempting to repeat the same transformation chain on each panel. Transformations run per panel, so the reshaping logic is duplicated and every copy must be edited when the query changes. A shared query with panel-level transformations keeps the data fetch single, but the transformation chain still has to be rebuilt wherever it is needed.

  • Duplicated chains: Copying a join, filter or organize step to ten panels creates ten places to fix when a field is renamed.
  • Query load: Panels that each run their own query multiply calls to the data source. Check whether the data source supports query reuse before relying on it.
  • Filter placement: A filter transformation hides rows only in that panel, so a value that should be excluded everywhere belongs in the query.
  • Review effort: Transformation chains are stored in dashboard JSON, which makes reviewing differences between copies slow.
  • Recording rules: If many panels aggregate the same series the same way, a recording rule or a query-level aggregation moves that work out of the browser.

Before you standardize, list which panels share a result shape and confirm with your data source team which computation they should own.

Security and operational considerations for shared dashboards

Transformations run in the browser on data a query has already returned, so they shape what viewers see but do not change who can read the source. The four cards below cover the places where a shared Grafana instance can expose data, drift from intent or break after an upgrade.

Intermediate results reach viewers

Every transformation step works on data the viewer can inspect. Using the panel inspection view, a viewer can often see the raw query response and the output of each step, including columns you dropped with organize fields or filtered out with filter data by values. If a dropped column holds customer identifiers, salaries or tokens, removing it from the chart does not remove it from the browser. Check the query itself first, and only return the fields the audience needs.

Data source permissions still apply

Transformations cannot widen access. A query runs under the data source credentials and permissions configured in Grafana, so a viewer who cannot read a table will not see it through a join, even if the panel was built by someone who could. Confirm which service account or credential each data source uses, and whether the instance separates them by team. Open-source Grafana handles these boundaries differently from Enterprise, so confirm the model with your admin before relying on it.

Review changes to shared dashboards

A transformation chain is logic, and a small edit such as changing a join field or a reducer can silently change a total on a dashboard that finance or operations reads daily. In a shared instance, decide who may edit production dashboards, keep a record of changes, and define a review step for panels that feed decisions. Provisioning dashboards from version-controlled files gives you that review path. Confirm what your edition and setup record in dashboard version history.

Test transformations after upgrades

Transformation behavior can change between Grafana releases, including how joins handle missing timestamps, how reducers treat nulls and how field names are generated. Compare key panels on a staging copy of the instance before promoting a new minor or major version. Keep a list of the panels that carry business-critical totals, and compare their output against values you already trust before and after the upgrade.

Questions teams ask before reshaping data in Grafana

Do transformations cost less effort than changing the query?

Usually transformations are the cheaper change to make first, because they are edited in the panel and need no change to the data source. The effort still depends on what you are reshaping. A few joins and renames on one panel are a short task for an experienced Grafana editor. Moving logic into the query or a recording rule means changing the query language, testing it against the source, and sometimes agreeing a change with the team that owns that data. Ask any partner to price the two options separately, with the number of panels, data sources and owners involved in each.

How long does a typical dashboard rework take?

The duration is set by a handful of drivers, not by a standard figure. The main ones are the number of panels that share logic, how many data sources are joined, whether the source schema is documented, and how many people must approve the new view. Dashboards built on clean, consistently labeled series take far less time than those that depend on fragile field names or manual exports. Ask for a written scope that lists each dashboard, its data sources and the acceptance checks, because that list is what determines the timeline.

What does our team need to provide before reshaping data?

Expect to provide read access to each data source in a non-production environment, a representative sample of the query results (including edge cases such as missing values and renamed labels), and a named owner for each dashboard and data source. Owners decide which numbers are authoritative and which views people rely on, so their time is often the real constraint. If access to production data is restricted, confirm early whether sanitized samples are acceptable for building and testing.

Can our own team do this without a partner?

Yes, if at least one person knows Grafana panels, the query language of your data source and how your data is labeled. Transformations are visible in the panel editor, so a motivated editor can learn them with the official documentation. Teams usually struggle with the parts that are not visual: keeping shared logic consistent across many dashboards, deciding which work belongs in a recording rule, and testing changes so a dashboard does not silently show wrong totals after an upstream change. Assess those skills honestly before you decide.

What goes wrong when transformations are overused?

The most common problem is a dashboard that depends on the order of transformations and the shape of the data at one point in time. A join that works today can produce empty or duplicated rows after a label changes or a new series appears. Heavy transformations also run in the browser for every viewer, which can slow large dashboards. Pushing aggregation into the query or a recording rule keeps the logic in one place, makes it reusable for alerts, and reduces the data sent to each browser.

When should we bring in a partner for this work?

Bring in a partner when the reshaping affects several teams, many dashboards or alerts, or data that carries compliance or access obligations. A partner is also useful when you want the logic moved into queries, recording rules or provisioned dashboards, because that work needs review and a rollout plan. DeployOpen plans, implements and documents this work in infrastructure you control, usually under a written, fixed scope agreed before work starts. Ongoing changes can be covered by a retainer.

Which Grafana version should we target for this work?

Check the version you run before you design the dashboards, because transformation behavior and editor screens can change between releases. Confirm your target against the Grafana upgrade guidance and plan any change to a newer minor release as a separate task. Test the reshaped dashboards on the same version you will run in production.

How DeployOpen scopes and delivers Grafana panel and dashboard work

DeployOpen plans, builds, documents and supports Grafana transformations for joining and reshaping query results inside infrastructure you control. Each engagement starts from a written scope that decides which joins, reductions and filters stay in Grafana and which move into the data source query or a recording rule.

How we scope

  • Inventory each panel that combines queries and list the data sources, fields and join keys it depends on.
  • Record which transformations run in the panel and which work moves into the query or a recording rule.
  • Agree the scope, deliverables and timeline in writing before any dashboard work begins, as engagements are fixed-scope.

How we build

  • Build transformation chains in list order, checking the output of each step against sample results from the source.
  • Test joins and reductions with empty, partial and mismatched series so that gaps in data do not produce misleading panels.
  • Move expensive or repeated shaping into queries or recording rules where the data source can run it efficiently, and confirm load in your environment.

How we hand over

  • Document each panel's transformation sequence, its input queries and the reason each step exists.
  • Provide dashboards as code or provisioned files where your team wants them versioned, and walk your engineers through the layout.
  • Hand over a list of known limits, such as fields that change names in upstream data, so owners know what to recheck after changes.

How we support

  • Review transformation chains after Grafana upgrades or data source changes, since results can shift when field names or types change.
  • Ongoing support, upgrades and continuous testing are available as a retainer, scoped in writing like the original work.
  • Agree with your team who owns each dashboard and who approves changes to shared panels before support begins.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.