- testutil: Add GatherAndFormat to encode a subset of metrics from a Gatherer
- promhttp: Add HandlerOpts.AcceptedFormats to customize the formats negotiated from the incoming Accept header, enabling opt-in to experimental formats such as OpenMetrics 2.0 without changing default negotiation
- Minimum required Go version is now 1.26, and only the two latest Go versions (1.26 and 1.27) are supported
- api/prometheus/v1: Query, QueryRange, Series, LabelNames, and LabelValues now return Infos annotations in addition to Warnings, changing the signatures of these methods and of api.Client's Do and DoGetFallback; custom API client implementations must be updated
- api/prometheus/v1: TSDBBlocksResult now contains Blocks []TSDBBlockMeta directly instead of mirroring the full API envelope, nested types are renamed (TSDBBlockMeta, TSDBBlockStats, TSDBBlockMetaCompaction), stat fields are uint64 with omitempty tags, and the optional compaction parents field is included
- promhttp: Negotiated metrics responses now include a Vary header
- prometheus: Regenerate the default runtime collector metrics for Go 1.25 and Go 1.26
- testutil: Finalize OpenMetrics output in GatherAndFormat and CollectAndFormat with a terminating # EOF
- api: Match complete URL path placeholders only, so a :foo argument no longer substitutes inside :foobar
- exp/api/remote: Reset the pooled buffer before generic proto marshaling, preventing corrupted remote-write payloads
- testutil/promlint: Fix the "mibi" unit prefix to "mebi"
From Prometheus Go client
:warning: This release raises the minimum required Go version to 1.26 and includes breaking API changes in api/prometheus/v1 (see the [CHANGE] entries below). :warning:
1.25.0 / 2026-10-07
- [CHANGE] Minimum required Go version is now 1.26, only the two latest Go versions (1.26 and 1.27) are supported from now on. #2138
- [CHANGE] api/prometheus/v1:
Query,QueryRange,Series,LabelNames, andLabelValuesnow returnInfosannotations in addition toWarnings, matching the Prometheus server's info annotations. This changes the signatures of these methods and ofapi.Client'sDo/DoGetFallback; custom API client implementations must be updated. #1963 - [CHANGE] api/prometheus/v1: Rework
TSDBBlocksresult types to align with the Prometheus server'stsdb.BlockMeta:TSDBBlocksResultnow containsBlocks []TSDBBlockMetadirectly instead of mirroring the full API envelope, nested types are renamed (TSDBBlockMeta,TSDBBlockStats,TSDBBlockMetaCompaction), stat fields areuint64withomitemptytags, and the optional compactionparentsfield is included. #1928 - [FEATURE] testutil: Add
GatherAndFormatto encode a subset of metrics from a Gatherer. #2091 - [FEATURE] promhttp: Add
HandlerOpts.AcceptedFormatsto customize the formats negotiated from the incomingAcceptheader, enabling opt-in to experimental formats such as OpenMetrics 2.0 without changing default negotiation. #2146 - [ENHANCEMENT] promhttp: Negotiated metrics responses now include a
Varyheader. #2142 - [ENHANCEMENT] prometheus: Regenerate the default runtime collector metrics for Go 1.25 and Go 1.26. #2090, #2095
- [ENHANCEMENT] testutil: Finalize OpenMetrics output in
GatherAndFormatandCollectAndFormat(terminating# EOF). #2125 - [BUGFIX] api: Match complete URL path placeholders only; a
:fooargument no longer substitutes inside:foobar. #2136 - [BUGFIX] exp/api/remote: Reset the pooled buffer before generic proto marshaling, preventing corrupted remote-write payloads. #2139
- [BUGFIX] testutil/promlint: Fix "mibi" unit prefix to "mebi". #2135
What's Changed
- fix: Remove unneeded and broken CI badge by @bwplotka in https://github.com/prometheus/client_golang/pull/2057
- Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/2060
- build(deps): bump the codeql group with 4 updates by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2066
- build(deps): bump github.com/klauspost/compress from 1.19.0 to 1.19.1 by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2071
- build(deps): bump golang.org/x/sys from 0.46.0 to 0.47.0 in the golang-org-x group across 1 directory by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2069
- build(deps): bump github.com/klauspost/compress from 1.19.0 to 1.19.1 in /exp by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2072
- build(deps): bump github.com/prometheus/common from 0.69.0 to 0.70.1 in /exp by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2073
- build(deps): bump github.com/prometheus/common from 0.69.0 to 0.70.1 by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2070
- build(deps): bump google.golang.org/grpc from 1.79.3 to 1.82.1 in /tutorials/whatsup by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2075
- Pin GitHub Actions by @SuperQ in https://github.com/prometheus/client_golang/pull/2074
- build(deps): bump actions/checkout from 7.0.0 to 7.0.1 by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2067
- promhttp: fix panic on requests with nil URL by @SAY-5 in https://github.com/prometheus/client_golang/pull/2065
- Return info annotations in addition to warnings in the API by @zenador in https://github.com/prometheus/client_golang/pull/1963
- build(deps): bump ossf/scorecard-action from 2.4.3 to 2.4.4 by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2082
- Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/2084
- Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/2086
- Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/2088
- Regenerate Go collector runtime metrics for Go 1.25 and Go 1.26 by @bwplotka in https://github.com/prometheus/client_golang/pull/2090
- go.mod: remove obsolete exclude rule by @thaJeztah in https://github.com/prometheus/client_golang/pull/2077
- Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/2093
- README: document the OpenTelemetry OTLP push bridge by @mvanhorn in https://github.com/prometheus/client_golang/pull/1987
- docs: add AGENTS.md contributor and maintainer guide by @bwplotka in https://github.com/prometheus/client_golang/pull/2056
- testutil: add GatherAndFormat helper by @wieghx in https://github.com/prometheus/client_golang/pull/2091
- build(deps): bump the codeql group with 4 updates by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2101
- build(deps): bump google.golang.org/protobuf from 1.36.11 to 1.36.12 by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2097
- build(deps): bump github.com/klauspost/compress from 1.19.1 to 1.19.2 by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2098
- build(deps): bump google.golang.org/protobuf from 1.36.11 to 1.36.12 in /exp by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2099
- build(deps): bump github.com/klauspost/compress from 1.19.1 to 1.19.2 in /exp by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2100
- build(deps): bump github.com/prometheus/procfs from 0.21.1 to 0.22.0 in the prometheus group across 1 directory by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2096
- build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 in /tutorials/whatsup by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2102
- chore: Update metrics for new Go version by @github-actions[bot] in https://github.com/prometheus/client_golang/pull/2095
- Benchmark json-iter, stdlib json and json/v2 by @liggitt in https://github.com/prometheus/client_golang/pull/2107
- build(deps): bump google.golang.org/grpc from 1.83.1 to 1.83.2 in /tutorials/whatsup by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2112
- RuleGroup: use stdlib for json decoding, optimize decoding by @liggitt in https://github.com/prometheus/client_golang/pull/2109
- Modernize micro benchmarks: b.Loop and key=value case names by @radianceded in https://github.com/prometheus/client_golang/pull/2114
- QueryResult: use stdlib for envelope decoding by @liggitt in https://github.com/prometheus/client_golang/pull/2110
- Use stdlib to decode apiResult envelope by @liggitt in https://github.com/prometheus/client_golang/pull/2111
- Improve linting by @SuperQ in https://github.com/prometheus/client_golang/pull/2115
- Delete unused custom json-iterator marshaling by @liggitt in https://github.com/prometheus/client_golang/pull/2121
- Simplify apiClientImpl#Do error path by @liggitt in https://github.com/prometheus/client_golang/pull/2120
- testutil: finalize OpenMetrics output by @ajavanma in https://github.com/prometheus/client_golang/pull/2125
- build(deps): bump go.opentelemetry.io/otel/sdk from 1.44.0 to 1.45.0 in /tutorials/whatsup by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2124
- Synchronize common files from prometheus/prometheus by @prombot in https://github.com/prometheus/client_golang/pull/2116
- prometheus: fix revive indent-error-flow lint on Darwin by @bwplotka in https://github.com/prometheus/client_golang/pull/2131
- build(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace from 1.34.0 to 1.45.0 in /tutorials/whatsup by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2123
- Combine envelope/inner apiResponse decoding, switch to stdlib json by @liggitt in https://github.com/prometheus/client_golang/pull/2118
- build(deps): bump go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc from 1.34.0 to 1.45.0 in /tutorials/whatsup by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2122
- testutil/promlint: fix "mibi" unit prefix to "mebi" by @ZainnQureshii in https://github.com/prometheus/client_golang/pull/2135
- all: update prometheus/common to v0.72.0 and apply modernize fixes by @bwplotka in https://github.com/prometheus/client_golang/pull/2138
- limit json-iterator use to Go 1.26 by @liggitt in https://github.com/prometheus/client_golang/pull/2128
- promhttp: add AcceptedFormats option to customize format negotiation by @bwplotka in https://github.com/prometheus/client_golang/pull/2146
- build(deps): bump github.com/klauspost/compress from 1.19.2 to 1.20.1 by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2143
- build(deps): bump the codeql group with 4 updates by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2145
- build(deps): bump github.com/klauspost/compress from 1.19.2 to 1.20.1 in /exp by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2144
- promhttp: vary negotiated metrics responses by @lowgame in https://github.com/prometheus/client_golang/pull/2142
- exp/api/remote: reset pooled buffer before generic marshal by @lowgame in https://github.com/prometheus/client_golang/pull/2139
- api: match complete URL placeholders by @lowgame in https://github.com/prometheus/client_golang/pull/2136
- fix: updates for tsdb blocks handling by @tjhop in https://github.com/prometheus/client_golang/pull/1928
- prometheus: fix modernize lint findings by @kakkoyun in https://github.com/prometheus/client_golang/pull/2151
- build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.2 in /api/prometheus/v1/paritytest by @dependabot[bot] in https://github.com/prometheus/client_golang/pull/2152
- Cut v1.25.0-rc.0 by @kakkoyun in https://github.com/prometheus/client_golang/pull/2154
- Cut v1.25.0 by @kakkoyun in https://github.com/prometheus/client_golang/pull/2164
New Contributors
- @SAY-5 made their first contribution in https://github.com/prometheus/client_golang/pull/2065
- @zenador made their first contribution in https://github.com/prometheus/client_golang/pull/1963
- @thaJeztah made their first contribution in https://github.com/prometheus/client_golang/pull/2077
- @mvanhorn made their first contribution in https://github.com/prometheus/client_golang/pull/1987
- @wieghx made their first contribution in https://github.com/prometheus/client_golang/pull/2091
- @radianceded made their first contribution in https://github.com/prometheus/client_golang/pull/2114
- @ajavanma made their first contribution in https://github.com/prometheus/client_golang/pull/2125
- @ZainnQureshii made their first contribution in https://github.com/prometheus/client_golang/pull/2135
- @lowgame made their first contribution in https://github.com/prometheus/client_golang/pull/2142
Full Changelog: https://github.com/prometheus/client_golang/compare/v1.24.1...v1.25.0