micrometer-metrics/micrometer

Provide binders for Git and Build information

Open

#3,154 建立於 2022年5月1日

在 GitHub 查看
 (7 留言) (2 反應) (0 負責人)Java (935 fork)batch import
help wanted

倉庫指標

Star
 (4,220 star)
PR 合併指標
 (平均合併 1天 21小時) (30 天內合併 100 個 PR)

描述

Description There has been some discussion at the Spring Boot project about exposing information like the Git commit ID and Maven coordinates as metrics, similar in style to the existing JvmInfoMetrics binder. For consistency, we would provide the same information that Spring Boot's Actuator exposes on its /actuator/info endpoint.

The binders would receive the data via constructor arguments and add a constant gauge with tags for all attributes we want to expose. If some values are null, we would add a marker string ("unknown", "null", "N/A") to make sure all tags are always present.

Example:

git_info{app="some-service", branch="main", id="cafecafe", time="2022-04-26T18:39:18Z"} 1.0
build_info{app="some-service", name="Some Service", artifact="some-service", group="org.example", version="1.7", time="2022-04-28T12:01:07Z"} 1.0

This issue is intended to discuss whether this is a worthwhile addition and to discuss the design if the team decides to proceed.

Rationale Adding metrics binders to Micrometer would provide standardization of these metrics across all users of Micrometer, not just Spring Boot. The new metrics would be useful in Grafana dashboards, for example, to display which exact commit/version is currently deployed.

Additional context

貢獻者指南