Skip to content

Commit fa68aa7

Browse files
chore(main): release 1.6.1 (#2064)
🤖 I have created a release *beep* *boop* --- ## [1.6.1](v1.6.0...v1.6.1) (2026-04-27) ### Bug Fixes * Preserve original metric names in OM2 output ([#2058](#2058)) ([59a7a6d](59a7a6d)) ### Documentation * clarify 1.6.0 release notes ([#2062](#2062)) ([9e5d591](9e5d591)) * Document semantic PR title guidance ([#2060](#2060)) ([7277889](7277889)) --- > [!IMPORTANT] > Close and reopen this PR to trigger CI checks. --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent 60a1fbc commit fa68aa7

81 files changed

Lines changed: 128 additions & 79 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.6.0"
2+
".": "1.6.1"
33
}

CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
11
# Changelog
22

3+
## [1.6.1](https://github.com/prometheus/client_java/compare/v1.6.0...v1.6.1) (2026-04-27)
4+
5+
> Note: With the OM2 metric-name preservation fix in this release, OpenMetrics 2.0 can now be
6+
> tested. It is still in progress and not ready for general use yet.
7+
8+
### Bug Fixes
9+
10+
* 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))
11+
12+
13+
### Documentation
14+
15+
* clarify 1.6.0 release notes ([#2062](https://github.com/prometheus/client_java/issues/2062)) ([9e5d591](https://github.com/prometheus/client_java/commit/9e5d591f4c2e8e0d39ce5141ac14fff057b09c67))
16+
* Document semantic PR title guidance ([#2060](https://github.com/prometheus/client_java/issues/2060)) ([7277889](https://github.com/prometheus/client_java/commit/727788942cccbecfa57d75eee9fb3e942083a95e))
17+
318
## [1.6.0](https://github.com/prometheus/client_java/compare/v1.5.1...v1.6.0) (2026-04-25)
419

520
> Note: OpenMetrics 2.0 support is still in progress and not ready for general use yet.
21+
>
22+
> As part of the OM2 work, metric-name suffix handling moved from metric creation time to scrape
23+
> time. A positive side effect is that metric names are now more flexible across the board, for
24+
> example names ending in suffixes like `_total` are accepted where they were previously rejected.
25+
> To keep the Prometheus and OM1 output unambiguous, the registry tracks claimed exposition names
26+
> and still rejects registrations that would collide at scrape time.
27+
>
28+
> | Example | Before 1.6.0 | Since 1.6.0 | Reason |
29+
> | --- | --- | --- | --- |
30+
> | `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. |
31+
> | `Counter("events_total")` | Rejected | Allowed | Not breaking because the OM1 output is still `events_total`; only the builder now accepts the name. |
32+
> | `Gauge("foo_total")` + `Histogram("foo")` | Rejected | Allowed | Not breaking because this combination used to be blocked even though the exposed names do not overlap. |
33+
> | `Gauge("events_total")` + `Counter("events")` | Rejected | Rejected | Not breaking because the ambiguous OM1 output would still expose two `events_total` series. |
34+
> | `Gauge("foo_count")` + `Histogram("foo")` | Allowed | Rejected | Intentionally breaking because the old behavior could expose a conflicting `foo_count` name at scrape time. |
635
736
### Features
837

benchmarks/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.prometheus</groupId>
77
<artifactId>client_java</artifactId>
8-
<version>1.6.1-SNAPSHOT</version>
8+
<version>1.6.1</version>
99
</parent>
1010

1111
<artifactId>benchmarks</artifactId>

docs/content/getting-started/registry.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,26 @@ Counter eventsTotal2 = Counter.builder()
7878
.register(); // IllegalArgumentException, because a metric with that name is already registered
7979
```
8080

81+
## Suffix-Based Name Validation
82+
83+
Suffix handling happens at scrape time. This makes metric names more flexible while keeping the
84+
exposed output unambiguous.
85+
86+
The registry now tracks not only the metric names you register, but also the exposition names they
87+
would claim in OpenMetrics 1.x and Prometheus text format, such as `_total`, `_count`, `_sum`,
88+
`_bucket`, `_created`, and `_info`.
89+
90+
This means names are accepted when they are safe, and combinations are rejected when they would
91+
collide at scrape time. The table below also shows the pre-1.6.0 behavior for comparison.
92+
93+
| Example | Before 1.6.0 | Current behavior | Why |
94+
| --------------------------------------------- | ------------ | ---------------- | ------------------------------------------------------------------------------------------------- |
95+
| `Gauge("foo_total")` | Rejected | Allowed | Safe because `_total` suffix expansion applies to counters, not gauges. |
96+
| `Counter("events_total")` | Rejected | Allowed | Safe because the OM1 output is `events_total`; the writer avoids double-appending `_total`. |
97+
| `Gauge("foo_total")` + `Histogram("foo")` | Rejected | Allowed | Safe because the exposed names do not overlap: `foo_total` vs `foo_bucket`/`foo_count`/`foo_sum`. |
98+
| `Gauge("events_total")` + `Counter("events")` | Rejected | Rejected | Rejected because both would expose `events_total` in OM1. |
99+
| `Gauge("foo_count")` + `Histogram("foo")` | Allowed | Rejected | Rejected because both would claim `foo_count` at scrape time. |
100+
81101
## Validation at registration only
82102

83103
Validation of duplicate metric names and label schemas happens at registration time only.

examples/example-custom-buckets/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.prometheus</groupId>
66
<artifactId>example-custom-buckets</artifactId>
7-
<version>1.6.1-SNAPSHOT</version>
7+
<version>1.6.1</version>
88

99
<properties>
1010
<maven.compiler.release>8</maven.compiler.release>

examples/example-exemplars-tail-sampling/example-greeting-service/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.prometheus</groupId>
66
<artifactId>example-greeting-service</artifactId>
7-
<version>1.6.1-SNAPSHOT</version>
7+
<version>1.6.1</version>
88

99
<properties>
1010
<maven.compiler.release>17</maven.compiler.release>

examples/example-exemplars-tail-sampling/example-hello-world-app/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.prometheus</groupId>
66
<artifactId>example-hello-world-app</artifactId>
7-
<version>1.6.1-SNAPSHOT</version>
7+
<version>1.6.1</version>
88

99
<properties>
1010
<maven.compiler.release>17</maven.compiler.release>

examples/example-exemplars-tail-sampling/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.prometheus</groupId>
66
<artifactId>example-exemplars-tail-sampling</artifactId>
7-
<version>1.6.1-SNAPSHOT</version>
7+
<version>1.6.1</version>
88
<packaging>pom</packaging>
99

1010
<name>Example - Exemplars with OpenTelemetry's Tail Sampling</name>

examples/example-exporter-httpserver/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.prometheus</groupId>
66
<artifactId>example-exporter-httpserver</artifactId>
7-
<version>1.6.1-SNAPSHOT</version>
7+
<version>1.6.1</version>
88

99
<properties>
1010
<maven.compiler.release>8</maven.compiler.release>

examples/example-exporter-multi-target/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<groupId>io.prometheus</groupId>
66
<artifactId>example-exporter-multi-target</artifactId>
7-
<version>1.6.1-SNAPSHOT</version>
7+
<version>1.6.1</version>
88

99
<properties>
1010
<maven.compiler.release>8</maven.compiler.release>

0 commit comments

Comments
 (0)