Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/config/.release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.6.0"
".": "1.6.1"
}
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
# Changelog

## [1.6.1](https://github.com/prometheus/client_java/compare/v1.6.0...v1.6.1) (2026-04-27)

> Note: With the OM2 metric-name preservation fix in this release, OpenMetrics 2.0 can now be
> tested. It is still in progress and not ready for general use yet.

### Bug Fixes

* Preserve original metric names in OM2 output ([#2058](https://github.com/prometheus/client_java/issues/2058)) ([59a7a6d](https://github.com/prometheus/client_java/commit/59a7a6d4d5a9eb31c33167764b11ba96d6625b74))


### Documentation

* clarify 1.6.0 release notes ([#2062](https://github.com/prometheus/client_java/issues/2062)) ([9e5d591](https://github.com/prometheus/client_java/commit/9e5d591f4c2e8e0d39ce5141ac14fff057b09c67))
* Document semantic PR title guidance ([#2060](https://github.com/prometheus/client_java/issues/2060)) ([7277889](https://github.com/prometheus/client_java/commit/727788942cccbecfa57d75eee9fb3e942083a95e))

## [1.6.0](https://github.com/prometheus/client_java/compare/v1.5.1...v1.6.0) (2026-04-25)

> Note: OpenMetrics 2.0 support is still in progress and not ready for general use yet.
>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some docs that were forgotten in last release

> As part of the OM2 work, metric-name suffix handling moved from metric creation time to scrape
> time. A positive side effect is that metric names are now more flexible across the board, for
> example names ending in suffixes like `_total` are accepted where they were previously rejected.
> To keep the Prometheus and OM1 output unambiguous, the registry tracks claimed exposition names
> and still rejects registrations that would collide at scrape time.
>
> | Example | Before 1.6.0 | Since 1.6.0 | Reason |
> | --- | --- | --- | --- |
> | `Gauge("foo_total")` | Rejected | Allowed | Not breaking because this previously failed at registration, so no working setup changes behavior, and safe because `_total` suffix expansion applies to counters, not gauges. |
> | `Counter("events_total")` | Rejected | Allowed | Not breaking because the OM1 output is still `events_total`; only the builder now accepts the name. |
> | `Gauge("foo_total")` + `Histogram("foo")` | Rejected | Allowed | Not breaking because this combination used to be blocked even though the exposed names do not overlap. |
> | `Gauge("events_total")` + `Counter("events")` | Rejected | Rejected | Not breaking because the ambiguous OM1 output would still expose two `events_total` series. |
> | `Gauge("foo_count")` + `Histogram("foo")` | Allowed | Rejected | Intentionally breaking because the old behavior could expose a conflicting `foo_count` name at scrape time. |

### Features

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>benchmarks</artifactId>
Expand Down
20 changes: 20 additions & 0 deletions docs/content/getting-started/registry.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,26 @@ Counter eventsTotal2 = Counter.builder()
.register(); // IllegalArgumentException, because a metric with that name is already registered
```

## Suffix-Based Name Validation
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some docs that were forgotten in last release


Suffix handling happens at scrape time. This makes metric names more flexible while keeping the
exposed output unambiguous.

The registry now tracks not only the metric names you register, but also the exposition names they
would claim in OpenMetrics 1.x and Prometheus text format, such as `_total`, `_count`, `_sum`,
`_bucket`, `_created`, and `_info`.

This means names are accepted when they are safe, and combinations are rejected when they would
collide at scrape time. The table below also shows the pre-1.6.0 behavior for comparison.

| Example | Before 1.6.0 | Current behavior | Why |
| --------------------------------------------- | ------------ | ---------------- | ------------------------------------------------------------------------------------------------- |
| `Gauge("foo_total")` | Rejected | Allowed | Safe because `_total` suffix expansion applies to counters, not gauges. |
| `Counter("events_total")` | Rejected | Allowed | Safe because the OM1 output is `events_total`; the writer avoids double-appending `_total`. |
| `Gauge("foo_total")` + `Histogram("foo")` | Rejected | Allowed | Safe because the exposed names do not overlap: `foo_total` vs `foo_bucket`/`foo_count`/`foo_sum`. |
| `Gauge("events_total")` + `Counter("events")` | Rejected | Rejected | Rejected because both would expose `events_total` in OM1. |
| `Gauge("foo_count")` + `Histogram("foo")` | Allowed | Rejected | Rejected because both would claim `foo_count` at scrape time. |

## Validation at registration only

Validation of duplicate metric names and label schemas happens at registration time only.
Expand Down
2 changes: 1 addition & 1 deletion examples/example-custom-buckets/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-custom-buckets</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>8</maven.compiler.release>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-greeting-service</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>17</maven.compiler.release>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-hello-world-app</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>17</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-exemplars-tail-sampling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-exemplars-tail-sampling</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
<packaging>pom</packaging>

<name>Example - Exemplars with OpenTelemetry's Tail Sampling</name>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-exporter-httpserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-exporter-httpserver</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>8</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-exporter-multi-target/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-exporter-multi-target</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>8</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-exporter-opentelemetry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-exporter-opentelemetry</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>8</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-exporter-servlet-tomcat/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-exporter-servlet-tomcat</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>17</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-native-histogram/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-native-histogram</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>8</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-otel-jvm-runtime-metrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-otel-jvm-runtime-metrics</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>8</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-prometheus-properties/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-prometheus-properties</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>8</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/example-simpleclient-bridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>io.prometheus</groupId>
<artifactId>example-simpleclient-bridge</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<properties>
<maven.compiler.release>8</maven.compiler.release>
Expand Down
2 changes: 1 addition & 1 deletion examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>examples</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/it-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>integration-tests</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>it-exporter</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-exporter-duplicate-metrics-sample</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>it-exporter</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-exporter-httpserver-sample</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>it-exporter</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-exporter-no-protobuf</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>it-exporter</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-exporter-servlet-jetty-sample</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>it-exporter</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-exporter-servlet-tomcat-sample</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/it-exporter/it-exporter-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>it-exporter</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-exporter-test</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>it-exporter</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-no-protobuf-test</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/it-exporter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>integration-tests</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-exporter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/it-pushgateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>integration-tests</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>it-pushgateway</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/it-spring-boot-smoke-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>io.prometheus</groupId>
<artifactId>it-spring-boot-smoke-test</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>

<name>Integration Test - Spring Smoke Tests</name>
<description>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>integration-tests</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"go:github.com/gohugoio/hugo" = "v0.160.1"
"go:github.com/grafana/oats" = "0.6.1"
java = "temurin-25.0.3+9.0.LTS"
lychee = "0.24.1"
lychee = "0.23.0"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that slipped through because of a gap in flint that will be fixed in next release (testing all files in version update)

node = "24.15.0"
"npm:renovate" = "43.129.1"
protoc = "34.1"
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java_parent</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
<relativePath>prometheus-metrics-parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion prometheus-metrics-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java_parent</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
<relativePath>../prometheus-metrics-parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion prometheus-metrics-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>prometheus-metrics-config</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion prometheus-metrics-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>prometheus-metrics-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion prometheus-metrics-exporter-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>prometheus-metrics-exporter-common</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion prometheus-metrics-exporter-httpserver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>prometheus-metrics-exporter-httpserver</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>prometheus-metrics-exporter-opentelemetry-otel-agent-resources</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion prometheus-metrics-exporter-opentelemetry-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>prometheus-metrics-exporter-opentelemetry</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion prometheus-metrics-exporter-opentelemetry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.prometheus</groupId>
<artifactId>client_java</artifactId>
<version>1.6.1-SNAPSHOT</version>
<version>1.6.1</version>
</parent>

<artifactId>prometheus-metrics-exporter-opentelemetry-no-otel</artifactId>
Expand Down
Loading