项目详细信息:
SpringBoot版本升级后,“管理”>“指标”不起作用。
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"]}
我也尝试打http://localhost:9999/management/jhimetrics,这里出现404错误。
有人遇到类似问题或有解决方案吗?请帮忙。