認識 Grafana

前言

Grafana是一個跨平台、開源的資料視覺化網路應用平台。在使用者設定連接的資料來源之後,Grafana可以在網路瀏覽器裡顯示資料圖表和警告。

測試資料

下載 Grafana

官方下載連結 : https://grafana.com/grafana/download

% curl -O https://dl.grafana.com/grafana-enterprise/release/12.3.3/grafana-enterprise_12.3.3_21957728731_darwin_arm64.tar.gz

tar -zxvf grafana-enterprise_12.3.3_21957728731_darwin_arm64.tar.gz

% Total % Received % Xferd Average Speed Time Time Time Current

Dload Upload Total Spent Left Speed

100 274M 100 274M 0 0 5216k 0 0:00:53 0:00:53 --:--:-- 7237k

啟動 Grafana 服務

請進入目錄並執行以下命令:

% ./bin/grafana server

INFO 02-13\|11:11:51 Starting Grafana logger=settings version=12.3.3 commit=2a14494b2d6ab60f860d8b27603d0ccb264336f6 branch=release-12.3.3 compiled=2026-02-13T11:11:51+08:00

初始設定步驟簡要:

  1. 啟動 Grafana 後,預設登入網址為 http://localhost:3000

  2. 使用帳號 admin / admin 登入並更改密碼

新增 Data Source

進入「Configuration」新增資料來源,選擇要連接的資料庫類型(如 Prometheus、postgreSQL)

Home > Connections > Data sources > Add data source

輸入相關設定資料,測試連線

Name: 之後在 panel 選取 data source 時顯示的名稱

Host: IP:port (例 localhost:3306)

Database: 填入資料來源的資料庫名稱

User/Password: 資料庫帳號/密碼

建立Dashboard

測試連線成功後即可開始建立儀表板

Home > Dashboards

點選 「Save dashboard」

輸入相關設定資料,點選 「Save」

點選「Dashboards」

點選「資料來源」 ,這裡我們選 postgres dashboard

點選「Add visualization」

選擇資料來源

資料來源(data source),我這部分使用PostgreSQL資料庫,SQL搜尋的語法也是寫在這裡

右邊 Visualizations,選擇 panel 類型(time series, bar chart, gauge, table等等),以及 panel 的設定(title, style, mapping)都在這邊更改

儲存設定

此僅簡單介紹測試

更詳細請參看 https://grafana.com/docs/grafana-cloud/monitor-applications/frontend-observability/

相关推荐
qq_452396236 天前
第十二篇:《数据采集:Grafana Alloy、Fluent Bit、Vector 的选型与配置》
java·贪心算法·grafana
2601_962097366 天前
可观测性实战:Prometheus+Grafana+OTel构建监控
grafana·prometheus·微服务架构·可观测性·opentelemetry
Joker-Full-stack6 天前
higress Grafana生产事故复盘:Loki 2.9 WAL 竞态 Bug 导致 5 天审计日志消失
bug·grafana·higress
IT界的老黄牛6 天前
Jenkins 监控一条龙:接入、看板 9964、11 条告警规则直接抄走
jenkins·grafana·prometheus·监控·ci-cd·告警规则
heimeiyingwang7 天前
【Prometheus·可视化篇】Grafana 集成:数据源配置与 Dashboard 设计原则
grafana·prometheus
2601_962097368 天前
GraphQL,Grafana和Dash
python·grafana·数据可视化·graphql·dash
happymade10 天前
7000 台网络设备批量纳管 & 自动拓扑生成实战——MSRM3 完整操作流程与关键要点复盘
运维·服务器·网络·zabbix·grafana·msrm3
AAA@峥10 天前
从零搭建 Prometheus 完整监控告警体系|Linux 部署 + node_exporter+Grafana 可视化
云原生·grafana·prometheus
liuyicenysabel12 天前
Grafana + Prometheus 分级告警配置设计(P0/P1/P2)
javascript·grafana·prometheus
随遇而安zx12 天前
SpringCloud---可观测性与监控:Actuator / Micrometer / Prometheus / Grafana 深度解析
spring cloud·grafana·prometheus