简体   繁体   中英

Getting micrometer metrics from a jar to a spring boot application

I have a spring boot application in which I use the jar. In that jar, I have integrated micrometre timers to measure some code flows, now I want those metrics to be sent to data dog. Is there a way to do that? when I ran my spring boot (2.4.4) application and hit the endpoint localhost:/actuator/metrics, I got

{"names":[]}

which means the spring boot application cannot pick up the timers. Can anyone please help me with this

PS I have added this config too.

management:
  endpoints:
    web:
      exposure:
        include: "*"
  metrics:
    enable:
      all: true

Your metrics endpoint is empty but it should not be out of the box. This means that you did something that broke it. If you are creating a MeterRegistry manually or use the global, try to inject the registry that Boot creates into your components instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM