Conversation
| dec.HonorTimestamps = c.HonorTimestamps | ||
| dec.TrackTimestampsStaleness = c.TrackTimestampsStaleness | ||
| dec.Params = c.Params | ||
| dec.ScrapeNativeHistograms = ©ScrapeNativeHistograms |
There was a problem hiding this comment.
This setting is now per-scrape-job, moved from manager-wide setting above.
28536ff to
744a5d0
Compare
|
💻 Deploy preview deleted (Update Prometheus and Loki). |
51bed66 to
27a4665
Compare
There was a problem hiding this comment.
Pull request overview
This PR updates Prometheus dependencies to v3.8.0 (module version v0.308.0) and Loki dependencies to v3.6.2, representing a significant upgrade to the latest versions of these core components. The changes primarily involve migrating to new Prometheus API patterns and updating import paths for remote write functionality.
Key Changes
- Migrated from
config.RemoteWriteProtoMsgtoremote.WriteMessageTypefor remote write protocol types, importing fromgithub.com/prometheus/client_golang/exp/api/remoteinstead ofgithub.com/prometheus/prometheus/config - Removed
EnableNativeHistogramsIngestionfrom scrape.Options in favor of settingScrapeNativeHistogramsdirectly in scrape configurations - Added TODO comments with GitHub issue links for new experimental Prometheus features (EnableCreatedTimestampZeroIngestion, EnableTypeAndUnitLabels, appendMetadata) that are not yet exposed in Alloy components
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
internal/component/prometheus/write/queue/types.go |
Updated imports and type references from config.RemoteWriteProtoMsg to remote.WriteMessageType |
internal/component/prometheus/scrape/scrape.go |
Removed EnableNativeHistogramsIngestion from scrape options, added ScrapeNativeHistograms to scrape config, added TODOs for new experimental features |
internal/component/prometheus/remotewrite/types.go |
Updated remote write protocol type imports and usage |
internal/component/prometheus/receive_http/receive_http.go |
Updated handler initialization with new parameters, added TODO comments for unexposed features, aliased prometheus/storage/remote import to avoid conflicts |
internal/component/prometheus/operator/common/crdmanager.go |
Simplified scrape manager creation with empty options, added TODOs for experimental features |
go.sum |
Updated dependency hashes for Prometheus v0.308.0, Loki v3.6.2, and related AWS SDK, DigitalOcean, Docker, Hetzner, Linode, and etcd dependencies |
go.mod |
Updated Prometheus to v0.308.0, Loki to v3.6.2, and consolidated dependency declarations |
docs/sources/shared/reference/components/prom-operator-scrape.md |
Clarified scrape_native_histograms documentation from "ingest native histograms" to "scrape native histograms from targets" |
CHANGELOG.md |
Added entries documenting Prometheus v3.8.0 and Loki v3.6.2 updates |
🔍 Dependency ReviewBelow is a review of the dependency changes in go.mod, what changed upstream between the “as-is” and “to-be” versions, and the concrete code updates needed to adopt them. For each dependency you’ll find a status and collapsible details with evidence and example diffs.
github.com/prometheus/prometheus v0.305.1-0.20250818080900-0a40df33fb4e (with grafana fork replace) -> v0.308.0 — ❌ Changes NeededStatus: Breaking changes required code updates. This PR implements them. Below is a summary of what changed and the exact code updates needed (with evidence). Key upstream changes relevant between v3.6.x → v3.8.0:
Evidence in this PR:
Concrete code updates to apply (already in this PR):
- import "github.com/prometheus/prometheus/config"
+ import "github.com/prometheus/client_golang/exp/api/remote"
- PrometheusProtobufMessageV1 = string(config.RemoteWriteProtoMsgV1)
- PrometheusProtobufMessageV2 = string(config.RemoteWriteProtoMsgV2)
+ PrometheusProtobufMessageV1 = string(remote.WriteV1MessageType)
+ PrometheusProtobufMessageV2 = string(remote.WriteV2MessageType)
- if err := config.RemoteWriteProtoMsg(r.ProtobufMessage).Validate(); err != nil {
+ if err := remote.WriteMessageType(r.ProtobufMessage).Validate(); err != nil {
...
}
- import "github.com/prometheus/prometheus/storage/remote"
- import "github.com/prometheus/prometheus/config"
- supportedRemoteWriteProtoMsgs := config.RemoteWriteProtoMsgs{config.RemoteWriteProtoMsgV1}
- ingestCTZeroSample := false
- handler: remote.NewWriteHandler(
+ import (
+ expremote "github.com/prometheus/client_golang/exp/api/remote"
+ promremote "github.com/prometheus/prometheus/storage/remote"
+ )
+ supportedRemoteWriteProtoMsgs := expremote.MessageTypes{expremote.WriteV1MessageType}
+ ingestCTZeroSample := false
+ enableTypeAndUnitLabels := false
+ appendMetadata := false
+ handler: promremote.NewWriteHandler(
logger,
reg,
fanout,
supportedRemoteWriteProtoMsgs,
- ingestCTZeroSample,
+ ingestCTZeroSample,
+ enableTypeAndUnitLabels,
+ appendMetadata,
),
- opts := &scrape.Options{
- EnableNativeHistogramsIngestion: c.args.Scrape.ScrapeNativeHistograms,
- }
- c.scrapeManager, err = scrape.NewManager(opts, logger, nil, app, unregisterer)
+ // Now native histograms are controlled per-target in ScrapeConfig (ScrapeNativeHistograms).
+ c.scrapeManager, err = scrape.NewManager(&scrape.Options{}, logger, nil, app, unregisterer)
+ copyScrapeNativeHistograms := c.ScrapeNativeHistograms
+ dec.ScrapeNativeHistograms = ©ScrapeNativeHistograms
+ ScrapeNativeHistograms: falsePtr,
- ProtobufMessage: config.RemoteWriteProtoMsg(rw.ProtobufMessage),
+ ProtobufMessage: remote.WriteMessageType(rw.ProtobufMessage),
- import "github.com/prometheus/prometheus/model/labels"
+ import "github.com/prometheus/common/model"
- builder.Add(labels.MetricName, metric)
+ builder.Add(model.MetricNameLabel, metric)
- type RemoteWriteProtoMsg config.RemoteWriteProtoMsg
+ type RemoteWriteProtoMsg remote.WriteMessageType
- case string(config.RemoteWriteProtoMsgV1):
- *s = RemoteWriteProtoMsg(config.RemoteWriteProtoMsgV1)
+ case string(remote.WriteV1MessageType):
+ *s = RemoteWriteProtoMsg(remote.WriteV1MessageType)Additional knobs introduced upstream you may want to expose later (captured and TODO’d in code):
References (relevant upstream changes):
github.com/prometheus/client_golang/exp (new) -> v0.0.0-20250914183048-a974e0d45e0a —
|
063c88c to
4522bbd
Compare
PR Description
This finally gets rid of our Prometheus fork.
Not all new experimental features in Prometheus are exposed. Instead there are some TODOs left in the code to GH issues which should address this. This is to keep the PR smaller and prioritise the work accordingly.
Which issue(s) this PR fixes
Notes to the Reviewer
PR Checklist