spring-boot-actuator

Prometheus Endpoint Not Working Spring Boot 2.0.0.RC1 Spring Webflux enabled

a 夏天 提交于 2020-01-03 10:45:39
问题 I followed the documentation here (https://docs.spring.io/spring-boot/docs/2.0.0.RC1/reference/htmlsingle/#production-ready-endpoints-enabling-endpoints) and made sure application.yml file has the below management: metrics: export: prometheus: enabled: true endpoints: web: expose: health, info, httptrace, metrics, threaddump, mappings, prometheus As per the documentation (https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/actuator-api/html/#prometheus) the following doesn't work. curl

@RefreshScope with @ConditionalOnProperty does not work

房东的猫 提交于 2020-01-03 09:09:16
问题 Problem Exploring an option of enabling/disabling a @RequestMapping endpoint on demand without restarting JVM. Implement a kill switch on a endpoint at runtime. Attempt I've tried the following but @RefreshScope does not seem to work with @ConditionOnProperty @RestController @RefreshScope @ConditionalOnProperty(name = "stackoverflow.endpoints", havingValue = "enabled") public class MyController { @Value("${stackoverflow.endpoints}") String value; @RequestMapping(path = "/sample", method =

Enable logging in spring boot actuator health check API

我与影子孤独终老i 提交于 2020-01-02 05:00:10
问题 I am using Spring boot Actuator API for the having a health check endpoint, and enabled it by : management.endpoints.web.base-path=/ management.endpoints.web.path-mapping.health=healthcheck Mentioned here Now I want to enable log in my application log file when ever the status of this above /healthcheck fails and print the entire response from this end point. What is the correct way to achieve this? 回答1: Best way is to extend the actuator endpoint with @EndpointWebExtension. You can do the

Spring Boot 2.0 Prometheus Backward Compatibility

旧巷老猫 提交于 2020-01-02 04:10:08
问题 I am migrating to Spring Boot 2.0 and I am having issues with my Prometheus Metrics. I know that MicroMeter is the new way of doing stuff, which is not as crisp as the Prometheus libs but OK. My issue is that If I do not want to change my metrics now I cannot upgrade to Spring Boot 2.0. Am I right? I tried the following: Trial no 1 Keep my implementations "as is" add the new dependency io.micrometer:micrometer-registry-prometheus:1.0.2 to my app (actuator is already in there) change stuff in

SpringBoot Disable rabbitTemplate retry policy for rabbit health check

你。 提交于 2020-01-01 19:37:33
问题 My SpringBoot configuration contains very strong retry policy for rabbitTemplate retries spring: rabbitmq: template: retry: enabled: true initial-interval: 500 max-attempts: 10 multiplier: 5 max-interval: 60000 The problem with this configuration is when health endpoint is called and rabbitMQ is down, the connections hangs for really long time. Adding properties like spring.rabbitmq.connection-timeout=500 or spring.rabbitmq.template.receive-timeout=500 or spring.rabbitmq.template.reply

bypass CAS to get un/secured health infos from Spring boot app

青春壹個敷衍的年華 提交于 2019-12-25 04:50:33
问题 I have a Spring Boot app using CAS WebSecurity to make sure that all incoming non authenticated requests are redirected to a common login page. @Configuration @EnableWebSecurity public class CASWebSecurityConfig extends WebSecurityConfigurerAdapter { I want to expose health endpoints through actuator, and added the relevant dependency. I want to bypass the CAS check for these /health URL which are going to be used by monitoring tools, so in the configure method, I have added : http

Springboot upgrade 1.5.8 to 2.0 release getting exception “org.springframework.beans.factory.NoSuchBeanDefinitionException”

风流意气都作罢 提交于 2019-12-24 07:34:59
问题 Gradle dependency related to kubernetes: "io.fabric8:spring-cloud-kubernetes-core:0.1.6", "io.fabric8:spring-cloud-starter-kubernetes:0.1.6", "org.springframework.cloud:spring-cloud-starter-sleuth:1.2.4.RELEASE", Getting the below exception while upgrading springboot 1.5.6 to 2.0.0.Release Parameter 2 of method configurationUpdateStrategy in io.fabric8.spring.cloud.kubernetes.reload.ConfigReloadAutoConfiguration$ConfigReloadAutoConfigurationBeans required a bean of type 'org.springframework

Spring Boot remove extra HealthIndicator information

て烟熏妆下的殇ゞ 提交于 2019-12-23 17:42:55
问题 I just add a spring-boot-starter-actuator dependency to pom.xml of my application. After building and running project, /health endpoint showing the next information: { "status": "UP", "details": { "application": { "status": "UP" } }, "application": { "status": "UP" } } How can I remove the "details" section from response? 回答1: Finally I found the root cause of the problem. It was incorrect configuration of MappingJackson2HttpMessageConverter: @Autowired public void configureJsonSerializer

spring boot actuator connect jmx programmatically

血红的双手。 提交于 2019-12-23 02:01:52
问题 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

Spring boot actuator health endpoint

蹲街弑〆低调 提交于 2019-12-23 01:54:15
问题 I have create a PostgreSQL health indicator like this: @Component public class PostgresHealthIndicator extends AbstractHealthIndicator { @Autowired DataSource postgresDataSource; public DataSourceHealthIndicator dbHealthIndicator() { DataSourceHealthIndicator indicator = new DataSourceHealthIndicator(postgresDataSource); return indicator; } @Override protected void doHealthCheck(Health.Builder builder) throws Exception { Health h = dbHealthIndicator().health(); Status status = h.getStatus();