Spring boot 未显示弹簧防尘套执行器的所有链接

Spring boot 未显示弹簧防尘套执行器的所有链接,spring-boot,spring-boot-actuator,Spring Boot,Spring Boot Actuator,在我的Spring Boot项目中: build.gradle: plugins { id 'org.springframework.boot' version '2.2.2.RELEASE' id 'io.spring.dependency-management' version '1.0.8.RELEASE' id 'war' // to use JSP } group = 'ru.otus.sd' version = '0.0.1' sourceCompatibi

在我的Spring Boot项目中:

build.gradle:

plugins {
    id 'org.springframework.boot' version '2.2.2.RELEASE'
    id 'io.spring.dependency-management' version '1.0.8.RELEASE'
    id 'war' // to use JSP
}

group = 'ru.otus.sd'
version = '0.0.1'
sourceCompatibility = '1.8'

repositories {
    mavenCentral()
}

dependencies {
    implementation 'com.google.code.gson:gson:2.7'
    implementation 'com.h2database:h2'
    implementation 'javax.servlet:jstl:1.2'
    implementation 'org.springframework.boot:spring-boot-devtools'
    implementation 'org.springframework.boot:spring-boot-starter'
    implementation 'org.springframework.boot:spring-boot-starter-actuator'
    implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
    implementation 'org.springframework.boot:spring-boot-starter-jdbc'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'

    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }

    testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2'
}

test {
    useJUnitPlatform()
}
这里是application.yml

managment:
  endpoints:
    web:
      exposure:
        include:
          - beans
          - health
          - metrics
          - env

server:
  port: 8090
打开
http://localhost:8090/actuator
结果如下:

{
"_links": {
"self": {
"href": "http://localhost:8090/actuator",
"templated": false
},
"health": {
"href": "http://localhost:8090/actuator/health",
"templated": false
},
"health-path": {
"href": "http://localhost:8090/actuator/health/{*path}",
"templated": true
},
"info": {
"href": "http://localhost:8090/actuator/info",
"templated": false
}
}
}

为什么不链接如下:/beans/metrics

您可以尝试以下任一配置吗

management:
  endpoints:
    web:
      exposure:
        include: "*"

我在
application.yml
中添加了以下配置,并在执行器详细信息中获取了度量和bean

management:
  server:
    port: 9000
  endpoint:
    shutdown:
      enabled: true  
  endpoints:
    web:
      exposure:
        include:
        - beans
        - health
        - metrics
        - env

如果您使用了与所述相同的
application.yml
,请更改
management
的拼写,因为您将其写成
management
,拼写错误,我也没有得到指标和bean。

你能试试配置管理吗:端点:网络:暴露:包括:信息、健康、,metrics:export:atlas:enabled:False但当我尝试打开/beans时,我得到了错误页面:白标签错误页面此应用程序没有/error的显式映射,因此您将其视为一种回退。出现意外错误(类型=内部服务器错误,状态=500)。无法写入JSON:尝试序列化java.lang.Class:org.springframework.boot.autoconfigure.orm.jpa.jpa属性。忘记注册类型适配器?;嵌套异常为java.lang.UnsupportedOperationException:尝试序列化java.lang.Class:org.springframework.boot.autoconfigure.orm.jpa.jpa属性。忘记注册类型适配器?
management:
  server:
    port: 9000
  endpoint:
    shutdown:
      enabled: true  
  endpoints:
    web:
      exposure:
        include:
        - beans
        - health
        - metrics
        - env