Prometheus Go client

Frameworks & LibrariesApache-2.0

Prometheus instrumentation library for Go.

Latest v1.25.0 · by PrometheusWritten in GoWebsiteprometheus/client_golangRSS

Release activity

Release activity — 5 releases across 5 days in the last year. Each cell is one day; darker means more releases that day. Older weeks are hidden at this screen width.
AugSepOctNov
SundayNo releases on Jul 19, 2026No releases on Jul 26, 2026No releases on Aug 2, 2026No releases on Aug 9, 2026No releases on Aug 16, 2026No releases on Aug 23, 2026No releases on Aug 30, 2026No releases on Sep 6, 2026No releases on Sep 13, 2026No releases on Sep 20, 2026No releases on Sep 27, 2026No releases on Oct 4, 2026No releases on Oct 11, 2026No releases on Oct 18, 2026No releases on Oct 25, 2026No releases on Nov 1, 2026
Monday1 release on Jul 20, 2026No releases on Jul 27, 2026No releases on Aug 3, 2026No releases on Aug 10, 2026No releases on Aug 17, 2026No releases on Aug 24, 2026No releases on Aug 31, 2026No releases on Sep 7, 2026No releases on Sep 14, 2026No releases on Sep 21, 2026No releases on Sep 28, 20261 release on Oct 5, 2026No releases on Oct 12, 2026No releases on Oct 19, 2026No releases on Oct 26, 2026No releases on Nov 2, 2026
TuesdayNo releases on Jul 21, 2026No releases on Jul 28, 2026No releases on Aug 4, 2026No releases on Aug 11, 2026No releases on Aug 18, 2026No releases on Aug 25, 2026No releases on Sep 1, 2026No releases on Sep 8, 2026No releases on Sep 15, 2026No releases on Sep 22, 2026No releases on Sep 29, 2026No releases on Oct 6, 2026No releases on Oct 13, 2026No releases on Oct 20, 2026No releases on Oct 27, 2026No releases on Nov 3, 2026
WednesdayNo releases on Jul 22, 2026No releases on Jul 29, 2026No releases on Aug 5, 2026No releases on Aug 12, 2026No releases on Aug 19, 2026No releases on Aug 26, 2026No releases on Sep 2, 2026No releases on Sep 9, 2026No releases on Sep 16, 2026No releases on Sep 23, 2026No releases on Sep 30, 2026No releases on Oct 7, 2026No releases on Oct 14, 2026No releases on Oct 21, 2026No releases on Oct 28, 2026No releases on Nov 4, 2026
ThursdayNo releases on Jul 23, 2026No releases on Jul 30, 2026No releases on Aug 6, 2026No releases on Aug 13, 2026No releases on Aug 20, 2026No releases on Aug 27, 2026No releases on Sep 3, 2026No releases on Sep 10, 2026No releases on Sep 17, 2026No releases on Sep 24, 2026No releases on Oct 1, 20261 release on Oct 8, 2026No releases on Oct 15, 2026No releases on Oct 22, 2026No releases on Oct 29, 2026No releases on Nov 5, 2026
Friday1 release on Jul 24, 2026No releases on Jul 31, 2026No releases on Aug 7, 2026No releases on Aug 14, 2026No releases on Aug 21, 2026No releases on Aug 28, 2026No releases on Sep 4, 2026No releases on Sep 11, 2026No releases on Sep 18, 2026No releases on Sep 25, 2026No releases on Oct 2, 2026No releases on Oct 9, 2026No releases on Oct 16, 2026No releases on Oct 23, 2026No releases on Oct 30, 2026No releases on Nov 6, 2026
SaturdayNo releases on Jul 25, 2026No releases on Aug 1, 2026No releases on Aug 8, 2026No releases on Aug 15, 2026No releases on Aug 22, 2026No releases on Aug 29, 2026No releases on Sep 5, 2026No releases on Sep 12, 2026No releases on Sep 19, 2026No releases on Sep 26, 2026No releases on Oct 3, 2026No releases on Oct 10, 2026No releases on Oct 17, 2026No releases on Oct 24, 2026No releases on Oct 31, 2026No releases on Nov 7, 2026

5 releases in the last year

Changelog

v1.25.0

Latest
Added 2
  • 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
Changed 6
  • 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
Fixed 3
  • 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, and LabelValues now return Infos annotations in addition to Warnings, matching the Prometheus server's info annotations. This changes the signatures of these methods and of api.Client's Do/DoGetFallback; custom API client implementations must be updated. #1963
  • [CHANGE] api/prometheus/v1: Rework TSDBBlocks result types to align with the Prometheus server's tsdb.BlockMeta: 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. #1928
  • [FEATURE] testutil: Add GatherAndFormat to encode a subset of metrics from a Gatherer. #2091
  • [FEATURE] 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. #2146
  • [ENHANCEMENT] promhttp: Negotiated metrics responses now include a Vary header. #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 GatherAndFormat and CollectAndFormat (terminating # EOF). #2125
  • [BUGFIX] api: Match complete URL path placeholders only; a :foo argument 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
