1 SLS JVM监控大盘
Dashboard for Micrometer instrumented applications (Java, Spring Boot, Micronaut)
基于https://grafana.com/grafana/dashboards/4701 修改
SLS JVM监控大盘
用于Spring Boot应用, 可采集JVM, Tomcat, 进程等监控指标 详细教程请查看: https://developer.aliyun.com/article/770726
配置步骤
- 在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>
<version>1.1.3</version>
</dependency>
<!-- 可选, 用于进程内存使用图表 -->
<dependency>
<groupId>io.github.mweirauch</groupId>
<artifactId>micrometer-jvm-extras</artifactId>
<version>0.2.0</version>
</dependency>
- 修改spring boot配置(application.yml)
server:
port: 8080
spring:
application:
name: spring-demo
management:
endpoints:
web:
exposure:
include: 'prometheus' # 暴露/actuator/prometheus
metrics:
tags:
application: ${spring.application.name} # 暴露的数据中添加application label
- 在Prometheus中增加采集
global:
scrape_interval: 15s
scrape_configs:
- job_name: "spring-demo"
metrics_path: "/actuator/prometheus"
static_configs:
- targets: ["localhost:8080"]
- 通过remote write 写入SLS的时序存储
https://help.aliyun.com/document_detail/171781.html
- Grafana中添加数据源
https://help.aliyun.com/document_detail/173903.html
CHANGELOG:
v0.1(2020-08-19): initial upload
Data source config
Collector config:
Upload an updated version of an exported dashboard.json file from Grafana
Revision | Description | Created | |
---|---|---|---|
Download |