What is Grafana
Grafana
is a visualization panel (Dashboard) with very beautiful charts and layout displays, a full-featured metrics dashboard and a graphical editor. Support Graphite, zabbix, InfluxDB, Prometheus and OpenTSDB as data sources.
Grafana main features:
- Flexible and rich graphical options;
- Multiple styles can be mixed; support day and night mode;
- Multiple data sources.
Grafana installation
(1) Download mirror
docker pull grafana/grafana
(2) Create a container
docker run ‐d ‐p 3001:3000 ‐e INFLUXDB_HOST=influxsrv ‐e INFLUXDB_PORT=8086 ‐e INFLUXDB_NAME=cadvisor ‐e INFLUXDB_USER=cadvisor ‐e INFLUXDB_PASS=cadvisor ‐‐link influxsrv:influxsrv ‐‐name grafana grafana/grafana
(3) Access
http://192.168.184.144:3001
Username and password are both admin
Use of Grafana
1 Add data source
(1) Click Settings, DataSource
(2) Click to add data source
(3) Name the data source, specify the type, address, and connected database name, user name and password and
click Save. Data source created successfully
2 Add Dashboard
(1) Select Dashboards --Manager
(2) Click the "Add" button
(3) Click the Graph icon
(4) The following chart interface appears, click Panel Title and select Edit
(5) Define basic information such as the title
(6) Set the query information to memory and specify the container name
(7) Specify the unit of the y-axis as M
(8) Save
Fill in the name
3 Alert notification settings
(1) Select the menu alerting–> Notification channels
(2) Click the Add channel button
(3) Fill in the name, select the type as webhook, and fill in the hook address
This hook address is the address of the previous expansion of the base microservice
(4) Click the SendTest test to observe whether the basic microservice adds a container
(5) Click save to save
(6) Add the shrink address in the same way
4 Dashboard warning settings
(1) Open the dashboard just edited again
(2) Click Create Alert
Set warning line
(3) Select notification
save Changes