赞
踩
<!-- 作为web项目必须的依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-actuator</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-actuator-autoconfigure</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency> <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency>
Counter.builder("request.times." + action).description("kkkk").
tag(action, method)
.register(meterRegistry)
.increment();
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.exclude= management.endpoint.enabled=true management.endpoint.httptrace.enabled=true management.endpoint.shutdown.enabled=true management.endpoint.metrics.enabled=true management.endpoint.prometheus.enabled=true management.endpoint.health.show-details=ALWAYS management.enabled-by-default=true management.metrics.export.appoptics.enabled: true management.metrics.export.appoptics.step: 10s management.metrics.export.appoptics.api-token: fake # actuator的metrics接口是否需要安全保证 management.endpoints.metrics.sensitive = false # actuator的metrics接口是否开启 management.endpoints.metrics.enabled=true
spring:
##去除有问题的指标,因为指标名重复产生bug
metrics:
servo:
enabled: false
management:
security:
enabled: false
prometheus-2.17.1.windows-amd64.tar.gz
grafana-6.7.2.windows-amd64.zip
curl http://localhost:9090/api/v1/label/__name__/values
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。