将千分尺从罐子中获取到弹簧启动应用程序

发布于 2025-02-06 05:58:22 字数 475 浏览 2 评论 0原文

我有一个弹簧启动应用程序,其中我使用罐子。 在那个JAR中,我集成了微米计时器以测量一些代码流, 现在,我希望将这些指标发送到数据犬。 有办法做到吗? 当我运行了Spring Boot(2.4.4)应用程序并击中Endpoint Localhost:/arectuator/Metrics时,我得到的

{"names":[]}

意味着Spring Boot应用程序无法拾取计时器。 任何人都可以帮助我使用此

P.SI添加了此配置。

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

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

P.S I have added this config too.

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦太阳 2025-02-13 05:58:25

您的指标端点是空的,但不应开箱即用。
这意味着您做了一些破坏它的事情。
如果要手动创建仪表报告或使用全局,请尝试将启动创建的注册表注入组件中。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文