我有一个在 Cloud Foundry 上运行的 Spring Boot 应用程序,它分别通过/metrics 和/health 端点公开指标和运行状况信息。我想将这些指标作为连续流发布到 influxDB 用户提供的服务,以便在 grafana 仪表板上进行可视化。我正在寻找任何可以解释数据流如何工作的资源,并且希望得到任何建议。
谢谢。
最佳答案
据我所知,目前还没有现成的解决方案。 但是,您可以做的是实现自定义 Exporter对于 InfluxDB。
如何在 Spring Boot 中执行此操作的详细信息可以参见 here 。 本质上,您需要实现的是一个导出器,它将 Spring Boot 指标数据转换为 InfluxDB 的 line protocol
另一个可能的解决方案是获取 Spring Boot metrics into Dropwizard metrics然后使用 this用于将 Dropwizard 指标报告到 InfluxDB 的外部库(或使用已经是 InfluxDB 后端的 dropwizard 指标的 master 分支)。
最后,如果您想放弃 InfluxDB 并将数据保存到 Graphite 的存储(Whisper 数据库)中,您应该查看 this或this 。一旦数据进入 Graphite,Grafana 就可以轻松地将其可视化,如图 here 所示。
关于spring-boot - 将 Spring Boot 指标暴露给 influxDB 以实现 grafana 可视化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32656246/