Construction of Prometheus+Grafana Monitoring System for Grafana Monitoring System

The content of this article is long, you can quickly locate the content you want to see by clicking the contents in the upper right corner => =>

Summary of a.

1.1 introduce Grafana

Grafana is a cross-platform open source metric analysis and visualization tool that enables you to query and visually present collected data with timely notifications. It mainly has the following six characteristics:

  1. Display mode: fast and flexible client chart, panel plug-in has many different ways of visualization indicators and logs, the official library has rich dashboard plug-in, such as heat map, line chart, chart and other display modes;

  2. Data sources: Graphite, InfluxDB, OpenTSDB, Prometheus, Elasticsearch, CloudWatch, KairosDB, etc.

  3. Notification alerts: Visually define alert rules for the most important metrics. Grafana will continuously calculate and send notifications, and get notifications through Slack, PagerDuty, etc., when the data reaches a threshold;

  4. Mixed presentation: Mix different data sources in the same chart, you can specify data sources based on each query, or even customize data sources;

  5. Annotation: Using rich event annotation charts from different data sources, hovering over events shows the full event metadata and markup;

  6. Filters: Ad-hoc filters allow the dynamic creation of new key/value filters that are automatically applied to all queries that use the data source.

To put it simply, it is a multi-purpose monitoring tool. At the same time, it provides effective early warning and notification through email and other means. It has a rich and intuitive visual interface, and multiple data source configuration is its advantage.

1.2 Prometheus vs. Zabbix

  • Similar to Zabbix, Prometheus is a popular open source monitoring framework in recent years. Unlike Zabbix, Prometheus is relatively flexible, with decoupled modules, such as alarm modules and proxy modules, which can be configured selectively. Both the server and client are out of the box and do not need to be installed. The Zabbix is a set of installations that get everything done. It’s huge and messy.

  • Zabbix client Agent can easily read the database, log and other files in the machine through scripts to report. Prometheus’s reporting clients are OPERATED by a variety of SDKS in various languages and by a variety of exporters. For example, if you want to monitor machine health or mysql performance, a large number of sophisticated exporters are at Prometheus’s end. Through HTTP communication to provide information to the server (server to pull information); If you want to monitor your own business status, there are official or other people’s SDK for you to use for various languages, which is more convenient. There is no need to store the data in the database or log for Zabbix-Agent to collect.

  • Zabbix’s client is more of a push thing. Prometheus, on the other hand, stores monitoring data locally on the client, and the server periodically pulls the desired data.

  • In terms of interface, Zabbix is old, while Prometheus is new and very clean, so simple that it is nothing more than a testing and configuration platform. For a good monitoring experience, combining Grafana is a must for both.

1.3 Grafana structure diagram

1.4 popular speak

  • Prometheus served as an intermediate point, Grafana as a visual display, and my friend at the back would be a monitor, where my friend would be able to fetch data and connect it to Prometheus, while Prometheus connected to Grafana to visually display the monitored status.

Ii. Construction of Prometheus+Grafana Monitoring system

2.1 installation Prometheus

  • Download and unzip
    wget https:/ / github.com/prometheus/prometheus/releases/download/v2.7.2/prometheus-2.7.2.linux-amd64.tar.gz
    Copy the code
    tar xvfz prometheus-2.72..linux-amd64.tar.gz
    Copy the code
  • Run the Prometheus server
    cd prometheus-2.72..linux-amd64
    Copy the code
    ./prometheus --config.file=prometheus.yml
    Copy the code
  • Configuration Prometheus
    • There are configuration files in Prometheus.yml that we can configure, regardless of the first installation;
    $ cat prometheus.yml 
    # my global config
    global:
      scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
      evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
      # scrape_timeout is set to the global default (10s).
     
    # Alertmanager configuration
    alerting:
      alertmanagers:
      - static_configs:
        - targets:
          # - alertmanager:9093
     
    # Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
    rule_files:
      # - "first_rules.yml"
      # - "second_rules.yml"
     
    # A scrape configuration containing exactly one endpoint to scrape:
    # Here it's Prometheus itself.
    scrape_configs:
      # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
      - job_name: 'prometheus'
     
        # metrics_path defaults to '/metrics'
        # scheme defaults to 'http'.
     
        static_configs:
        - targets: ['localhost:9090']
    
    Copy the code

