Spring Boot 业务指标。千分尺及Prometheus 或 InfluxDB
我们需要在系统中计算和可视化一些业务指标,例如:
- 最后配置的时间间隔内处理的事务总数 最后配置的时间间隔内的
- 平均处理时间 最后配置的时间间隔内
- 的最大处理时间
- 最后配置的时间间隔内的最小处理时间
我必须以某种方式从 SpringBoot 应用程序公开这些指标。
我检查了是否可以使用 Spring Boot Actuator 中内置的 Micrometer 库在应用程序级别(Spring boot)计算此类指标。不幸的是,我没有看到它允许使用 Meters 来计算特定方法执行的平均值或最小值(具有配置的时间间隔)。
使用 Prometheus 似乎也不是最好的主意,因为它适用于基于拉动的原则。在我看来,这可能会因为抓取间隔而导致结果不准确和延迟。
我的最后一个想法是将每个事务处理时间写入 InfluxDB 或类似的数据库,然后使用查询获取我需要的结果(业务指标)。但是,我担心这个解决方案的效率,因为它给每个业务交易带来了额外的时间,
您对此有何看法?我对千分尺的局限性的看法正确吗? influxDB 的想法听起来合理吗?也许还有另一种方法来解决这个问题?
We need in our system to calculate and visualize a couple of business metrics like:
- total number of transactions processed over last configured time interval
- average processing time over last configured time interval
- max processing time over last configured time interval
- min processing time over last configured time interval
I have to expose these metrics somehow from SpringBoot application.
I checked whether it is possible to calculate this type of metrics at the application level (Spring boot) using the Micrometer library built into the Spring Boot Actuator. Unfortunately, I don't see that it allows using Meters to calculate the average value or the minimum value of particular method execution (with configured time interval)
The use of Prometheus also doesn't seem to be the best idea because it works on the pull-based principle. It seems to me that this may render the results inaccurate and delayed because of scraping intervals.
My last idea is to write each transaction processing time to InfluxDB or a similar DB and then, using queries get the results I need (business metrics). However, I am worried about the efficiency of this solution as it introduces additional time to each business transaction
What do you think about it? Am I right about the limitations of the Micrometer? Does the idea from influxDB sound reasonable? Maybe another way to approach this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论