> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Single Value Panels Stat Gauge Bar Gauge

> Explains stat, gauge, and bar gauge single-value Grafana panels for quick status, use cases, Prometheus queries, threshold configuration, and dashboard layout best practices.

Time-series panels are excellent for exploring trends, but many dashboard consumers want a clear, immediate answer: is the system healthy or not? Single-value panels surface one prominent metric (for example, request rate, pod count, P95 latency, error rate) and use size, color, and layout to communicate status instantly. These panels are ideal when the primary question is binary or threshold-driven: "Is this within acceptable bounds?"

Use single-value panels to communicate straightforward, high-visibility metrics that don’t require trend analysis. Keep the number large, the color rules simple, and the units explicit.

## At a glance: what each panel type does

* Stat panels
  * Present one main value very prominently (or a small set of values).
  * Support color thresholds so the number turns red/yellow/green based on configured limits.
  * Can show a faint sparkline for micro-context while keeping focus on the main value.
  * Offer value mappings, unit formatting, and decimal precision for readability.

* Gauge panels
  * Render a value relative to a configurable range (think speedometer).
  * Useful for visualizing proximity to an SLO, quota, or capacity limit.
  * Support threshold bands and range min/max.

* Bar gauge panels
  * Use bars (horizontal or vertical) to compare the same metric across multiple entities.
  * Good for comparing pod readiness, disk usage across nodes, or percent capacity across clusters.
  * Support per-series coloring and threshold bands.

Sparklines are optional; they provide quick context (for example, “this metric has been flat for 10 minutes”) but do not replace the deeper exploration provided by time-series panels.

## When to use each type

| Panel Type | Best for | Example |
| - | - | - |
| Stat | A single most-important value where color is sufficient for status | `current request rate`, `P95 latency` |
| Gauge | A value relative to an expected range or an SLO | `error rate vs. SLO target` |
| Bar gauge | Comparing the same metric across entities | `pod readiness across deployments`, `disk usage across nodes` |

## Practical examples

* Stat panel: show current request rate or P95 latency. Use color rules so green = healthy, red = investigate.
* Gauge: display error rate as a percentage of the SLO target so you can see how close you are to violation.
* Bar gauge: compare pod readiness percentages across deployments to quickly spot outliers.

### Prometheus + Grafana examples

PromQL examples you can drop into a Grafana stat or gauge panel:

* P95 latency (request duration):

```promql theme={null}
histogram_quantile(0.95, sum(rate(http_request_duration_seconds_bucket[5m])) by (le))
```

* Error rate (5m window):

```promql theme={null}
sum(rate(http_requests_total{status=~"5.."}[5m])) / sum(rate(http_requests_total[5m]))
```

* Pod readiness percent (per deployment):

```promql theme={null}
sum(kube_pod_status_ready{condition="true"}) by (deployment) 
/ sum(kube_pod_status_ready) by (deployment) * 100
```

Example Grafana threshold configuration (minimal JSON snippet):

```json theme={null}
{
  "fieldConfig": {
    "defaults": {
      "thresholds": {
        "mode": "absolute",
        "steps": [
          { "color": "green", "value": null },
          { "color": "orange", "value": 70 },
          { "color": "red", "value": 90 }
        ]
      }
    }
  }
}
```

Wrap similar settings in the Grafana UI under the panel's Field → Thresholds section.

## Best practices

* Map thresholds to meaningful operational states — use SLOs, capacity limits, or known performance breakpoints as the basis for color bands.
* Format units and precision for readability (e.g., `%`, `ms`, `req/s`), especially for wall-mounted displays or executive dashboards.
* Use sparklines sparingly—only where they add immediate micro-context without distracting from the main value.
* For multi-entity comparisons, prefer bar gauges (human eyes are better at comparing bars than arc angles).
* Keep labeling clear: include the metric name, the exact unit, and a short description if space allows.

Tip: Put single-value panels in a summary row at the top of the dashboard. Use stat panels for rates and latency, gauges for SLO-relative values, and bar gauges for comparisons across entities.

## Quick dashboard layout suggestion

1. Summary row (top)
   * Stat: current request rate
   * Stat: P95 latency
   * Gauge: error rate vs. SLO
   * Bar gauge: pod readiness / capacity by deployment
2. Exploratory rows
   * Full time-series panels for each metric shown in the summary row
   * Logs and traces linked from each panel for fast drill-down

## Links and references

* [Grafana documentation — Stat panel](https://grafana.com/docs/grafana/latest/panels/visualizations/stat-panel/)
* [Grafana documentation — Gauge and Bar Gauge](https://grafana.com/docs/grafana/latest/panels/visualizations/gauge-panel/)
* [Prometheus — Querying Prometheus](https://prometheus.io/docs/prometheus/latest/querying/basics/)
* [SRE and SLOs — Google SRE Book](https://sre.google/sre-book/service-level-objectives/)

Use these patterns to make dashboards that are both glanceable and actionable: big, clear numbers for quick decisions, and deeper time-series panels for investigation when needed.

> [card] [Watch Video](https://learn.kodekloud.com/user/courses/grafana-prometheus-for-metrics-driven-observability/module/38f09b30-873f-4fee-aef2-95161646dfdc/lesson/d4d3ac71-d711-4c25-aee3-7ec68921e1bf)

> [card] [Practice Lab](https://learn.kodekloud.com/user/courses/grafana-prometheus-for-metrics-driven-observability/module/38f09b30-873f-4fee-aef2-95161646dfdc/lesson/8a160433-b78c-412f-ba0c-64db613887ec)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.