Skip to content

Commit 485474c

Browse files
authored
Chore: Upgrade Prometheus (#4374)
* Chore: Upgrade Prometheus Signed-off-by: Arve Knudsen <[email protected]> * Chore: Upgrade Prometheus Signed-off-by: Arve Knudsen <[email protected]>
1 parent d9e1f81 commit 485474c

File tree

421 files changed

+23888
-21497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

421 files changed

+23888
-21497
lines changed

cmd/query-tee/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/go-kit/kit/log/level"
88
"github.com/prometheus/client_golang/prometheus"
9+
"github.com/prometheus/client_golang/prometheus/collectors"
910
"github.com/weaveworks/common/logging"
1011
"github.com/weaveworks/common/server"
1112

@@ -35,7 +36,7 @@ func main() {
3536

3637
// Run the instrumentation server.
3738
registry := prometheus.NewRegistry()
38-
registry.MustRegister(prometheus.NewGoCollector())
39+
registry.MustRegister(collectors.NewGoCollector())
3940

4041
i := querytee.NewInstrumentationServer(cfg.ServerMetricsPort, registry)
4142
if err := i.Start(); err != nil {

go.mod

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/cortexproject/cortex
33
go 1.16
44

55
require (
6-
cloud.google.com/go/bigtable v1.2.0
6+
cloud.google.com/go/bigtable v1.3.0
77
cloud.google.com/go/storage v1.10.0
88
github.com/Azure/azure-pipeline-go v0.2.2
99
github.com/Azure/azure-storage-blob-go v0.8.0
@@ -12,7 +12,7 @@ require (
1212
github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15
1313
github.com/alicebob/miniredis/v2 v2.14.3
1414
github.com/armon/go-metrics v0.3.6
15-
github.com/aws/aws-sdk-go v1.38.35
15+
github.com/aws/aws-sdk-go v1.38.60
1616
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
1717
github.com/cespare/xxhash v1.1.0
1818
github.com/dustin/go-humanize v1.0.0
@@ -45,28 +45,28 @@ require (
4545
github.com/opentracing-contrib/go-stdlib v1.0.0
4646
github.com/opentracing/opentracing-go v1.2.0
4747
github.com/pkg/errors v0.9.1
48-
github.com/prometheus/alertmanager v0.22.1-0.20210603124511-8b584eb2265e
49-
github.com/prometheus/client_golang v1.10.0
48+
github.com/prometheus/alertmanager v0.22.3-0.20210628111558-8491f816296b
49+
github.com/prometheus/client_golang v1.11.0
5050
github.com/prometheus/client_model v0.2.0
51-
github.com/prometheus/common v0.26.1-0.20210603143733-6ef301f414bf
52-
github.com/prometheus/prometheus v1.8.2-0.20210510213326-e313ffa8abf6
51+
github.com/prometheus/common v0.29.0
52+
github.com/prometheus/prometheus v1.8.2-0.20210720084720-59d02b5ef003
5353
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
5454
github.com/sony/gobreaker v0.4.1
5555
github.com/spf13/afero v1.2.2
5656
github.com/stretchr/testify v1.7.0
5757
github.com/thanos-io/thanos v0.19.1-0.20210427154226-d5bd651319d2
58-
github.com/uber/jaeger-client-go v2.28.0+incompatible
58+
github.com/uber/jaeger-client-go v2.29.1+incompatible
5959
github.com/weaveworks/common v0.0.0-20210419092856-009d1eebd624
6060
go.etcd.io/bbolt v1.3.5
61-
go.etcd.io/etcd v0.5.0-alpha.5.0.20200520232829-54ba9589114f
61+
go.etcd.io/etcd v0.5.0-alpha.5.0.20200910180754-dd1b699fc489
6262
go.etcd.io/etcd/client/v3 v3.5.0-alpha.0.0.20210225194612-fa82d11a958a
6363
go.etcd.io/etcd/server/v3 v3.5.0-alpha.0.0.20210225194612-fa82d11a958a
64-
go.uber.org/atomic v1.7.0
65-
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
64+
go.uber.org/atomic v1.8.0
65+
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b
6666
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
67-
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
68-
google.golang.org/api v0.46.0
69-
google.golang.org/grpc v1.37.0
67+
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6
68+
google.golang.org/api v0.48.0
69+
google.golang.org/grpc v1.38.0
7070
gopkg.in/yaml.v2 v2.4.0
7171
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
7272
sigs.k8s.io/yaml v1.2.0

go.sum

Lines changed: 437 additions & 57 deletions
Large diffs are not rendered by default.

pkg/compactor/compactor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var (
5757
}
5858

5959
DefaultBlocksCompactorFactory = func(ctx context.Context, cfg Config, logger log.Logger, reg prometheus.Registerer) (compact.Compactor, compact.Planner, error) {
60-
compactor, err := tsdb.NewLeveledCompactor(ctx, reg, logger, cfg.BlockRanges.ToMilliseconds(), downsample.NewPool())
60+
compactor, err := tsdb.NewLeveledCompactor(ctx, reg, logger, cfg.BlockRanges.ToMilliseconds(), downsample.NewPool(), nil)
6161
if err != nil {
6262
return nil, nil, err
6363
}

pkg/compactor/compactor_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ func createTSDBBlock(t *testing.T, bkt objstore.Bucket, userID string, minT, max
958958
MinBlockDuration: int64(2 * 60 * 60 * 1000), // 2h period
959959
MaxBlockDuration: int64(2 * 60 * 60 * 1000), // 2h period
960960
RetentionDuration: int64(15 * 86400 * 1000), // 15 days
961-
})
961+
}, nil)
962962
require.NoError(t, err)
963963

964964
db.DisableCompactions()

pkg/configs/legacy_promql/test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ func NewStorage(t T) storage.Storage {
564564
db, err := tsdb.Open(dir, nil, nil, &tsdb.Options{
565565
MinBlockDuration: int64(24 * time.Hour / time.Millisecond),
566566
MaxBlockDuration: int64(24 * time.Hour / time.Millisecond),
567-
})
567+
}, nil)
568568
if err != nil {
569569
t.Fatalf("Opening test storage failed: %s", err)
570570
}

pkg/configs/userconfig/config.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ func (c RulesConfig) parseV2() (map[string][]rules.Rule, error) {
369369
labels.FromMap(rl.Labels),
370370
labels.FromMap(rl.Annotations),
371371
nil,
372+
"",
372373
true,
373374
log.With(util_log.Logger, "alert", rl.Alert.Value),
374375
))
@@ -417,7 +418,14 @@ func (c RulesConfig) parseV1() (map[string][]rules.Rule, error) {
417418
}
418419

419420
rule = rules.NewAlertingRule(
420-
r.Name, expr, r.Duration, r.Labels, r.Annotations, nil, true,
421+
r.Name,
422+
expr,
423+
r.Duration,
424+
r.Labels,
425+
r.Annotations,
426+
nil,
427+
"",
428+
true,
421429
log.With(util_log.Logger, "alert", r.Name),
422430
)
423431

pkg/configs/userconfig/config_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func TestParseLegacyAlerts(t *testing.T) {
9191
labels.Label{Name: "message", Value: "I am a message"},
9292
},
9393
nil,
94+
"",
9495
true,
9596
log.With(util_log.Logger, "alert", "TestAlert"),
9697
)

pkg/ingester/ingester_v2.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,6 +1566,10 @@ func (i *Ingester) createTSDB(userID string) (*userTSDB, error) {
15661566
instanceSeriesCount: &i.TSDBState.seriesCount,
15671567
}
15681568

1569+
enableExemplars := false
1570+
if i.cfg.BlocksStorageConfig.TSDB.MaxExemplars > 0 {
1571+
enableExemplars = true
1572+
}
15691573
// Create a new user database
15701574
db, err := tsdb.Open(udir, userLogger, tsdbPromReg, &tsdb.Options{
15711575
RetentionDuration: i.cfg.BlocksStorageConfig.TSDB.Retention.Milliseconds(),
@@ -1578,8 +1582,9 @@ func (i *Ingester) createTSDB(userID string) (*userTSDB, error) {
15781582
WALSegmentSize: i.cfg.BlocksStorageConfig.TSDB.WALSegmentSizeBytes,
15791583
SeriesLifecycleCallback: userDB,
15801584
BlocksToDelete: userDB.blocksToDelete,
1581-
MaxExemplars: i.cfg.BlocksStorageConfig.TSDB.MaxExemplars,
1582-
})
1585+
EnableExemplarStorage: enableExemplars,
1586+
MaxExemplars: int64(i.cfg.BlocksStorageConfig.TSDB.MaxExemplars),
1587+
}, nil)
15831588
if err != nil {
15841589
return nil, errors.Wrapf(err, "failed to open TSDB: %s", udir)
15851590
}

pkg/ingester/ingester_v2_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3317,7 +3317,7 @@ func TestHeadCompactionOnStartup(t *testing.T) {
33173317
NoLockfile: true,
33183318
MinBlockDuration: chunkRange,
33193319
MaxBlockDuration: chunkRange,
3320-
})
3320+
}, nil)
33213321
require.NoError(t, err)
33223322

33233323
db.DisableCompactions()

0 commit comments

Comments
 (0)