← Back to cheat sheets

Monitoring & Observability

Grafana cheat sheet

Grafana visualizes metrics, logs, and traces through dashboards.

On this page

Table of contents

Use this page for fast recall. Use Full documentation when you want the complete end-to-end path.

Quick workflow

A simple 5-step flow you can follow when using Grafana in real work.

1) Setup

Install/run the tool and confirm version. Create a minimal config.

2) Small change

Do one small action end-to-end to prove the workflow.

3) Validate

Check output, logs, and status. Catch mistakes early.

4) Automate

Convert it into a repeatable script or pipeline step.

5) Productionize

Add safety: secrets, rollback, observability, and docs.

Workflows you will actually reuse

These are practical sequences you can copy into your own checklist or runbook.

Build a useful dashboard

Goal: Make dashboards that answer real operational questions.

- Start with golden signals (latency, errors, traffic, saturation).

- Add one panel per question; keep it simple and consistent.

- Use variables for env/service; avoid heavy queries per panel.

- Create an alert only after you can interpret the graph.

- Attach a runbook link and verify alert routing.

Key Concepts

- Data sources

- Panels

- Alerts

Learning path (high-level):

- Dashboard basics

- Alerting

- Cross-signal analysis

Quick Start

Run Grafana

Command

docker run -p 3001:3000 grafana/grafana

Login admin/admin

Add Prometheus data source

Common Commands

Short descriptions and practical intent. Search, filter, copy, and reuse.

Showing 7

Ops
docker logs <grafana-container>

Inspect Grafana server logs.

Ops
curl http://localhost:3001/api/health

Check Grafana health endpoint.

Plugins
grafana-cli plugins list-remote

List available Grafana plugins.

Plugins
grafana-cli plugins install <plugin-id>

Install plugin (self-managed).

API
curl -H 'Authorization: Bearer <token>' http://localhost:3001/api/datasources

List data sources via API.

API
curl -H 'Authorization: Bearer <token>' http://localhost:3001/api/search

List dashboards via API.

API
curl -H 'Authorization: Bearer <token>' http://localhost:3001/api/alerts

List alerts via API.

Copyable snippets

Small blocks you can drop into your terminal, config, or runbook.

Health check (API)

bash

curl -fsS http://localhost:3001/api/health | jq .

Troubleshooting checklist

When things break, follow this order to stay calm and move fast.

- If panels are blank: verify datasource, time range, and query syntax.

- If Grafana is slow: reduce panel query complexity and refresh rate.

Pitfalls

The common mistakes that slow people down when using Grafana.

- Copy-pasting commands without understanding inputs/outputs and side effects.

- Not documenting defaults (ports, paths, credentials) and then getting stuck in prod.

- Skipping logs and metrics when troubleshooting; always collect evidence first.

Mini lab (practice)

Do these tasks in order. You will feel the tool instead of just reading about it.

- Install or run the tool locally (or in Docker) and verify it works with a hello-world action.

- Create a minimal config and run the most common command 3 times (with a small change each time).

- Break something on purpose and document how you debugged it in your Notes.

Interview prompts

Use these to test if you truly understand the basics (and can explain them clearly).

- Explain the tool’s role in a real CI/CD pipeline from commit to production.

- Describe the most common failure you’ve seen with this tool and how you fixed it.

- What would you monitor/alert on for this tool in production?

Official Docs

https://grafana.com/docs/