Skip to content

Commit 01c4a62

Browse files
authored
Update Prometheus and Loki (#5035)
* Core of the update * scrape options fix * update TODOs for future work * Docs and comments tweaks * changelog * go.sum * combine go.mod blocks * fix-removed-deps * fix tests with native histogram settings * fix missed test * fmt * fix lint * fmt
1 parent d385cba commit 01c4a62

File tree

18 files changed

+195
-174
lines changed

18 files changed

+195
-174
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Main (unreleased)
4747

4848
- Reduced resource overhead of `prometheus.scrape`, `prometheus.relabel`, `prometheus.enrich`, and `prometheus.remote_write` by removing unnecessary usage of labelstore.LabelStore. (@kgeckhart)
4949

50+
- Updated Prometheus dependencies to v3.8.0. (@thampiotr)
51+
52+
- Updated Loki dependencies to v3.6.2. (@thampiotr)
53+
5054
### Bugfixes
5155

5256
- (_Public Preview_) Additions to `database_observability.postgres` component:

dependency-replacements.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@ replaces:
3535
dependency: go.opentelemetry.io/collector/featuregate
3636
replacement: github.com/grafana/opentelemetry-collector/featuregate v0.0.0-20240325174506-2fd1623b2ca0
3737
38-
- comment: Replace directives from Prometheus
39-
dependency: github.com/fsnotify/fsnotify v1.8.0
40-
replacement: github.com/fsnotify/fsnotify v1.7.0
41-
42-
- comment: >
43-
TODO: remove replace directive once there is a release of Prometheus
44-
which addresses https://github.com/prometheus/prometheus/issues/14049,
45-
for example, via this implementation: https://github.com/grafana/prometheus/pull/34
46-
dependency: github.com/prometheus/prometheus
47-
replacement: github.com/grafana/prometheus v1.8.2-0.20251030104821-c9e0b31e9aeb
48-
4938
- comment: Replace yaml.v2 with fork
5039
dependency: gopkg.in/yaml.v2
5140
replacement: github.com/rfratto/go-yaml v0.0.0-20211119180816-77389c3526dc

docs/sources/shared/reference/components/prom-operator-scrape.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ headless: true
88
|----------------------------|------------|------------------------------------------------------------------------------------------------------------------------------|---------|----------|
99
| `default_scrape_interval` | `duration` | The default interval between scraping targets. Used as the default if the target resource doesn't provide a scrape interval. | `1m` | no |
1010
| `default_scrape_timeout` | `duration` | The default timeout for scrape requests. Used as the default if the target resource doesn't provide a scrape timeout. | `10s` | no |
11-
| `scrape_native_histograms` | `bool` | Allow the scrape manager to ingest native histograms. | `false` | no |
11+
| `scrape_native_histograms` | `bool` | Whether to scrape native histograms from targets. | `false` | no |

go.mod

Lines changed: 63 additions & 72 deletions
Large diffs are not rendered by default.

go.sum

Lines changed: 56 additions & 54 deletions
Large diffs are not rendered by default.

internal/component/prometheus/operator/common/crdmanager.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ func (c *crdManager) Run(ctx context.Context) error {
147147
// Start prometheus scrape manager.
148148
alloyAppendable := prometheus.NewFanout(c.args.ForwardTo, c.opts.ID, c.opts.Registerer, c.ls)
149149

150-
opts := &scrape.Options{
151-
EnableNativeHistogramsIngestion: c.args.Scrape.ScrapeNativeHistograms,
152-
}
153-
c.scrapeManager, err = scrape.NewManager(opts, slog.New(logging.NewSlogGoKitHandler(c.logger)), nil, alloyAppendable, unregisterer)
150+
// TODO: Expose EnableCreatedTimestampZeroIngestion: https://github.com/grafana/alloy/issues/4045
151+
// TODO: Expose EnableTypeAndUnitLabels: https://github.com/grafana/alloy/issues/4659
152+
// TODO: Expose AppendMetadata: https://github.com/grafana/alloy/issues/5036
153+
c.scrapeManager, err = scrape.NewManager(&scrape.Options{}, slog.New(logging.NewSlogGoKitHandler(c.logger)), nil, alloyAppendable, unregisterer)
154154
if err != nil {
155155
return fmt.Errorf("creating scrape manager: %w", err)
156156
}

internal/component/prometheus/operator/configgen/config_gen_podmonitor_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func TestGeneratePodMonitorConfig(t *testing.T) {
9191
},
9292
},
9393
},
94+
ScrapeNativeHistograms: falsePtr,
9495
AlwaysScrapeClassicHistograms: falsePtr,
9596
ConvertClassicHistogramsToNHCB: falsePtr,
9697
MetricNameValidationScheme: model.LegacyValidation,
@@ -154,6 +155,7 @@ func TestGeneratePodMonitorConfig(t *testing.T) {
154155
},
155156
},
156157
},
158+
ScrapeNativeHistograms: falsePtr,
157159
AlwaysScrapeClassicHistograms: falsePtr,
158160
ConvertClassicHistogramsToNHCB: falsePtr,
159161
MetricNameValidationScheme: model.LegacyValidation,
@@ -217,6 +219,7 @@ func TestGeneratePodMonitorConfig(t *testing.T) {
217219
},
218220
},
219221
},
222+
ScrapeNativeHistograms: falsePtr,
220223
AlwaysScrapeClassicHistograms: falsePtr,
221224
ConvertClassicHistogramsToNHCB: falsePtr,
222225
MetricNameValidationScheme: model.LegacyValidation,
@@ -278,6 +281,7 @@ func TestGeneratePodMonitorConfig(t *testing.T) {
278281
},
279282
},
280283
},
284+
ScrapeNativeHistograms: falsePtr,
281285
AlwaysScrapeClassicHistograms: falsePtr,
282286
ConvertClassicHistogramsToNHCB: falsePtr,
283287
MetricNameValidationScheme: model.LegacyValidation,
@@ -341,6 +345,7 @@ func TestGeneratePodMonitorConfig(t *testing.T) {
341345
},
342346
},
343347
},
348+
ScrapeNativeHistograms: falsePtr,
344349
AlwaysScrapeClassicHistograms: falsePtr,
345350
ConvertClassicHistogramsToNHCB: falsePtr,
346351
MetricNameValidationScheme: model.LegacyValidation,
@@ -514,6 +519,7 @@ func TestGeneratePodMonitorConfig(t *testing.T) {
514519
LabelLimit: 103,
515520
LabelNameLengthLimit: 104,
516521
LabelValueLengthLimit: 105,
522+
ScrapeNativeHistograms: falsePtr,
517523
AlwaysScrapeClassicHistograms: falsePtr,
518524
ConvertClassicHistogramsToNHCB: falsePtr,
519525
MetricNameValidationScheme: model.LegacyValidation,

internal/component/prometheus/operator/configgen/config_gen_probe_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ func TestGenerateProbeConfig(t *testing.T) {
8787
ScrapeTimeout: model.Duration(10 * time.Second),
8888
ScrapeProtocols: config.DefaultScrapeProtocols,
8989
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
90+
ScrapeNativeHistograms: falsePtr,
9091
AlwaysScrapeClassicHistograms: falsePtr,
9192
ConvertClassicHistogramsToNHCB: falsePtr,
9293
EnableCompression: true,
@@ -174,6 +175,7 @@ func TestGenerateProbeConfig(t *testing.T) {
174175
ScrapeTimeout: model.Duration(10 * time.Second),
175176
ScrapeProtocols: config.DefaultScrapeProtocols,
176177
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
178+
ScrapeNativeHistograms: falsePtr,
177179
AlwaysScrapeClassicHistograms: falsePtr,
178180
ConvertClassicHistogramsToNHCB: falsePtr,
179181
EnableCompression: true,
@@ -275,6 +277,7 @@ func TestGenerateProbeConfig(t *testing.T) {
275277
ScrapeTimeout: model.Duration(15 * time.Second),
276278
ScrapeProtocols: []config.ScrapeProtocol{config.PrometheusProto},
277279
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
280+
ScrapeNativeHistograms: falsePtr,
278281
AlwaysScrapeClassicHistograms: falsePtr,
279282
ConvertClassicHistogramsToNHCB: falsePtr,
280283
EnableCompression: true,

internal/component/prometheus/operator/configgen/config_gen_scrapeconfig_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ func TestGenerateStaticScrapeConfigConfig(t *testing.T) {
7171
ScrapeTimeout: model.Duration(42 * time.Second),
7272
ScrapeProtocols: config.DefaultScrapeProtocols,
7373
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
74+
ScrapeNativeHistograms: falsePtr,
7475
AlwaysScrapeClassicHistograms: falsePtr,
7576
ConvertClassicHistogramsToNHCB: falsePtr,
7677
EnableCompression: true,
@@ -132,6 +133,7 @@ func TestGenerateStaticScrapeConfigConfig(t *testing.T) {
132133
ScrapeTimeout: model.Duration(42 * time.Second),
133134
ScrapeProtocols: []config.ScrapeProtocol{config.PrometheusProto, config.OpenMetricsText1_0_0},
134135
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
136+
ScrapeNativeHistograms: falsePtr,
135137
AlwaysScrapeClassicHistograms: falsePtr,
136138
EnableCompression: true,
137139
MetricsPath: "/metrics",
@@ -187,6 +189,7 @@ func TestGenerateStaticScrapeConfigConfig(t *testing.T) {
187189
ScrapeTimeout: model.Duration(42 * time.Second),
188190
ScrapeProtocols: config.DefaultScrapeProtocols,
189191
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
192+
ScrapeNativeHistograms: falsePtr,
190193
AlwaysScrapeClassicHistograms: falsePtr,
191194
ConvertClassicHistogramsToNHCB: falsePtr,
192195
EnableCompression: true,

internal/component/prometheus/operator/configgen/config_gen_servicemonitor_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ func TestGenerateServiceMonitorConfig(t *testing.T) {
8686
ScrapeTimeout: model.Duration(10 * time.Second),
8787
ScrapeProtocols: config.DefaultScrapeProtocols,
8888
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
89+
ScrapeNativeHistograms: falsePtr,
8990
AlwaysScrapeClassicHistograms: falsePtr,
9091
ConvertClassicHistogramsToNHCB: falsePtr,
9192
EnableCompression: true,
@@ -162,6 +163,7 @@ func TestGenerateServiceMonitorConfig(t *testing.T) {
162163
ScrapeTimeout: model.Duration(10 * time.Second),
163164
ScrapeProtocols: config.DefaultScrapeProtocols,
164165
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
166+
ScrapeNativeHistograms: falsePtr,
165167
AlwaysScrapeClassicHistograms: falsePtr,
166168
ConvertClassicHistogramsToNHCB: falsePtr,
167169
EnableCompression: true,
@@ -238,6 +240,7 @@ func TestGenerateServiceMonitorConfig(t *testing.T) {
238240
ScrapeTimeout: model.Duration(10 * time.Second),
239241
ScrapeProtocols: config.DefaultScrapeProtocols,
240242
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
243+
ScrapeNativeHistograms: falsePtr,
241244
AlwaysScrapeClassicHistograms: falsePtr,
242245
ConvertClassicHistogramsToNHCB: falsePtr,
243246
EnableCompression: true,
@@ -314,6 +317,7 @@ func TestGenerateServiceMonitorConfig(t *testing.T) {
314317
ScrapeTimeout: model.Duration(10 * time.Second),
315318
ScrapeProtocols: config.DefaultScrapeProtocols,
316319
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
320+
ScrapeNativeHistograms: falsePtr,
317321
AlwaysScrapeClassicHistograms: falsePtr,
318322
ConvertClassicHistogramsToNHCB: falsePtr,
319323
EnableCompression: true,
@@ -521,6 +525,7 @@ func TestGenerateServiceMonitorConfig(t *testing.T) {
521525
LabelLimit: 103,
522526
LabelNameLengthLimit: 104,
523527
LabelValueLengthLimit: 105,
528+
ScrapeNativeHistograms: falsePtr,
524529
AlwaysScrapeClassicHistograms: falsePtr,
525530
ConvertClassicHistogramsToNHCB: falsePtr,
526531
MetricNameValidationScheme: model.LegacyValidation,
@@ -586,6 +591,7 @@ func TestGenerateServiceMonitorConfig(t *testing.T) {
586591
ScrapeTimeout: model.Duration(10 * time.Second),
587592
ScrapeProtocols: config.DefaultScrapeProtocols,
588593
ScrapeFallbackProtocol: config.PrometheusText0_0_4,
594+
ScrapeNativeHistograms: falsePtr,
589595
AlwaysScrapeClassicHistograms: falsePtr,
590596
ConvertClassicHistogramsToNHCB: falsePtr,
591597
EnableCompression: true,

0 commit comments

Comments
 (0)