Skip to content

feat: expose the Prometheus Metrics library version - #2654

Merged
zeitlinger merged 1 commit into
mainfrom
feat/library-version-api
Nov 6, 2026
Merged

zeitlinger merged 1 commit into
mainfrom
feat/library-version-api

Conversation

@zeitlinger

Copy link
Copy Markdown
Member

I added io.prometheus.metrics.core.PrometheusMetricsVersion.getVersion() to expose the Maven version of the prometheus-metrics-core artifact, including -SNAPSHOT during development. The value is generated from ${project.version} during the Maven build.

String version = io.prometheus.metrics.core.PrometheusMetricsVersion.getVersion();

I added a version test, documented the API in the quickstart, and updated the generated core API diff. The packaged core jar and sources jar both include the version API and generated metadata.

mise run test, mise run lint:fix, mise run api-diff, and ./mvnw install -DskipTests -DskipITs -Dcoverage.skip=true passed. mise run build compiled the reactor but its exporter integration tests could not run because the container has no Docker socket.

Fixes #2645.

Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

⚠️ API changes detected — maintainer review required

This PR modifies the published API diff for the following module(s):

  • prometheus-metrics-core

Please review the changes in docs/apidiffs/current_vs_latest/ carefully before approving.

@zeitlinger
zeitlinger marked this pull request as ready for review November 5, 2026 17:55
@zeitlinger
zeitlinger merged commit 744b536 into main Nov 6, 2026
28 of 29 checks passed
@zeitlinger
zeitlinger deleted the feat/library-version-api branch November 6, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose library version as a field

2 participants