为了实现这个需求, 我把百度和SpringBoot文档翻了个底朝天 也没找到办法 我的这篇博客可以说是独一无二的
需求
在SpringBoot 自带/metrics监控 加入自定义数据 其中包括字符串
{
"mem":606528,
"mem.free":495247,
"processors":4,
"instance.uptime":3414,
"uptime":16469,
"systemload.average":-1,
"heap.committed":556544,
"heap.init":262144,
"heap.used":61296,
"heap":3701248,
"nonheap.committed":51544,
"nonheap.init":2496,
"nonheap.used":49985,
"nonheap":0,
"threads.peak":34,
"threads.daemon":28,
"threads.totalStarted":56,
"threads":30,
"classes":7114,
"classes.loaded":7114,
"classes.unloaded":0,
"gc.ps_scavenge.count":9,
"gc.ps_scavenge.time":205,
"gc.ps_marksweep.count":2,
"gc.ps_marksweep.time":138,
"exeTaskNum":1,
"dbTaskNum":2