It can be roughly divided into four parts: – global: global configuration. Scrape_interval indicates the interval for grabbing data, and evaluation_interval indicates the interval for detecting alarm rules. – Alerting: configures the Alarm Manager. The Alertmanager is not installed. – rule_files: Specifies the alarm rules. – scrape_configs: captures monitoring information. A job_name is a target, and targets is the IP address and port for collecting information. This section monitors Prometheus itself by default. You can modify this section to modify the monitoring port of Prometheus. Each of Prometheus’s exporters is a target and can report various monitoring information, such as machine status or mysql performance, as well as various language SDKS, which can report customized business monitoring information.

  • Visit Prometheus
    • Enter “IP address “+”:9090″ to access the IP address. If a visual interface is displayed, the IP address is successfully accessed.

Example: 186.163.15.42:9090 Log in to the PC. If the access fails, check whether port 9090 is enabled on the firewall

2.2 Adding machine Status Monitoring (Monitoring server CPU, hard disk, and network status)

  • Download and unzip and run

    // To download the latest version, you can right-click the latest version in github release to get the download link
    wget https:/ / github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
    Copy the code
  • Unpack the

    tar xvfz node_exporter-0.17. 0.linux-amd64.tar.gz
    Copy the code
  • Access the decompressed directory

    cd node_exporter-0.17. 0.linux-amd64
    Copy the code
  • Run the monitoring collection service

    ./node_exporter
    Copy the code
  • Listen for port 9100

    • In this Centos access:curl http://localhost:9100/metrics
    • Computer browser access:IP address: 9100

    The access succeeds if the content is displayed

    Nohup can be used to start the service in the background. If the service is started directly as shown in the figure, the connection will be reopened

    • Go to Prometheus’s configuration file and add this exporter’s address
      • Let’s go back to the root directory
    cd ~
    Copy the code
  • Enter the Prometheus

    cd prometheus-2.72..linux-amd64/
    Copy the code
  • Edit the configuration file Prometheus. Yml

    vim prometheus.yml
    Copy the code

You can download without Vim or use VI

  • Add a target:
    scrape_configs:
      - job_name: 'prometheus'
        static_configs:
          - targets: ['localhost:9090']
      - job_name: 'server'
        static_configs:
          - targets: ['localhost:9100']
    Copy the code

2.3 installation Grafana

  • Download and unzip Grafana
    wget https:/ / dl.grafana.com/oss/release/grafana-6.0.0.linux-amd64.tar.gz
    Copy the code
    tar -zxvf grafana-6.0. 0.linux-amd64.tar.gz
    Copy the code

The installation commands of the latest version are displayed on this page. In the upper right corner, you can switch to the installation commands of other versions. After decompression, the grafana-6.0.0 directory appears, go to that directory, and you can run grafana;

  • Installing a plug-in

    • Enter the Grafana lib directory on the Grafana server and type the following command to update the plug-in:

    ./grafana-cli plugins install grafana-piechart-panel

  • Go to the Grafana directory

    cd grafana-6.0. 0
    Copy the code
    • Start Grafana.
    ./bin/grafana-server web
    Copy the code
  • Display monitoring information in Grafana

    • After installing and starting Grafana, the browser accesses Grafana by typing IP:3000. The default administrator account password is admin/admin. The first login will let you change the administrator password, then you can log in to see.

    • Adding a Data source

    • Choose the Prometheus

    • Enter a name, then http://ip+9090 and click Save&Test. Once successful, click Dashboards to select the display panel

    • Click Import to import one or all of them

    • Select the + sign in the left sidebar, click Imput, and type in the Grafana.com Dashboard: 8919

    You can also choose the official display panel, link: grafana.com/dashboards

    • Enter the number and click OK, then Prometheus select Prometheus and click Import

  • See the effect

    • Select the box in the left sidebar, click Manage, and then click the one you just created to show it off!

    • The display effect is as shown in the figure:

Grafana monitoring system setup for other server monitoring systems

