Skip to content

Commit

Permalink
go.mod: update Prometheus to v2.46.0 with retry behavior cherry-picks (
Browse files Browse the repository at this point in the history
…#5355)

Signed-off-by: Paschalis Tsilias <[email protected]>
  • Loading branch information
tpaschalis authored Oct 4, 2023
1 parent 0aeca59 commit ca5d91d
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ Main (unreleased)
of each node separately, instead of all the directly and indirectly
dependant nodes. (@thampiotr)

- Update Prometheus dependency to v2.46.0. (@tpaschalis)

### Bugfixes

- Fixed `otelcol.exporter.prometheus` label names for the `otel_scope_info`
Expand Down
2 changes: 1 addition & 1 deletion component/common/loki/wal/wal.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type wrapper struct {
func New(cfg Config, log log.Logger, registerer prometheus.Registerer) (WAL, error) {
// TODO: We should fine-tune the WAL instantiated here to allow some buffering of written entries, but not written to disk
// yet. This will attest for the lack of buffering in the channel Writer exposes.
tsdbWAL, err := wlog.NewSize(log, registerer, cfg.Dir, wlog.DefaultSegmentSize, false)
tsdbWAL, err := wlog.NewSize(log, registerer, cfg.Dir, wlog.DefaultSegmentSize, wlog.CompressionNone)
if err != nil {
return nil, fmt.Errorf("failde to create tsdb WAL: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion component/prometheus/receive_http/receive_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func New(opts component.Options, args Arguments) (*Component, error) {

c := &Component{
opts: opts,
handler: remote.NewWriteHandler(opts.Logger, fanout),
handler: remote.NewWriteHandler(opts.Logger, opts.Registerer, fanout),
fanout: fanout,
uncheckedCollector: uncheckedCollector,
}
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ require (
github.com/grafana/cloudflare-go v0.0.0-20230110200409-c627cf6792f2
github.com/grafana/dskit v0.0.0-20230829141140-06955c011ffd
github.com/grafana/go-gelf/v2 v2.0.1
github.com/grafana/loki v1.6.2-0.20230927083715-42fba5b19183 // k169 branch
// Loki main commit where the Prometheus dependency matches ours. TODO(@tpaschalis) Update to kXYZ branch once it's available
github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a
github.com/grafana/pyroscope-go/godeltaprof v0.1.3
github.com/grafana/pyroscope/api v0.2.0
github.com/grafana/pyroscope/ebpf v0.2.3
Expand Down Expand Up @@ -427,7 +428,6 @@ require (
github.com/hashicorp/vault/sdk v0.5.1 // indirect
github.com/hashicorp/vic v1.5.1-0.20190403131502-bbfe86ec9443 // indirect
github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect
github.com/hetznercloud/hcloud-go v1.45.1 // indirect
github.com/hodgesds/perf-utils v0.7.0 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/iancoleman/strcase v0.3.0 // indirect
Expand Down Expand Up @@ -632,6 +632,7 @@ require (
github.com/Workiva/go-datastructures v1.1.0 // indirect
github.com/drone/envsubst v1.0.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/hetznercloud/hcloud-go/v2 v2.0.0 // indirect
github.com/julienschmidt/httprouter v1.3.0 // indirect
github.com/knadh/koanf/v2 v2.0.1 // indirect
github.com/leoluk/perflib_exporter v0.2.0 // indirect
Expand Down Expand Up @@ -677,7 +678,7 @@ replace (
// prometheus/prometheus#12677 and prometheus/prometheus#12729.
// We use the last v1-related tag as the replace statement does not work for v2
// tags without the v2 suffix to the module root
replace github.com/prometheus/prometheus => github.com/grafana/prometheus v1.8.2-0.20231002111159-38991b77eb53 // grafana:prometheus:v0.45.0-retry-improvements
replace github.com/prometheus/prometheus => github.com/grafana/prometheus v1.8.2-0.20231003113207-17e15326a784 // grafana:prometheus:v0.46.0-retry-improvements

replace gopkg.in/yaml.v2 => github.com/rfratto/go-yaml v0.0.0-20211119180816-77389c3526dc

Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1059,8 +1059,8 @@ github.com/grafana/go-gelf/v2 v2.0.1/go.mod h1:lexHie0xzYGwCgiRGcvZ723bSNyNI8ZRD
github.com/grafana/gocql v0.0.0-20200605141915-ba5dc39ece85/go.mod h1:crI9WX6p0IhrqB+DqIUHulRW853PaNFf7o4UprV//3I=
github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9 h1:WB3bGH2f1UN6jkd6uAEWfHB8OD7dKJ0v2Oo6SNfhpfQ=
github.com/grafana/gomemcache v0.0.0-20230316202710-a081dae0aba9/go.mod h1:PGk3RjYHpxMM8HFPhKKo+vve3DdlPUELZLSDEFehPuU=
github.com/grafana/loki v1.6.2-0.20230927083715-42fba5b19183 h1:klVM7g0Tl31QSd9dvypCe5XAQ49AM+acGAH2DwXdllA=
github.com/grafana/loki v1.6.2-0.20230927083715-42fba5b19183/go.mod h1:hiGUcnMCZ86m122rzu8xySnRiGDQ8TzPowVmCvWZAJ4=
github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a h1:lvSHlNONeo/H+aWRk86QEfBpRDCEX1yoqpsCK0Tys+g=
github.com/grafana/loki v1.6.2-0.20231004111112-07cbef92268a/go.mod h1:a5c5ZTC6FNufKkvF8NeDAb2nCWJpgkVDrejmV+O9hac=
github.com/grafana/loki/pkg/push v0.0.0-20230904153656-e4cc2a4f5ec8 h1:yQK/dX7WBva5QvITvmIcbv4boLwSo65a8zjuZcucnko=
github.com/grafana/loki/pkg/push v0.0.0-20230904153656-e4cc2a4f5ec8/go.mod h1:5ll3An1wAxYejo6aM04+3/lc6N4joYVYLY5U+Z4O6vI=
github.com/grafana/mysqld_exporter v0.12.2-0.20201015182516-5ac885b2d38a h1:D5NSR64/6xMXnSFD9y1m1DPYIcBcHvtfeuI9/M/0qtI=
Expand All @@ -1071,8 +1071,8 @@ github.com/grafana/perflib_exporter v0.1.1-0.20230511173423-6166026bd090 h1:Ko80
github.com/grafana/perflib_exporter v0.1.1-0.20230511173423-6166026bd090/go.mod h1:MinSWm88jguXFFrGsP56PtleUb4Qtm4tNRH/wXNXRTI=
github.com/grafana/postgres_exporter v0.8.1-0.20210722175051-db35d7c2f520 h1:HnFWqxhoSF3WC7sKAdMZ+SRXvHLVZlZ3sbQjuUlTqkw=
github.com/grafana/postgres_exporter v0.8.1-0.20210722175051-db35d7c2f520/go.mod h1:+HPXgiOV0InDHcZ2jNijL1SOKvo0eEPege5fQA0+ICI=
github.com/grafana/prometheus v1.8.2-0.20231002111159-38991b77eb53 h1:nX3bUvvnjugac9y7RyxNAG/yNLGR8xSExqwWwVFQ1yk=
github.com/grafana/prometheus v1.8.2-0.20231002111159-38991b77eb53/go.mod h1:jC5hyO8ItJBnDWGecbEucMyXjzxGv9cxsxsjS9u5s1w=
github.com/grafana/prometheus v1.8.2-0.20231003113207-17e15326a784 h1:B8AAFKq7WQPUYdoGwWjgxFARn5XodYlKJNHCYUopah8=
github.com/grafana/prometheus v1.8.2-0.20231003113207-17e15326a784/go.mod h1:10L5IJE5CEsjee1FnOcVswYXlPIscDWWt3IJ2UDYrz4=
github.com/grafana/pyroscope-go/godeltaprof v0.1.3 h1:eunWpv1B3Z7ZK9o4499EmQGlY+CsDmSZ4FbxjRx37uk=
github.com/grafana/pyroscope-go/godeltaprof v0.1.3/go.mod h1:1HSPtjU8vLG0jE9JrTdzjgFqdJ/VgN7fvxBNq3luJko=
github.com/grafana/pyroscope/api v0.2.0 h1:TzOxL0s6SiaLEy944ZAKgHcx/JDRJXu4O8ObwkqR6p4=
Expand Down Expand Up @@ -1271,8 +1271,8 @@ github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d h1:W+SIwDdl3+jXWei
github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/heroku/x v0.0.61 h1:yfoAAtnFWSFZj+UlS+RZL/h8QYEp1R4wHVEg0G+Hwh4=
github.com/heroku/x v0.0.61/go.mod h1:C7xYbpMdond+s6L5VpniDUSVPRwm3kZum1o7XiD5ZHk=
github.com/hetznercloud/hcloud-go v1.45.1 h1:nl0OOklFfQT5J6AaNIOhl5Ruh3fhmGmhvZEqHbibVuk=
github.com/hetznercloud/hcloud-go v1.45.1/go.mod h1:aAUGxSfSnB8/lVXHNEDxtCT1jykaul8kqjD7f5KQXF8=
github.com/hetznercloud/hcloud-go/v2 v2.0.0 h1:Sg1DJ+MAKvbYAqaBaq9tPbwXBS2ckPIaMtVdUjKu+4g=
github.com/hetznercloud/hcloud-go/v2 v2.0.0/go.mod h1:4iUG2NG8b61IAwNx6UsMWQ6IfIf/i1RsG0BbsKAyR5Q=
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
github.com/hjson/hjson-go/v4 v4.0.0/go.mod h1:KaYt3bTw3zhBjYqnXkYywcYctk0A2nxeEFTse3rH13E=
Expand Down
2 changes: 1 addition & 1 deletion pkg/agentctl/waltools/walstats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func setupTestWAL(t *testing.T) string {
walDir := t.TempDir()

reg := prometheus.NewRegistry()
w, err := wlog.NewSize(log.NewNopLogger(), reg, filepath.Join(walDir, "wal"), wlog.DefaultSegmentSize, true)
w, err := wlog.NewSize(log.NewNopLogger(), reg, filepath.Join(walDir, "wal"), wlog.DefaultSegmentSize, wlog.CompressionSnappy)
require.NoError(t, err)
defer w.Close()

Expand Down
2 changes: 1 addition & 1 deletion pkg/metrics/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (a *Agent) PushMetricsHandler(w http.ResponseWriter, r *http.Request) {
return
}

handler := remote.NewWriteHandler(a.logger, managedInstance)
handler := remote.NewWriteHandler(a.logger, a.reg, managedInstance)
handler.ServeHTTP(w, r)
}

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 @@ -145,7 +145,7 @@ type Storage struct {

// NewStorage makes a new Storage.
func NewStorage(logger log.Logger, registerer prometheus.Registerer, path string) (*Storage, error) {
w, err := wlog.NewSize(logger, registerer, SubDirectory(path), wlog.DefaultSegmentSize, true)
w, err := wlog.NewSize(logger, registerer, SubDirectory(path), wlog.DefaultSegmentSize, wlog.CompressionSnappy)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit ca5d91d

Please sign in to comment.