关于Actuator自动配置的源码在org.springframework.boot.actuate.autoconfigure中。想要详细深入的了解其中的原理,可以阅读这里的源码。...自动配置的 HealthIndicators 在目录org.springframework.boot.actuate.health下面,Spring Boot 默认自动配了如下的HealthIndicators...一个简单的示例代码如下: import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.HealthIndicator...这个接口的定义如下: package org.springframework.boot.actuate.endpoint; public interface Endpoint { String...import java.util import org.springframework.boot.actuate.endpoint.Endpoint import org.springframework.stereotype.Component
Spring Boot Actuator 提供了众多 HTTP 接口端点(Endpoint),其中包含了丰富的 Spring Boot 应用程序运行时的内部状态信息。...在 Gradle项目配置文件build.gradle中添加如下: dependencies { compile('org.springframework.boot:spring-boot-starter-actuator...') ... } 为了看到 Spring Boot 中提供的全部的端点信息,在 Spring Boot 1.5.x 版本中默认启用所有 Endpoint,这些端点如下: { "links.../ 1.4 自定义Actuator Endpoint Spring Boot Actuator 模块提供了灵活的接口,方便我们自己定制监控端点。...HealthIndicator接口协议如下 package org.springframework.boot.actuate.health; public interface HealthIndicator
+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping...+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping...]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping...]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping...>> org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping.links(javax.servlet.http.HttpServletRequest
; import org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties; import org.springframework.boot.actuate.autoconfigure.web.server.ManagementPortType...; import org.springframework.boot.actuate.endpoint.ExposableEndpoint; import org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver...; import org.springframework.boot.actuate.endpoint.web.EndpointMapping; import org.springframework.boot.actuate.endpoint.web.EndpointMediaTypes...; import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint; import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier...org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointsSupplier; import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping
21:03:46.843 [main] ERROR org.springframework.boot.SpringApplication - Application run failed java.lang.NoSuchMethodError...: org.springframework.boot.builder.SpringApplicationBuilder....(SpringApplication.java:338) at org.springframework.boot.SpringApplication.run(SpringApplication.java...:297) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1242) at org.springframework.boot.SpringApplication.run... org.springframework.boot spring-boot-starter-parent</artifactId
在使用springboot程序的时候,发现启动类直接打不开,报错信息如下:图片今天在使用springboot的时候,启动类application的main方法一致启动不了,报错信息为java: 无法访问org.springframework.boot.SpringApplication
|| application/json]}": { "bean": "endpointHandlerMapping", "method": "public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get...]}": { "bean": "endpointHandlerMapping", "method": "public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set.../json]}": { "bean": "endpointHandlerMapping", "method": "public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EnvironmentMvcEndpoint.value...> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType...()" } } http://localhost:8082/configprops (查看我们配置了的以及默认配置的属性,也可以看出我们还可以配置哪些属性) { "endpoints-org.springframework.boot.actuate.endpoint.EndpointProperties
/manage/metrics/{name:.*}],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value...|| /manage/mappings.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke...info || /manage/info.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke.../manage/configprops.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke...{[/manage/health || /manage/health.json],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke
+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke...+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get...]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set...> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType...只需要通过注org.springframework.boot.actuate.metrics.CounterService和org.springframework.boot.actuate.metrics.GaugeService
: Mapped "{[/health || /health.json],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke..."{[/beans || /beans.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke.../metrics || /metrics.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke...| /sofaboot/versions.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke..."{[/trace || /trace.json],methods=[GET],produces=[application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.EndpointMvcAdapter.invoke
自定义健康组件 MyComHealthIndicator.java MyComHealthIndicator其中HealthIndicator是固定写法,必须要有,myCom 是该健康组件的名字 import org.springframework.boot.actuate.health.AbstractHealthIndicator...; import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Status...编写InfoContributor.java配置类 import org.springframework.boot.actuate.info.Info; import org.springframework.boot.actuate.info.InfoContributor...来管理程序是否就绪,或者LivenessEndpoint来管理程序是否存活; import org.springframework.boot.actuate.endpoint.annotation.Endpoint...; import org.springframework.boot.actuate.endpoint.annotation.ReadOperation; import org.springframework.boot.actuate.endpoint.annotation.WriteOperation
management.endpoint.env-org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointProperties...management.endpoint.health-org.springframework.boot.actuate.autoconfigure.health.HealthEndpointProperties...management.endpoint.logfile-org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointProperties...management.endpoints.jmx-org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointProperties...management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties
(ReflectionUtils.java:223) ~[spring-core-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke...(ReflectiveOperationInvoker.java:76) ~[spring-boot-actuator-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke...org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$ServletWebOperationAdapter.handle...] at org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping$OperationHandler.handle...(WebMvcMetricsFilter.java:126) ~[spring-boot-actuator-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal
com.example.springboot1starter.MyHealthIndicatorAutoConfiguration$$EnhancerBySpringCGLIB$$945c1f annotationType是 interface org.springframework.boot.actuate.endpoint.annotation.Endpoint...cause是 java.lang.ClassNotFoundException: org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration...终于真相大白了,是找不到org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration这个类。...把一些类的package改了: spring boot 1里类名是: org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration...spring boot 2里类名是: org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration
org.springframework.boot spring-boot-starter-parent...配置绑定映射类 有关本章开放节点的配置都被映射到属性配置类org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties...具体的实现我在自定义starter的文章内有讲到,我们找到name为management.endpoints.web.exposure.include的配置如下: ..... { "sourceType": "org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties...来进行修改,该参数的值由org.springframework.boot.actuate.health.ShowDetails枚举提供配置值,ShowDetails源码如下所示: /** * Options...", "type": "org.springframework.boot.actuate.health.ShowDetails" }, .....
已解决:org.springframework.boot.context.properties.ConfigurationPropertiesBindException 一、分析问题背景 在使用Spring...然而,有时在启动应用程序时会遇到org.springframework.boot.context.properties.ConfigurationPropertiesBindException的报错。...示例代码片段: import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component...以下是正确的代码示例: import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration...通过以上步骤和注意事项,可以有效解决org.springframework.boot.context.properties.ConfigurationPropertiesBindException报错问题
> org.springframework.boot.actuate.endpoint.mvc.AuditEventsMvcEndpoint.findByPrincipalAndAfterAndType...+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.get...]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.LoggersMvcEndpoint.set...+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.MetricsMvcEndpoint.value...+json || application/json]}" onto public java.lang.Object org.springframework.boot.actuate.endpoint.mvc.HealthMvcEndpoint.invoke
-- 监控依赖 --> org.springframework.boot spring-boot-starter-actuator...//localhost:8016/actuator/* # 配置后:http://localhost:8016/monitor/* base-path: /monitor endpoint...endpointCachingOperationInvokerAdvisor": { "aliases": [], "scope": "singleton", "type": "org.springframework.boot.actuate.endpoint.invoker.cache.CachingOperationInvokerAdvisor...", "resource": "class path resource [org/springframework/boot/actuate/autoconfigure/endpoint...details": { "handlerMethod": { "className": "org.springframework.boot.actuate.endpoint.web.servlet.AbstractWebMvcEndpointHandlerMapping.Operat
领取专属 10元无门槛券
手把手带您无忧上云