Grafana
一句话解释
Grafana 是打开-源 analytics and visualization platform 那个创建 dashboards 从多个数据源.
用大白话说
Grafana is a visualization tool that creates beautiful, interactive dashboards for your metrics and logs. It does not collect data itself — instead, it connects to data sources like Prometheus, InfluxDB, Elasticsearch, or Loki and visualizes the data.
With Grafana, you create dashboards that contain panels — graphs, gauges, tables, heatmaps, and more. Each panel runs a query against a data source (e.g., a PromQL query against Prometheus) and displays the result.
Grafana also supports alerting — you can set thresholds on your panels and get notified via Slack, email, PagerDuty, etc. It is the most popular visualization tool in the DevOps world and is often paired with Prometheus.
示例
{
"title": "CPU Usage Dashboard",
"panels": [
{
"type": "graph",
"title": "CPU Usage Over Time",
"datasource": "Prometheus",
"targets": [
{ "expr": "rate(cpu_seconds_total[5m])" }
]
}
]
}Grafana dashboard panel 那个查询 Prometheus for CPU usage 速率 over 5-minute window.
工作原理
- You connect Grafana to data sources (Prometheus, Loki, etc.).
- You create dashboards with panels that query the data sources.
- Grafana runs the queries and renders visualizations.
- You can set up alerts that fire when query results cross thresholds.
常见混淆
容易混淆的对象: Prometheus
关键区别: Grafana visualizes 数据从 多个源; Prometheus 是特定 monitoring 系统那个 collects and 存储 metrics. Grafana 经常 uses Prometheus as 数据源.
相关术语
解读错误信息
用大白话解释常见错误——什么意思、为什么发生、如何修复。