【问题标题】:adding end points in prometheus integration在 prometheus 集成中添加端点
【发布时间】:2019-01-23 16:07:47
【问题描述】:

如何在prometheus 中添加/集成 rest api 端点。例如,在splunk 中,我们正在监控微服务事务和日志。

让我们在春季靴子下面说:-

/abc/v1/something
/abce/v1/something2

在一行中:-我们如何将上述微服务端点添加到prometheus 以进行运动

【问题讨论】:

  • 你能澄清一下你的问题吗?我假设您有一堆 Spring Boot(哪个版本?)应用程序,并且您想公开这些应用程序中的指标以供 Prometheus 直接抓取?
  • 嗨@mweirauch。目前,我们正在使用 splunk 进行日志和警报监控。在 Spring Boot 2 上拥有微服务。现在我们需要在作为数据源的 grafana 和 prometheus 中实现对特定 api 的事务(例如响应时间、延迟)的监控。所以寻找我们如何在 prometheus 中添加数据点或如何在 prometheus 中提取数据。

标签: spring-boot prometheus micrometer


【解决方案1】:

使用 Spring Boot 2 时,您可以轻松地为 Prometheus 公开您的应用程序指标。见here。您可以将spring-boot-starter-actuator 和带有micrometer-registry-prometheus 的Prometheus 支持添加到您的依赖项中。

这将以 Prometheus 展示格式公开/actuator/prometheus 下的指标,以供您的 Prometheus 实例抓取。

假设您使用的是 Spring WebMvc,那么您将获得 HTTP 端点的开箱即用指标。 (Jersey 支持还提供了一个额外的模块/依赖项。)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-01-16
    • 2023-01-02
    • 1970-01-01
    • 1970-01-01
    • 2019-11-28
    • 1970-01-01
    • 1970-01-01
    • 2019-03-26
    相关资源
    最近更新 更多