New Contributors

Full Changelog: https://github.com/prometheus/client_golang/compare/v1.24.1...v1.25.0

View originalPermalink
How v1.25.0 went

v1.25.0-rc.0

Pre-release
Added 2
  • testutil: GatherAndFormat encodes a subset of metrics from a Gatherer
  • promhttp: HandlerOpts.AcceptedFormats customizes the formats negotiated from the incoming Accept header, allowing opt-in to experimental formats such as OpenMetrics 2.0
Changed 6
  • 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, matching the Prometheus server's info annotations
  • api/prometheus/v1: TSDBBlocksResult now contains Blocks []TSDBBlockMeta directly instead of mirroring the full API envelope, with nested types renamed, stat fields as uint64 with omitempty tags, and the optional compaction parents field included
  • promhttp: Negotiated metrics responses now include a Vary header
  • prometheus: Default runtime collector metrics regenerated for Go 1.25 and Go 1.26
  • testutil: GatherAndFormat and CollectAndFormat finalize OpenMetrics output with a terminating # EOF
Fixed 3
  • api: URL path placeholders match only complete path segments, so a :foo argument no longer substitutes inside :foobar
  • exp/api/remote: The pooled buffer is reset before generic proto marshaling, preventing corrupted remote-write payloads
  • testutil/promlint: The "mibi" unit prefix is corrected to "mebi"
View originalRead the notes
How v1.25.0-rc.0 went
v1.24.1

v1.24.1 / 2026-07-23

Fixed 1
  • promhttp: Fix panic on requests with nil URL.
View originalRead the notes
How v1.24.1 went
v1.24.0

v1.24.0 - 2026-07-20

Added 9
  • New Go 1.26 runtime metrics for goroutines and threads: /sched/goroutines-created:goroutines, /sched/goroutines/not-in-go:goroutines, /sched/goroutines/runnable:goroutines, /sched/goroutines/running:goroutines, /sched/goroutines/waiting:goroutines, and /sched/threads/total:threads
  • WithUnit(unit string) option and explicit OpenMetrics unit support in CounterOpts, GaugeOpts, SummaryOpts, and HistogramOpts
  • Public Err() method on Desc to expose descriptor construction errors
  • Opt-in HandlerOpts.CoalesceGather to deduplicate concurrent Gather calls so overlapping scrapes share one collection cycle
  • promhttp handlers support metrics filtering via one or more name[] query parameters, returning all metrics when none are provided
  • Query formatting endpoint support (/format_query) with a FormatQuery(ctx context.Context, query string) (string, error) method
Changed 7
  • Minimum required Go version is now 1.25, and only the two latest Go versions (1.25 and 1.26) are supported
  • Name validation now always uses the UTF-8 scheme instead of the deprecated model.NameValidationScheme global; default behavior is unchanged, but setting NameValidationScheme to LegacyValidation no longer enforces legacy validation at metric, label, and push-grouping construction
  • The Rules method in api/prometheus/v1 supports matchers via the matches[] parameter, with signature Rules(ctx context.Context, matches []string) (RulesResult, error)
  • The LabelNames method in api/prometheus/v1 returns model.LabelNames instead of []string for consistency across the API
  • The exp/api/remote Store interface is simplified, Handler is renamed to WriteHandler, and write response handling is encapsulated
  • The version collector in prometheus/collectors/version allows specifying custom labels when registering
  • Default HTTP clients are constructed from a cloned http.DefaultTransport to prevent accidental mutations of shared global transport state
Fixed 7
  • Collector panics during Gather() are recovered and returned as an error instead of crashing the process
  • The cpu-seconds unit suffix handling for metric go_cpu_classes_gc_mark_assist_cpu_seconds is corrected
  • InstrumentHandlerDuration and InstrumentHandlerCounter no longer panic when given an observer or counter that does not implement ExemplarObserver or ExemplarAdder; the exemplar is dropped and the value is recorded via the plain Observe or Add path
  • API client falls back to GET requests when POST requests return 403 Forbidden or method not allowed
  • Context cancellation is respected inside httpClient.Do
  • Compression buffer pooling in exp/api/remote no longer releases compressed buffers prematurely, which had caused corrupted remote-write payloads
  • Remote write v2 headers can no longer be returned on v1 requests
Security 1
  • Malformed snappy payloads declaring huge decoded sizes are rejected, enforcing a 32MB decoded-size limit to prevent OOM from oversized remote-write requests
View originalRead the notes
How v1.24.0 went
v1.24.0-rc.0Pre-release

v1.24.0-rc.0 - 2026-07-17

