SpringBoot版本升级后,指标/执行器在jHipster项目中不起作用

时间:2020-05-18 13:31:37

标签: jhipster metrics spring-boot-actuator

项目详细信息

  1. 是使用Jhipster 4.3.0生成的
  2. 现在,SpringBoot版本已从1.5.2升级到2.2.6

SpringBoot版本升级后,“管理”>“指标”不起作用。

enter image description here

Application.yml-指标

management:
server:
    servlet:
       context-path: /management
endpoints:
   web:
      base-path: /management
      exposure:
          include: ['configprops', 'env', 'health', 'info', 'metrics', 'jhimetrics', 'logfile', 'loggers', 'prometheus', 'threaddump']
endpoint:
   jhimetrics:
      enabled: true
metrics:
   enable:
      http: true
      jvm: true
      logback: true
      process: true
      system: true

点击http://localhost:8080/management/metrics时,我得到以下响应:

{"names":[
  "cache.removals",
  "http.server.requests",
  "cache.evictions",
  "cache.gets",
  "process.start.time",
  "cache.puts",
  "http.server.requests.percentile",
  "jvm.threads.states",
  "jvm.memory.committed",
  "jdbc.connections.active",
  "jvm.gc.memory.promoted",
  "jvm.memory.max",
  "jvm.gc.pause.percentile",
  "jvm.gc.max.data.size",
  "jvm.gc.pause",
  "jdbc.connections.max",
  "jdbc.connections.min",
  "system.cpu.count",
  "logback.events",
  "jvm.memory.used",
  "jvm.threads.daemon",
  "jvm.buffer.memory.used",
  "system.cpu.usage",
  "jvm.gc.memory.allocated",
  "jdbc.connections.idle",
  "jvm.threads.live",
  "jvm.threads.peak",
  "process.uptime",
  "process.cpu.usage",
  "jvm.classes.loaded",
  "jvm.classes.unloaded",
  "jvm.gc.live.data.size",
  "jvm.buffer.count",
  "jvm.buffer.total.capacity"]}

虽然我期望这样的答复: enter image description here

我也尝试打http://localhost:9999/management/jhimetrics,这里出现404错误。

有人遇到类似问题或有解决方案吗?请帮忙。

0 个答案:

没有答案