[Monitoring system] Introduction to the visualization tool Grafana and actual combat of containerized deployment

1. What is Grafana

Official website address: https://grafana.com/

Grafana is an open source data visualization tool developed in Go language, which can do data monitoring and statistics, and has an alarm function. Support fast and flexible client-side charts, panel plug-ins have many different ways of visual indicators and logs, and the official library has a wealth of dashboard plug-ins.

Wide range of data sources: Graphite, InfluxDB, OpenTSDB, Prometheus, Elasticsearch, CloudWatch and KairosDB, etc.

  • Supports mixing data sources, mixing different data sources in the same graph, specifying data sources per query, even for custom data sources.

Alarm: Supports visually defining alarm rules for the most important indicators, and Grafana will continuously calculate and send notifications to issue alarms when the data reaches the threshold.

Filters: Filters allow the dynamic creation of new key/value filters that will automatically be applied to all queries using that data source.

In the entire monitoring system, the Exporter data producer collects the data that needs to be monitored. Prometheus Prometheus time series database, used to store and query monitoring data, pulled from Exporter. Grafana visualizer dashboard.

insert image description here

2. Features of Grafana

  • Grafana has fast and flexible client-side charts, panel plugins have many different ways of visual indicators and logs, and the official library has a wealth of dashboard plugins, such as heat maps, line charts, charts and other display methods, allowing us to complex data The display is beautiful and elegant.
  • Grafana supports many different storage backends for time series data (data sources). Each data source has a specific query editor. The following data sources are officially supported: Graphite, influxdb, opensdb, prometheus, elasticsearch, cloudwatch. The query language and capabilities of each data source differ significantly. You can combine data from multiple data sources into one dashboard, but each panel is bound to a specific data source belonging to a specific organization
  • Alerts in Grafana allow you to attach rules to dashboard panels. When saving a dashboard, Gravana extracts alert rules into a separate alert rules store and schedules them for evaluation. The alarm message can also be pushed to the mobile terminal through DingTalk, email, etc. But currently grafana only supports the alarm of the graph panel.
  • Grafana annotates graphs with rich events from different data sources, and hovering over an event reveals full event metadata and tags;
  • Grafana uses ad-hoc filters to allow dynamic creation of new key/value filters that are automatically applied to all queries using that data source.

3.Docker containerized deployment of Grafana

 docker run -d -p 3000:3000 --name=grafana grafana/grafana:8.1.5

insert image description here

The browser accesses http://IP+3000 to access the login page. The default username is admin and the password is admin.

insert image description hereinsert image description here

This is the page where grafana just came in.

insert image description here

OK, let's configure the data source and specify the prometheus address.

insert image description here

insert image description here
insert image description here
insert image description here

4. Grafana common menu and dashboard configuration practice

(1) Users and Organizations

  • user
    • Users in Grafana have three roles: admin, editor, and viewer.
    • admin has the highest authority and can perform any operations, including creating users and adding Datasource and DashBoard.
    • The editor role cannot create users, cannot add Datasources, and can create DashBoards.
    • The viewer role can only view DashBoard.
  • organize
    • Each user can have multiple Organizations, and users can switch between different Organizations after logging in.
    • Different Organizations are completely different, including datasource, dashboard, etc.
    • Creating an Organization is equivalent to opening a brand new view, and all datasources, dashboards, etc. must be created again.

insert image description here

(2) Data Source (DataSource)

  • Grafana supports a variety of different time series database data sources, provides different query methods for each data source, and can well support the characteristics of each data source
  • Can combine data from multiple data sources into a single dashboard

insert image description here

(3) Dashboard

  • The most important UI interface dashboard, through the data source to define the source of visualized data, Dashboard to organize and manage data visualization charts

  • A dashboard can be viewed as a collection of one or more panels to display various panels.

  • Panel One of the most basic visual units in a Dashboard is a Panel (Panel)

  • Add the query data source and data query method for each Panel through the Panel's Query Editor (Query Editor), each Panel is independent

insert image description here

5. Dashboard configuration steps

(1) Step 1: Create a dashboard

insert image description here

(2) Step 2: Create a panel panel

insert image description here

(3) Step 3: Configure data itemsjvm_memory_used_bytes

insert image description here

OK, the introduction of Grafana and the installation and configuration are done here, and it’s time to pay attention to it!
insert image description here

Guess you like

Origin blog.csdn.net/weixin_47533244/article/details/131948396