Grafana’s table panels are surprisingly capable of displaying data in a highly customized, almost application-like way, far beyond simple rows and columns.
Let’s see this in action. Imagine we have a Prometheus data source with metrics about our services’ request latency. We want to display this in a Grafana table, but we want to highlight high latencies and make the table look more like a dashboard.
Here’s a basic query in Grafana:
histogram_quantile(0.95, sum by (le, job) (rate(http_request_duration_seconds_bucket[5m])))
This query gives us the 95th percentile latency for each job. By default, Grafana will render this as a simple table with columns like job and Value.
Now, let’s make it sing.
The core of customizing Grafana tables lies in Field Overrides. These are rules you apply to specific fields (columns) in your table based on their name or type. You can find them in the "Overrides" tab of your panel editor.
Let’s say our query returns fields named job and 95th Percentile Latency.
Override 1: Make the job field a "Cell Link"
- What we want: Click on a job name and go to a dashboard specific to that job.
- How to do it:
- In the "Overrides" tab, click "Add field override".
- Select "Fields with name" and type
job. - Under "Cell options", click "Add override property".
- Choose "Cell link".
- In the "URL" field, enter:
/d/your_dashboard_id/your-dashboard-title?var-job=$__cell_1your_dashboard_idandyour-dashboard-titleshould be replaced with your actual dashboard’s ID and title.$__cell_1is a special Grafana variable that injects the value of the first field in the row (which is ourjobfield here) into the URL.
- Why it works: This tells Grafana that whenever it renders a cell in the
jobcolumn, it should make it a clickable link. The URL is dynamically constructed using the job name from that specific row.
Override 2: Color-code the 95th Percentile Latency based on its value
- What we want: Red for high latency, green for low.
- How to do it:
- Add another field override, selecting "Fields with name" and typing
95th Percentile Latency. - Under "Cell options", click "Add override property".
- Choose "Color scheme".
- Select "From thresholds" for the "Mode".
- Set your thresholds:
- Add a threshold:
0.5(seconds) - Color:Green - Add a threshold:
1.0(seconds) - Color:Orange - Add a threshold:
2.0(seconds) - Color:Red - You can also set a "Background mode" to "Graph" or "Text" to color the cell’s background or just the text. "Graph" is usually more visible.
- Add a threshold:
- Add another field override, selecting "Fields with name" and typing
- Why it works: Grafana evaluates the cell’s value against the defined thresholds. If the value is below 0.5, it’s green; between 0.5 and 1.0, it’s orange; and above 1.0, it’s red. This provides immediate visual feedback on the health of your services.
Override 3: Set a Unit for the 95th Percentile Latency
- What we want: Display the latency in seconds with appropriate formatting.
- How to do it:
- In the same override for
95th Percentile Latency, under "Value options", click "Add override property". - Choose "Unit".
- Select "Time" and then "seconds (s)".
- In the same override for
- Why it works: This ensures Grafana displays the raw numerical value (e.g.,
0.75) as750msor0.75sdepending on the unit’s precision settings, making it much more human-readable.
Override 4: Hide the job field and replace it with a "Time Series" visualization for its metric
This is where things get really interesting. You can replace a text field with a mini-graph.
- What we want: See the trend of latency for each job directly within the table.
- How to do it:
- Add a field override for
95th Percentile Latency. - Under "Value options", select "Decimals" and set it to
2. - Under "Cell options", select "Display mode" and choose "Series".
- Crucially, you need to ensure your query is returning a time series for each job. If your query only returns the current value, this won’t work directly. You’d typically need a query that returns multiple data points over time for each job. For example, instead of
histogram_quantile, you might useavg_over_time(http_request_duration_seconds_bucket[5m])and then transform it, or use a different metric. - Correction/Clarification: For the "Series" display mode, Grafana needs a time series data source. If your Prometheus query only returns a single scalar value per job (like
histogram_quantile), the "Series" display mode won’t have data to plot. You’d typically use this mode when your data source query itself returns time series data for each row you want to represent. For example, if you had a query that returnedjoband then a list of[timestamp, value]pairs for each job’s latency over time.
- Add a field override for
Let’s refine Override 4 with a more common scenario where you do have time-series data per job. If your query was structured to return multiple data points for each job (e.g., by querying rate(http_request_duration_seconds_count[1m]) for each job), you could then use overrides to plot that time series.
- Revised Override 4: Display
95th Percentile Latencyas a mini-graph.- Ensure your query for
95th Percentile Latencyreturns actual time series data for eachjob. For example, usingavg_over_timeon buckets can work, or a query that explicitly pulls historical data. - Add override for
95th Percentile Latency. - Under "Cell options", select "Display mode" and choose "Series".
- Under "Graph styles", you can configure line width, fill opacity, and color.
- Ensure your query for
- Why it works: Grafana takes the time series data associated with that
joband renders a small sparkline graph directly within the table cell. This is incredibly powerful for spotting trends at a glance.
Override 5: Set a Threshold for the job field to show an icon
- What we want: Show a warning icon next to jobs that are experiencing high error rates (assuming you have an error rate metric).
- How to do it:
- Add a field override for
job. - Under "Cell options", add "Thresholds".
- Set a threshold:
1(if your error rate is a percentage, you might set a threshold for0.05for 5% errors). - For a threshold value of
1, choose an icon likewarningoralert. You can also set colors.
- Add a field override for
- Why it works: This allows you to visually flag specific rows based on conditions applied to other fields, or even the field itself if it’s a numerical representation of a status.
The power of field overrides is that they are applied after the data has been queried and organized into fields. This means you can take raw data and transform its presentation entirely, making tables much more dynamic and informative. You can combine multiple overrides on a single field, creating complex visualisations.
The next step after mastering table panel overrides is exploring the Transformations tab in Grafana, which allows you to manipulate your data before it even hits the panel, enabling even more sophisticated table layouts and calculations.