Skip to content

Commit

Permalink
update Prometheus and Loki dependency (#2454)
Browse files Browse the repository at this point in the history
Update Prometheus to v2.39.1
Update Loki to k122

Both had to be updated at once to ensure things continue to compile.
  • Loading branch information
rfratto authored Nov 1, 2022
1 parent 758da7c commit 37d333a
Show file tree
Hide file tree
Showing 8 changed files with 322 additions and 137 deletions.
2 changes: 1 addition & 1 deletion .github/depcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ github_repos:
- github.com/prometheus-community/windows_exporter v0.16.0
- github.com/percona/mongodb_exporter v0.20.7
- project: github.com/prometheus/prometheus
version: v2.27.0
version: v2.39.1
# Ignore release candidates
ignore_version_pattern: '-rc\.\d+$'
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ Main (unreleased)

- Update OpenTelemetry Collector dependency to v0.61.0. (@rfratto)

- Update Prometheus dependency to v2.38.0. (@rfratto)

- Add caching to Prometheus relabel component. (@mattdurham)

- Grafana Agent Flow: add `agent_resources_*` metrics which explain basic
Expand All @@ -84,6 +82,10 @@ Main (unreleased)

- Add missing setting to configure instance key for Eventhandler integration. (@marctc)

- Update Prometheus dependency to v2.39.1. (@rfratto)

- Update Promtail dependency to weekly release k122. (@rfratto)

### Bugfixes

- Remove empty port from the `apache_http` integration's instance label. (@katepangLiu)
Expand Down
83 changes: 45 additions & 38 deletions go.mod

Large diffs are not rendered by default.

350 changes: 260 additions & 90 deletions go.sum

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions pkg/agentctl/walstats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,22 @@ func setupTestWAL(t *testing.T) string {
Labels: labels.FromStrings("__name__", "metric_1", "job", "test-job", "instance", "test-instance", "initial", "yes"),
})

nextSegment := func(w *wal.WAL) error {
_, err := w.NextSegment()
return err
}

// Encode the samples to the WAL and create a new segment.
var encoder record.Encoder
buf := encoder.Series(series, nil)
err = w.Log(buf)
require.NoError(t, err)
require.NoError(t, w.NextSegment())
require.NoError(t, nextSegment(w))

// Checkpoint the previous segment.
_, err = wal.Checkpoint(l, w, 0, 1, func(_ chunks.HeadSeriesRef) bool { return true }, 0)
require.NoError(t, err)
require.NoError(t, w.NextSegment())
require.NoError(t, nextSegment(w))

// Create some samples and then make a new segment.
var samples []record.RefSample
Expand All @@ -110,7 +115,7 @@ func setupTestWAL(t *testing.T) string {
buf = encoder.Samples(samples, nil)
err = w.Log(buf)
require.NoError(t, err)
require.NoError(t, w.NextSegment())
require.NoError(t, nextSegment(w))

return w.Dir()
}
2 changes: 1 addition & 1 deletion pkg/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (i *Instance) ApplyConfig(c *InstanceConfig, dryRun bool) error {
PositionsConfig: c.PositionsConfig,
ScrapeConfig: c.ScrapeConfig,
TargetConfig: c.TargetConfig,
}, clientMetrics, dryRun, promtail.WithLogger(i.log), promtail.WithRegisterer(i.reg))
}, nil, clientMetrics, dryRun, promtail.WithLogger(i.log), promtail.WithRegisterer(i.reg))
if err != nil {
return fmt.Errorf("unable to create logs instance: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/metrics/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func (w *Storage) Truncate(mint int64) error {

// Start a new segment, so low ingestion volume instance don't have more WAL
// than needed.
err = w.wal.NextSegment()
_, err = w.wal.NextSegment()
if err != nil {
return fmt.Errorf("next segment: %w", err)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/metrics/wal/wal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ func TestStorage_Truncate(t *testing.T) {
// Forefully create a bunch of new segments so when we truncate
// there's enough segments to be considered for truncation.
for i := 0; i < 5; i++ {
require.NoError(t, s.wal.NextSegment())
_, err := s.wal.NextSegmentSync()
require.NoError(t, err)
}

// Truncate half of the samples, keeping only the second sample
Expand Down

0 comments on commit 37d333a

Please sign in to comment.