3.1 the foregoing

  • This tutorial is about configuring monitoring systems for other servers, so assume you’ve already done that

  • Prometheus of the monitoring system is similar to a registry. You can configure only Prometheus, and on other servers, you can maintain node_exporter, which collects data and tells Prometheus where it is. Prometheus stored information from Her friend for Grafana to query; Grafana was responsible for the presentation of information; As a result, Prometheus can be configured with only one server, and any other server or host’s exporter can provide job_name, targets address and other information in this Promethes.

  • This is how Prometheus re-downloaded Prometheus; otherwise, skip the tutorial 3.5: Adding Machine State Monitoring

3.2 installation Prometheus

  • Connect to the server to be installed and install Prometheus:
    wget https:/ / github.com/prometheus/prometheus/releases/download/v2.7.2/prometheus-2.7.2.linux-amd64.tar.gz
    Copy the code
    tar xvfz prometheus-2.72..linux-amd64.tar.gz
    Copy the code

3.3 start the Prometheus

  • To download the latest version, you can right-click the latest version in github’s Release to get the download link
    wget https:/ / github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz
    Copy the code
  • Unpack the
    tar xvfz node_exporter-0.17. 0.linux-amd64.tar.gz
    Copy the code
  • Access the decompressed directory
    cd node_exporter-0.17. 0.linux-amd64
    Copy the code
  • Run the monitoring collection service
    ./node_exporter
    Copy the code

3.4 configuration Prometheus:

$ cat prometheus.yml 
# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).
 
# Alertmanager configuration
alerting:
  alertmanagers:
  - static_configs:
    - targets:
      # - alertmanager:9093
 
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first_rules.yml"
  # - "second_rules.yml"
 
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'
 
    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.
 
    static_configs:
    - targets: ['localhost:9090']
Copy the code

Do not change unless there are other special needs;

3.5 Adding Machine Status Monitoring

~~~ Java // Download latest version, You can right-click the latest version in github release to get the download link wget https://github.com/prometheus/node_exporter/releases/download/v0.17.0/node_exporter-0.17.0.linux-amd64.tar.gz ~ ~ ~Copy the code
  • Unpack the
    tar xvfz node_exporter-0.17. 0.linux-amd64.tar.gz
    Copy the code
  • Access the decompressed directory
    cd node_exporter-0.17. 0.linux-amd64
    Copy the code
  • Run the monitoring collection service
    ./node_exporter
    Copy the code

You can use the background running process command to start or; Visit http://ip:9100/metrics to verify the configuration. If there is a corresponding page, the configuration is successful

3.6 Configuring the Promethes. yml file

scrape_configs:
  - job_name: 'prometheus'
    static_configs:
      - targets: ['localhost:9090']
  - job_name: 'server'
    static_configs:
      - targets: ['localhost:9100']
Copy the code

If Prometheus is not on this server, change targets host under server to the corresponding IP address. Let’s reboot

3.7 configuration Grafana

  • Enter the Grafana lib directory on the Grafana server and type the following command to update the plug-in:
    ./grafana-cli plugins install grafana-piechart-panel
    Copy the code

Restart the service after updating the plug-in

3.8 Configuring the Visual Interface

  • Adding a Data source

  • Choose the Prometheus

  • Enter a name, then http://ip+9090 and click Save&Test. Once successful, click Dashboards to select the display panel

  • Click Import to import one or all of them

  • Select the + sign in the left sidebar, click Imput, and type in the Grafana.com Dashboard: 8919

You can also choose the official display panel, link: grafana.com/dashboards

  • Enter the number and click OK, then Prometheus select Prometheus and click Import

3.9 Viewing The Effect

  • Select the box in the left sidebar, click Manage, and then click the one you just created to show it off!

  • The display effect is as shown in the figure:

Note: If you want to monitor other servers, node_exporter can be installed on other servers, and its IP address and port number can be configured to Prometheus.yml of Prometheus. Job_name cannot be named the same as job_name and can be changed to another name. Grafana adding data sources and registering dashboards are consistent;

Email alarm for Grafana monitoring system

4.1 Grafana Server Configuration

  • Close the service

ctrl+c

If the grafana web monitoring system is not enabled, you do not need to disable it.

  • Go to the grafana directory
    cd grafana-6.0. 0
    Copy the code
  • Edit the configuration file conf
    vim defaults.ini
    Copy the code

