Prometheus and Grafana monitor Nacos

Nacos 0.8.0 version improves the monitoring system and supports access to third-party monitoring systems to monitor the running status of Nacos through exposed metrics data. Currently, prometheus, elastic search and influxdb are supported. The following is a combination of prometheus and grafana how to monitor Nacos, the official website grafana monitoring page . Combine with elastic search and influxdb to find relevant information by yourself

Nacos cluster exposes metrics data

Modify the configuration application.properties file in each node of the cluster to expose metrics data

cd /workspace/nacos/conf

vim application.properties

management.endpoints.web.exposure.include=*

See if you can access metrics data

http://xx.xx.xx.xx:8848/nacos/actuator/prometheus

image.png

Deploy prometheus to collect Nacos metrics data

The download address is download prometheus


Unzip the prometheus compressed package and install

tar xvfz prometheus-*.tar.gz /workspace/

cd /workspace/prometheus

Modify the configuration file, pay attention to the format indentation

vim prometheus.yml

  - job_name: 'nacos-cluster'

    scrape_interval: 60s

    metrics_path: '/nacos/actuator/prometheus'

    static_configs:

      - targets:

         - 110.60.40.42:8848

         - 110.90.5.47:8848

         - 110.9.50.15:8848

Start prometheus service

cd /workspace/prometheus

nohup ./prometheus --config.file="prometheus.yml" &

Check the prometheus data through the browser, http://xx.xx.xx.xx:9090/graph

You can see the collected data of prometheus, search for nacos_monitor in the search bar, you can search for Nacos data, indicating that the collected data is successful

image.png


Deploy grafana to graphically display metrics data

Use yum to install grafana

sudo yum install https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.4-1.x86_64.rpm

sudo service grafana-server start

Login to grafana Default account password: admin

http://xx.xx.xx.xx:3000/?orgId=1


Configure prometheus data source


image.png

image.png


Import Nacos grafana monitoring template

Download link: https://github.com/nacos-group/nacos-template

image.png

Nacos monitoring is divided into three modules:

  • Nacos monitor displays core monitoring items

image.png

  • nacos detail shows the change curve of the indicator

image.png

  • nacos alert is an alarm item

image.png

Nacos-Sync monitoring

With the release of Nacos 0.9 version, Nacos-Sync 0.3 version supports metrics monitoring, which can observe the running status of Nacos-Sync service through metrics data, which improves Nacos-Sync's monitoring capabilities in the production environment. Refer to Nacos Monitoring Manual for the construction of the overall monitoring system

grafana monitor Nacos-Sync

Like Nacos monitoring, Nacos-Sync also provides monitoring templates, import monitoring templates

image.png

Nacos-Sync monitoring is also divided into three modules:

  • nacos-sync monitor displays core monitoring items

image.png

  • nacos-sync detail and alert display monitoring curves and alarms

image.png


Guess you like

Origin blog.51cto.com/536410/2592073