feat: Upgrade prometheus to version 0.309.1#5479
Conversation
268513a to
ba80e07
Compare
🔍 Dependency ReviewBelow is a dependency-change review scoped to the Go module changes in this PR. For each changed dependency, I’ve checked its changelog and relevant upstream PRs where possible and assessed required code changes between the “as-is” and “to-be” versions. I’ve included compact, actionable diffs where code updates are needed and evidence links or reasoning in the details.
github.com/prometheus/prometheus v0.308.1 -> v0.309.1 — ❌ Changes NeededBreaking API change in storage.Appender:
Evidence
What to change (patterns applied in this PR)
- func (a *appender) AppendCTZeroSample(ref storage.SeriesRef, l labels.Labels, t, ct int64) (storage.SeriesRef, error) {
+ func (a *appender) AppendSTZeroSample(ref storage.SeriesRef, l labels.Labels, t, st int64) (storage.SeriesRef, error) {
...
}
- func (a *appender) AppendHistogramCTZeroSample(ref storage.SeriesRef, l labels.Labels, t, ct int64, h *histogram.Histogram, fh *histogram.FloatHistogram) (storage.SeriesRef, error) {
+ func (a *appender) AppendHistogramSTZeroSample(ref storage.SeriesRef, l labels.Labels, t, st int64, h *histogram.Histogram, fh *histogram.FloatHistogram) (storage.SeriesRef, error) {
...
}
- _, err := x.AppendCTZeroSample(ref, l, t, ct)
+ _, err := x.AppendSTZeroSample(ref, l, t, st)
- _, err := x.AppendHistogramCTZeroSample(ref, l, t, ct, h, fh)
+ _, err := x.AppendHistogramSTZeroSample(ref, l, t, st, h, fh)
- onAppendCTZeroSample func(ref storage.SeriesRef, l labels.Labels, t, ct int64, next storage.Appender) (storage.SeriesRef, error)
+ onAppendSTZeroSample func(ref storage.SeriesRef, l labels.Labels, t, st int64, next storage.Appender) (storage.SeriesRef, error)
- func WithCTZeroSampleHook(f func(ref storage.SeriesRef, l labels.Labels, t, ct int64, next storage.Appender) (storage.SeriesRef, error)) InterceptorOption
+ func WithSTZeroSampleHook(f func(ref storage.SeriesRef, l labels.Labels, t, st int64, next storage.Appender) (storage.SeriesRef, error)) InterceptorOption
- return a.child.AppendCTZeroSample(ref, l, t, ct)
+ return a.child.AppendSTZeroSample(ref, l, t, st)
- return a.child.AppendHistogramCTZeroSample(ref, l, t, ct, h, fh)
+ return a.child.AppendHistogramSTZeroSample(ref, l, t, st, h, fh)
- func (a *strictMetadataAppender) AppendCTZeroSample(...)
+ func (a *strictMetadataAppender) AppendSTZeroSample(...)
- func (a *strictMetadataAppender) AppendHistogramCTZeroSample(...)
+ func (a *strictMetadataAppender) AppendHistogramSTZeroSample(...)
- _, err := tr.AppendCTZeroSample(...)
+ _, err := tr.AppendSTZeroSample(...)
- _, err := tr.AppendHistogramCTZeroSample(...)
+ _, err := tr.AppendHistogramSTZeroSample(...)
- func (..., t, ct int64) { ... }
+ func (..., t, st int64) { ... }These changes maintain the previous behavior; only symbol names have changed to align with the upstream API. go.opentelemetry.io/collector/featuregate (remove custom replace) -> upstream v1.51.0 (indirect) —
|
|
TruffleHog Scan Results Summary: Found 11 potential secrets (0 verified, 11 unverified)
Review: Check if unverified secrets are false positives. |
# Prometheus Dependency Update — 2026-02-09 Upgraded `github.com/prometheus/prometheus` from v0.308.0 (v3.8.0) to v0.309.1 (v3.9.1) across all modules. The other Prometheus client libraries were already at their latest compatible versions. ## API changes in Prometheus v0.309.1 Prometheus renamed "Created Timestamp" to "Start Timestamp" throughout the `storage.Appender` interface: - `AppendCTZeroSample` → `AppendSTZeroSample` - `AppendHistogramCTZeroSample` → `AppendHistogramSTZeroSample` - `CreatedTimestampAppender` → `StartTimestampAppender` - `Commit()`/`Rollback()` moved into a new embedded `AppenderTransaction` interface (no code changes needed for this) All Alloy implementations of `storage.Appender` were updated to match. ## Fork of otel-contrib prometheusreceiver The upstream `receiver/prometheusreceiver` at v0.142.0 implements `storage.Appender` with the old method names. The fix landed upstream in otel-contrib v0.144.0, but that requires OTel Collector v1.50.0 which we aren't on yet. To bridge the gap, I created the `release/142-prometheus-0.309` branch on `grafana/opentelemetry-collector-contrib` with the minimal rename applied on top of v0.142.0. A replace directive points to that branch. This replace should be removed during the next OTel Collector upgrade (v0.144.0+). ## walqueue update `github.com/grafana/walqueue` was updated to a newer commit (92af63e, merged upstream 2026-01-22) that implements the renamed `storage.Appender` methods. ## featuregate replace removed The `go.opentelemetry.io/collector/featuregate` replace directive (and the `otelfeaturegatefix` blank imports) were removed. The upstream issue (prometheus/prometheus#13842) was resolved in 2024 and the fork was no longer needed. Along with this, there were a couple additional duplicate featuregate registrations that were either removed entirely or replaced with lazy evaluation. ## Test fix One converter test expectation was updated — hash-based endpoint names in `prom_remote_write.alloy` changed due to the Prometheus config struct changes. This is cosmetic and not user-facing.
Prometheus Dependency Update — 2026-02-09
Upgraded
github.com/prometheus/prometheusfrom v0.308.0 (v3.8.0) to v0.309.1 (v3.9.1) across all modules. The other Prometheus client libraries were already at their latest compatible versions.API changes in Prometheus v0.309.1
Prometheus renamed "Created Timestamp" to "Start Timestamp" throughout the
storage.Appenderinterface:AppendCTZeroSample→AppendSTZeroSampleAppendHistogramCTZeroSample→AppendHistogramSTZeroSampleCreatedTimestampAppender→StartTimestampAppenderCommit()/Rollback()moved into a new embeddedAppenderTransactioninterface (no code changes needed for this)All Alloy implementations of
storage.Appenderwere updated to match.Fork of otel-contrib prometheusreceiver
The upstream
receiver/prometheusreceiverat v0.142.0 implementsstorage.Appenderwith the old method names. The fix landed upstream in otel-contrib v0.144.0, but that requires OTel Collector v1.50.0 which we aren't on yet.To bridge the gap, I created the
release/142-prometheus-0.309branch ongrafana/opentelemetry-collector-contribwith the minimal rename applied on top of v0.142.0. A replace directive points to that branch. This replace should be removed during the next OTel Collector upgrade (v0.144.0+).walqueue update
github.com/grafana/walqueuewas updated to a newer commit (92af63e, merged upstream 2026-01-22) that implements the renamedstorage.Appendermethods.featuregate replace removed
The
go.opentelemetry.io/collector/featuregatereplace directive (and theotelfeaturegatefixblank imports) were removed. The upstream issue (prometheus/prometheus#13842) was resolved in 2024 and the fork was no longer needed.Along with this, there were a couple additional duplicate featuregate registrations that were either removed entirely or replaced with lazy evaluation.
Test fix
One converter test expectation was updated — hash-based endpoint names in
prom_remote_write.alloychanged due to the Prometheus config struct changes. This is cosmetic and not user-facing.