Yum install vim yum install vim

Smtp.qq.com :465 is for QQ mailbox, other mailbox servers are different, please make corresponding changes, directly baidu can be;

  • Exit after editing:

ESC+:wq+Enter

  • Return to the previous level

cd ..

  • Start the service
    ./bin/grafana-server web
    Copy the code

4.2 Grafana Visual Interface Configuration

  • add

  • Enter the specific warning content

If yes, the email can be received. Otherwise, check whether the server configuration is correct.

4.3 Summary of email alarm

  • This function can set a threshold value for the data of some dashboards. If the value is exceeded, the alarm will be triggered. The specific application will be analyzed and added later.

Grafana Monitoring system construction MySQL monitoring system

5.1 Procedure Overview Overview

  1. Download and install Mysql and configure the account password
  2. Importing SQL files
  3. Install mysqld_exporter
  4. Operate on mysqLD_EXPORTER
  5. Run mysql_exporter
  6. Add prometheus. yml to the configuration
  7. Configuring the Visual Interface

5.2 Downloading and Installing Mysql

  • Skip this step if you need to perform operations on an existing mysql database.

  • Mysql repo source

    wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
    Copy the code
  • Install mysql-community-release-el7-5.noarch. RPM: mysql-community-release-el7-5.noarch. RPM:

    rpm -ivh mysql-community-release-el7-5.noarch.rpm
    Copy the code
  • Mysql installation:

    yum install mysql-server -y
    Copy the code
  • Modify permission, otherwise error:

    chown -R root:root /var/lib/mysql
    Copy the code
  • Mysql > restart mysql

    service mysqld restart
    Copy the code
  • Log in and reset your password:

    Mysql -u root mysql > use mysql; mysql > update user set password=password('123456') where user='root';
    mysql > exit;
    Copy the code

5.3 Importing SQL Files

  1. Download my2. SQL
    https://codeload.github.com/john1337/my2Collector/zip/master
    Copy the code
  2. Unzip the files and place the SQL files in this folder into the Mysql server you want to monitor
  3. Run the mysql command to log in to the mysql database

Mysql -u User name -p Password Example: mysql -uroot -proot 4. Run the following command to import the SQL file: ~~~ Java source /root/my2.sql ~~~

The following is the specific address, if the location is not correct, the corresponding change

  1. When a series of successful execution occurs, it indicates that the execution is complete.

5.4 Operate mysqLD_EXPORTER

  • Download and unzip:
    https:/ / github.com/prometheus/mysqld_exporter/releases/download/v0.10.0/mysqld_exporter-0.10.0.linux-amd64.tar.gz
    Copy the code
    tar -xvf mysqld_exporter-0.10. 0.linux-amd64.tar.gz
    Copy the code
  • Create the.my.cnf file
    vim vi.my.cnf
    Copy the code
  • Create effect as follows:
    [client]
    user=root
    password=root
    Copy the code

As long as the account password is connected to mysql, you can also assign a separate account to it.

  • Run mysql_exporter
    ./mysqld_exporter -config.my-cnf=".my.cnf" &
    Copy the code

5.5 Adding Promethes. yml to the Configuration

  - job_name: mysql
    static_configs:
      - targets: [Mysql > select * from 'mysql > select * from ']
Copy the code

After configuration, save the configuration and restart Prometheus. Then click on Status->Targets. If the mysql State is Up, the configuration is complete. Generally, the newly installed MSYQL is accessible only on the local computer. Open remote access to Baidu;

5.6 Configuring the Visual Interface

  • First click the pinion to add DataSource, then click Mysql, input the corresponding IP + port number, account password and other information, click Save&Test to test, if the feedback is successful, it indicates that the configuration is successful
  • Click the + icon and then select Import to select the dashboard in the official document. I used 7991 here

Enter 7991 Load to Load automatically

  • Official address: grafana.com/dashboards
  • After loading, configure the relevant name and address, as well as the loaded data source and other information, click “Add” and it will be displayed under the small box icon “Manage”.
  • The renderings are as follows:

Open API for Grafana monitoring system