Added 9
  • Go 1.26 runtime metrics are added for goroutines created, goroutines not in Go, goroutines runnable, goroutines running, goroutines waiting, and total threads
  • A WithUnit(unit string) option and explicit OpenMetrics unit support are added to CounterOpts, GaugeOpts, SummaryOpts, and HistogramOpts
  • The descriptor construction error is exposed through a public Err() method on Desc
  • An opt-in HandlerOpts.CoalesceGather option deduplicates concurrent Gather calls so overlapping scrapes share one collection cycle
  • promhttp handlers support metrics filtering via one or more name[] query parameters, with the default still returning all metrics
  • Query formatting endpoint support (/format_query) and a FormatQuery(ctx context.Context, query string) (string, error) method are added to api/prometheus/v1
Changed 7
  • Minimum required Go version is now 1.25, and only the two latest Go versions (1.25 and 1.26) are supported
  • Name validation now always uses the UTF-8 scheme instead of the deprecated model.NameValidationScheme global; default behavior is unchanged, and code setting NameValidationScheme to LegacyValidation no longer gets legacy enforcement at metric, label, and push-grouping construction
  • The Rules method in api/prometheus/v1 supports matchers via the matches[] parameter, with signature Rules(ctx context.Context, matches []string) (RulesResult, error)
  • The LabelNames method in api/prometheus/v1 returns model.LabelNames instead of []string for consistency across the API
  • The exp/api/remote Store interface is simplified, Handler is renamed to WriteHandler, and write response handling is encapsulated
  • The version collector in prometheus/collectors/version allows specifying custom labels when registering
  • Default HTTP clients use a cloned http.DefaultTransport to prevent accidental mutations of shared global transport state
Fixed 7
  • Collector panics during Gather() are recovered and returned as an error instead of crashing the process
  • The cpu-seconds unit suffix handling is fixed for the metric go_cpu_classes_gc_mark_assist_cpu_seconds
  • InstrumentHandlerDuration and InstrumentHandlerCounter no longer panic when given an observer or counter that does not implement ExemplarObserver or ExemplarAdder; the exemplar is dropped and the value is recorded via the plain Observe or Add path
  • api/prometheus/v1 falls back to GET requests when POST requests return 403 Forbidden or method not allowed
  • Context cancellation is respected inside httpClient.Do
  • Compression buffer pooling in exp/api/remote no longer releases compressed buffers prematurely, which had caused corrupted remote-write payloads
  • Remote write v2 headers can no longer be returned on v1 requests in exp/api/remote
Security 1
  • Malformed snappy payloads declaring huge decoded sizes are rejected, enforcing a 32MB decoded-size limit to prevent OOM from oversized remote-write requests
View originalRead the notes
How v1.24.0-rc.0 went
v1.23.2

v1.23.2 - 2025-09-05

Changed 1
  • Upgrade prometheus/common dependency to v0.66.1, which drops the github.com/grafana/regexp and go.uber.org/atomic dependencies and replaces gopkg.in/yaml.v2 with go.yaml.in/yaml/v2
View originalRead the notes
How v1.23.2 went
v1.23.1

v1.23.1 - 2025-09-04

Changed 1
  • Upgraded the prometheus/common dependency to v0.66 to remain compatible with a backwards incompatible API change in that release
View originalRead the notes
How v1.23.1 went
v1.23.0

v1.23.0 - 2025-07-30

Added 2
  • Add WrapCollectorWith and WrapCollectorWithPrefix
  • Add exemplars for native histograms
Changed 3
  • Minimum required Go version is now 1.23, and only the two latest Go versions are supported from now on
  • exp/api: Bubble up status code from writeResponse
  • collector/go: Update runtime metrics for Go v1.23 and v1.24
Fixed 1
  • exp/api: client prompt return on context cancellation
View originalRead the notes
How v1.23.0 went
v1.23.0-rc.1Pre-release

v1.23.0-rc.1 - 2025-07-15

Added 2
  • Add WrapCollectorWith and WrapCollectorWithPrefix
  • Add exemplars for native histograms
Changed 3
  • Minimum required Go version is now 1.23, and only the two latest Go versions are supported from now on
  • exp/api: Bubble up status code from writeResponse
  • collector/go: Update runtime metrics for Go v1.23 and v1.24
Fixed 1
  • exp/api: client prompt return on context cancellation
View originalRead the notes
How v1.23.0-rc.1 went
v1.22.0

v1.22.0 - 2025-04-07

Added 2
  • Add new CollectorFunc utility to the prometheus package
  • Add WithLookbackDelta and WithStats options to the API client
Changed 2
  • Minimum required Go version is now 1.22, and client_golang is also tested against Go 1.24
  • Isolate zstd support and klauspost/compress library use to the promhttp/zstd package, requiring a blank import to enable experimental zstd scrape support
View originalRead the notes
How v1.22.0 went
View all

Discussion

If you publish Prometheus Go client, you can claim this product by proving you administer its repository.