spring-boot-actuator

after upgrade to Spring Boot 2, how to expose cache metrics to prometheus?

独自空忆成欢 提交于 2019-12-07 06:40:13
问题 I recently upgraded a spring boot application from 1.5 to 2.0.1. I also migrated the prometheus integration to the new actuator approach using micrometer. Most things work now - including some custom counters and gauges. I noted the new prometheus endpoint /actuator/prometheus does no longer publish the spring cache metrics (size and hit ratio). The only thing I could find was this issue and its related commit. Still I can't get cache metrics on the prometheus export. I tried settings some

custom path for prometheus actuator

心不动则不痛 提交于 2019-12-07 04:10:15
问题 I am currently trying to migrate our prometheus lib to spring boot 2.0.3.RELEASE. We use a custom path for prometheus and so far we use a work around to ensure this. As there is the possibility for a custom path for the info- and health-endpoint, uses management.endpoint.<health/info>.path . I tried to specify management.endpoint.prometheus.path , but it was still just accessible under /actuator/prometheus . How can I use a custom path or prometheus? We enable prometheus using the following

Spring Boot Actuator - Cannot disable /info endpoint

这一生的挚爱 提交于 2019-12-07 03:05:31
问题 I tried disabling all actuator endpoints for production environment in application.yml configuration file: endpoints.enabled: false It works for all endpoints except for /info. How can I turn off all endpoints for given environment? UPDATE: Project I am working on is also acting as Eureka client. In documentation for Spring Cloud Netflix in section Status Page and Health Indicator (http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html) it says that "Eureka instance default to

Spring Boot Actuator 'http.server.requests' metric MAX time

半城伤御伤魂 提交于 2019-12-07 01:32:54
问题 I have a Spring Boot application and I am using Spring Boot Actuator and Micrometer in order to track metrics about my application. I am specifically concerned about the 'http.server.requests' metric and the MAX statistic: { "name": "http.server.requests", "measurements": [ { "statistic": "COUNT", "value": 2 }, { "statistic": "TOTAL_TIME", "value": 0.079653001 }, { "statistic": "MAX", "value": 0.032696019 } ], "availableTags": [ { "tag": "exception", "values": [ "None" ] }, { "tag": "method",

How do I generate build-info.properties in the IntelliJ “out” directory on debug/run for a Spring Boot project?

纵然是瞬间 提交于 2019-12-06 22:43:29
问题 In my build.gradle, I have added spring build info: springBoot { mainClass = "${springBootMainClass}" buildInfo() { additionalProperties = [ name: "${appName}", version: "${version}-${buildNumber}", time: buildTime() ] } } def buildTime() { final dateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ") dateFormat.timeZone = TimeZone.getTimeZone('GMT') dateFormat.format(new Date()) } When I run from the command line, this correctly adds the /META-INF/build-info.properties file into

how to get metrics from spring-boot-actuator programmatically?

亡梦爱人 提交于 2019-12-06 19:33:27
问题 we have a spring application in production. It is NOT Spring-boot. I found this post on how to use spring-boot-actuator in a non-spring-boot application. However, the requirement for us is to aggregate the data from /metrics endpoint and do some analytics on it and report a status indicator. For eg, we might use heap parameter such as {"heap.committed":480768,"heap.init":262144,"heap.used":294461,"heap":3728384,"threads.peak":37} to indicate the status of the application - FATAL, WARN or

spring boot actuator connect jmx programmatically

随声附和 提交于 2019-12-06 14:40:13
I'd like to use the shutdown endpoint of my Spring Boot 2.0.1 application from the command line. For that I have only added the spring-boot-starter-actuator to my Gradle file and enabled the shutdown endpoint in the configuration. I also created a very simple tool that tries to connect via JMX to the running application. Snippet: String url = "service:jmx:rmi:///jndi/rmi://127.0.01:<which port?>/jmxrmi"; JMXServiceURL serviceUrl = new JMXServiceURL(url); JMXConnectorFactory.connect(serviceUrl, null); <-- KAPOW! JMX is working because I can use jconsole to connect locally. I just have no clue

How to get oAuth2 access token when user call signup rest API in springboot?

夙愿已清 提交于 2019-12-06 07:40:09
currently I am working on Springboot security, its quite new for me. I followed youtube video tutorial Video I am getting oauth2 access_token successfully when I use bellow code snippet:- @SpringBootApplication public class MathifyApplication { @Autowired private PasswordEncoder passwordEncoder; public static void main(String[] args) { SpringApplication.run(MathifyApplication.class, args); } @Autowired public void authenticationManager(AuthenticationManagerBuilder builder, UserRepository repository, UserService service) throws Exception { //Setup a default user if db is empty User students =

spring-cloud-starter-config POST /env not working

爱⌒轻易说出口 提交于 2019-12-06 06:28:44
I have a little spring boot web application (executable jar) which has some custom properties inside the application.properties file. My goal is to be able to dynamically alter these properties at runtime without having to run a build/deploy or restarting the java process. The spring-cloud-starter-config project seems to be well suited for this (even though I am not using a config server) but I ran into the following problem: In my pom.xml I include dependencies to spring-boot-starter-actuator and spring-cloud-starter-config. The application.properties configures below properties management

Spring Boot production monitoring

旧时模样 提交于 2019-12-06 04:12:06
问题 Spring Boot Actuator exposes a lot of metrics and information of the deployed container. However, production operations guys probably don't want to stare at pure JSON objects on their browser :) What would be good "standard" tools for monitoring this in production? This would include graphs, triggers for alerts, etc. 回答1: The spring-boot-admin project is also a great monitoring tool that your production support guys may be interested in. It doesn't process and graph the metrics at all like