6.1 an overview of the

  • In our server type access pattern, accessing data typically takes two forms; One is to directly use the user login and obtain the Cookie for authentication. One is resource request verification by API token mechanism.
  • The Admin HTTP API does not currently support API tokens. API tokens currently link only to organizations and organizational roles. They cannot get permission from the server administrator; only users can get that permission. Therefore, in order to use these API calls, you must use Basic Auth, and the Grafana user must have Grafana Admin privileges. (The default administrator user is called admin and has access to this API.)

Official document address: grafana.com/docs/http_a…

6.2 About User Login Authentication Request Resources

  • If HTTP API cannot be used, you can use a tool such as RestTemplate to simulate login authentication and obtain Cookie request resources. To request resources, we can use F12 to obtain the interface address of the request, which resources are needed, directly to the relevant site interface to obtain the interface address, simulated login can do the corresponding operation;

Without further introduction in this section, here is how to use the HTTP API;

6.3 Creating an API Token

  • Create API KEY

  • Click save

  • Take the contents following the Key as the contents after the Bearer in the Authorization:

The permissions inside are Viewer,Eidtor, and Admin. The permissions are Viewer, partial write, and full.

6.4 Example of Verifying HTTP Resources or Operation Interfaces:

6.5 Example for Creating AN API Key:

  • Request IP address and request header:

  • Please fill in the following contents:

Permissions can be divided into Viewer,Editor, and Admin. The Viewer can only view information, while the Editor can perform operations on some interfaces. The Admin role has all permissions. SecondsToLive – Sets the key expiration time in seconds. This is optional. If the value is positive, the expiration date of the key is set. If it is null, zero, or completely omitted (unless api_KEY_MAX_SECONds_TO_LIVE sets the configuration option), the key will never expire.

6.6 Example for Deleting an API Key:

  • You can query all Api keys through the query interface

  • Get the ID of the ApiKey to be deleted, and then use the Delete request method to Delete the corresponding ApiKey with the ID, as shown in the following figure:

You can use this method if you support THE HTTP API. You can view the specific request path and corresponding resources in the official document. Grafana.com/docs/http_a…

Grafana monitoring system for RabbitMQ

7.1 Download and Decompress the file

  • Download:
    wget https:/ / github.com/kbudde/rabbitmq_exporter/releases/download/v1.0.0-RC5/rabbitmq_exporter-1.0.0-RC5.linux-amd64.tar.gz
    Copy the code

No command such as wget, please search and download by yourself

  • Extract:

    tar -xvf rabbitmq_exporter-1.0. 0-RC5.linux-amd64.tar.gz
    Copy the code
  • Enter the directory:

    cd rabbitmq_exporter-1.0. 0-RC5.linux-amd64
    Copy the code
  • Execute command:

    RABBIT_USER=guest RABBIT_PASSWORD=guest OUTPUT_FORMAT=JSON PUBLISH_PORT=9099 RABBIT_URL=http://localhost:15672 nohup ./rabbitmq_exporter 2>&1 &
    Copy the code

Note inside the PABBIT_USER account, and the password behind, please enter the actual account password, and port, etc.;

7.2 to join Prometheus. Yml

  • Go to a server with Prometheus, go to Prometheus, and edit Prometheus.yml

    vim prometheus.yml
    Copy the code
  • Configure the following parameters:

    - job_name: 'RabbitMQ'
      static_configs:
    	- targets: ['Rabbit IP address :9099']
    Copy the code

The IP address is the Rabbit address, and the default port number is 9099.

7.3 Accessing Grafana to Configure the RabbitMQ Address

  1. Browser type: IP address +3000 Enter Grafana default account and password are admin
  2. Click on the pinion and click **Data Sources **

3. Click **Add Data Source ** to select Prometheus

4. Edit the configuration information about Prometheus. Name is the Name, and URL ishttp://promethues server address and port number (9090)

The URL is not the address of the server to which RabbitMQ was written, but the address of Prometheus.

  1. Click Save&Test to test. If a small green bar appears below: Data Source is Working, the installation is successful
  2. Click the + icon on the left, select Import, enter 2121 in the first input box, and then click Load

7. Click the icon of the small box on the left, click Manage to select the newly matched, click enter to display, the effect picture is as follows:

