
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>management.endpoints.web.exposure.include=prometheus,health
management.metrics.export.prometheus.enabled=truedocker pull prom/prometheus:latestglobal:
scrape_interval: 15s
evaluation_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'springboot'
metrics_path: '/actuator/prometheus'
static_configs:
- targets: ['<Spring Boot服务IP>:<端口>']docker run -d -p 9090:9090 --name prometheus \
-v $(pwd)/prometheus.yml:/etc/prometheus/prometheus.yml \
prom/prometheus:latestdocker pull grafana/grafana:latestdocker run -d -p 3000:3000 --name=grafana \
grafana/grafana:latest原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。