Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Use prometheus and grafana to increase monitoring of spring-boot&dubbo projects (1)

Shulou Source: shulou.com Published: 2022-06-03 05:40:30 11月24日 Update

Download prometheus

https://prometheus.io/download/

Here we have prometheus-2.10.0.linux-amd64.tar.gz.

Install prometheus

Execute decompression command

tar -zxvf prometheus-2.10.0-rc.0.linux-amd64.tar.gz

Configure prometheus

modify prometheus.yml,

vim prometheus.yml

Add below

- job_name: 'micro-service'metrics_path: /actuator/prometheusserverset_sd_configs:- servers: - 'ip:2181' - 'ip:2181' - 'ip:2181' paths: - /prometheus

job_name can be started at will

metrics_path: is the endpoint provided by spring-boot

servers: configure the address of dubbo registry zk

Initiate prometheus

nohup ./ prometheus > prometheus.log &

download grafana

https://grafana.com/grafana/download

Download and install according to the official website steps, download speed is a little slow, need to wait patiently

Start grafana

service grafana-server start

Start-up may give an error

View grafana logs

vim /var/log/grafana/grafana.log

Create grafana directory under/var/run directory and modify owner

mkdir grafanachown grafana:grafana grafana configure prometheus data sources

Visit IP:3000

Select add data source

Select Prometheus

Configure the newly installed prometheus information in the url

A Dashboard with ID 4701 is recommended.

Tags: Configuration selection directory patience information commands addresses owners data data sources logs steps endpoints speed reports recommendations projects monitoring Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi Huawei MySQL macOS