Monitoring Redis by Grafana monitoring system

8.1 Download and Decompress the package

  • Download:
    wget https:/ / github.com/oliver006/redis_exporter/releases/download/v1.0.3/redis_exporter-v1.0.3.linux-amd64.tar.gz
    Copy the code
  • Extract:
    tar -xvf redis_exporter-v1. 03..linux-amd64.tar.gz
    Copy the code

8.2 start Redis_exporter

  • No password:
    ./redis_exporter redis/ / 192.168.1.120:6379 &
    Copy the code
  • Have a password:
    redis_exporter  -redis.addr 192.1681.120.:6379  -redis.password 123456* * * *Copy the code

The IP address and port number are based on the actual situation

8.3 configuration Prometheus. Yml

  • Go to Prometheus’ server, then go to Prometheus. Yml, and edit:
  • Editor:
    vim prometheus.yml
    Copy the code
  • As follows:
     - job_name: redis
        static_configs:
          - targets: ['IP address: 9121']
    Copy the code

8.4 Checking the Redis status

  • Enter the address
    IP address of Premetheus:9090/targets
    Copy the code

If State is UP, success is achieved.

8.5 Configuring a data source for Grafana

  • Login website:
    Grafana IP address:3000
    Copy the code
  • Add the DataSource to Grafana. If the DataSource has been added to Grafana (pointing to the IP address and port where Prometheus is installed), you do not need to add the DataSource to Grafana before importing the panel.

8.6 Configuring the Display Panel

  1. Log in first and click the + sign to select Import
  2. Enter 731 in the first box

Note that it is possible to find another display panel for Prometheus on the official display panel page and enter the number of the Redis display panel in the location indicated above: grafana.com/dashboards

8.7 View the effect picture as follows:

Monitoring TiDB for Grafana monitoring system

9.1 Downloading the Binary Package and decompressing it

  • download
    wget https:/ / github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.linux-amd64.tar.
    Copy the code
  • Unpack the
    tar -xzf node_exporter-0.152..linux-amd64.tar.gz
    Copy the code

9.2 Starting the Service

  • Enter the directory:
    cd node_exporter-0.152..linux-amd64
    Copy the code
  • Start the node_exproter service
    ./node_exporter --web.listen-address=": 9100" \ --log.level="info" &
    Copy the code

9.3 Configuration on Promethes. yml

  • Go to the server where Prometheus resides and enter the Prometheus directory
    cd prometheus-2.21..linux-amd64
    Copy the code
  • Edit the Prometheus. Yml
    vim prometheus.yml
    Copy the code
  • The new contents are as follows:
      - job_name: 'tidb'
        honor_labels: trueStatic_configs: -targets: ['IP address of tiDB server :10080']
    Copy the code

After the configuration is complete, restart promethe. yml and log in to the IP address 9090/targets. If Status is UP, it indicates success.

9.4 Starting the Grafana Service

./prometheus \
    --config.file="./prometheus.yml" \
    --web.listen-address=": 9090" \
    --web.external-url="http://192.168.199.113:9090/" \
    --web.enable-admin-api \
    --log.level="info" \
    --storage.tsdb.path="./data.metrics" \
    --storage.tsdb.retention="15d" &
Copy the code

9.5 Start Grafana and configure the DataSource

  • Run the normal command to start the vm. If the vm has been started, no change is required.
  • If the Prometheus DataSource has been configured before, you do not need to configure it again and point to the written display panel when importing the display panel.

9.6 Importing the Grafana panel

  1. From the sidebar menu, click the + sign > Import to open the Import Dashboard window.

  2. Click Upload. Json File to Upload the corresponding JSON File (github.com/pingcap/tid…

  3. Note: The JSON file corresponding to the TiDB panel is tidb.json. (We can go to tidb.json via the link above and copy the content and call it tidb.json and import it.)

  4. Click on the Load.

  5. Select a Prometheus data source. (Previously created data source for Prometheus, we can reuse it by pointing directly to it)

  6. Click Import to Import the Prometheus panel.

The 9.7 preview is available in Mangae, as shown below

Code is not easy, like a point of attention or collection ~ ^^