Prometheus监控应用教程
Linux下安装Prometheus
-
下载Prometheus server
wget https://github.com/prometheus/prometheus/releases/download/v2.24.0/prometheus-2.24.0.linux-amd64.tar.gz
-
解压
tar xf prometheus-2.24.0.linux-amd64.tar.gz
-
运行
cd prometheus-2.24.0-rc.2.linux-amd64 nohup ./prometheus --config.file=./prometheus.yml &
-
访问 http://ip:9090,验证Prometheus是否已安装成功,web显示应该如下
prometheus监控java springboot 服务
-
加入pom.xml依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency