Skip to content

feat: Expose version information as a Prometheus metric - #25028

Open
jason-p-pickering wants to merge 1 commit into
masterfrom
DHIS2-22064
Open

feat: Expose version information as a Prometheus metric#25028
jason-p-pickering wants to merge 1 commit into
masterfrom
DHIS2-22064

Conversation

@jason-p-pickering

@jason-p-pickering jason-p-pickering commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Adds VersionMetrics, which registers a dhis2_version_info gauge on the /api/metrics scrape endpoint, exposing the running instance's version, revision, and build time as labels (Prometheus "info" pattern —value is always 1, data lives in labels). Lets ops dashboards/alerts track which build is deployed alongside other DHIS2 metrics, without having to separately poll system/info.

Values are read once at startup from SystemService#getSystemInfo() (baked in at build time), so no runtime overhead. No-ops cleanly if no MeterRegistry is present.

Sample output:

# HELP dhis2_version_info DHIS2 build version, revision and build time, exposed as labels; value is always 1
# TYPE dhis2_version_info gauge
dhis2_version_info{build_time="2026-09-03T08:04:32Z",revision="86e3491",version="2.44-SNAPSHOT"} 1

@jason-p-pickering
jason-p-pickering requested review from a team and netroms September 3, 2026 08:25
@sonarqubecloud

sonarqubecloud Bot commented Sep 3, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants