Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade prometheus to July 14th a0571449fd3890a204893974bb8f69fd3633c89e #4

Merged
merged 6 commits into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## master / unreleased
* [ENHANCEMENT] Prometheus upgraded. #4
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we now reference this repo's PRs?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so as well. However, we typically don't mention vendor upgrades in CHANGELOG unless there's any impactful change to Cortex (and if there is, than we mention that change).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reviewing all vendor/github.com/prometheus/* changes, I think there's nothing worth to report in our CHANGELOG.

* [FEATURE] Ruler: Add new `-ruler.query-stats-enabled` which when enabled will report the `cortex_ruler_query_seconds_total` as a per-user metric that tracks the sum of the wall time of executing queries in the ruler in seconds. #4317

* [CHANGE] Update Go version to 1.16.6. #4362
Expand Down
24 changes: 12 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/cortexproject/cortex
go 1.16

require (
cloud.google.com/go/bigtable v1.2.0
cloud.google.com/go/bigtable v1.3.0
cloud.google.com/go/storage v1.10.0
github.com/Azure/azure-pipeline-go v0.2.2
github.com/Azure/azure-storage-blob-go v0.8.0
Expand All @@ -12,7 +12,7 @@ require (
github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15
github.com/alicebob/miniredis/v2 v2.14.3
github.com/armon/go-metrics v0.3.6
github.com/aws/aws-sdk-go v1.38.35
github.com/aws/aws-sdk-go v1.38.60
github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b
github.com/cespare/xxhash v1.1.0
github.com/dustin/go-humanize v1.0.0
Expand Down Expand Up @@ -45,28 +45,28 @@ require (
github.com/opentracing-contrib/go-stdlib v1.0.0
github.com/opentracing/opentracing-go v1.2.0
github.com/pkg/errors v0.9.1
github.com/prometheus/alertmanager v0.22.1-0.20210603124511-8b584eb2265e
github.com/prometheus/client_golang v1.10.0
github.com/prometheus/alertmanager v0.22.3-0.20210628111558-8491f816296b
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the latest master of alertmanager too.

github.com/prometheus/client_golang v1.11.0
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.26.1-0.20210603143733-6ef301f414bf
github.com/prometheus/prometheus v1.8.2-0.20210510213326-e313ffa8abf6
github.com/prometheus/common v0.29.0
github.com/prometheus/prometheus v1.8.2-0.20210714080906-a0571449fd38
github.com/segmentio/fasthash v0.0.0-20180216231524-a72b379d632e
github.com/sony/gobreaker v0.4.1
github.com/spf13/afero v1.2.2
github.com/stretchr/testify v1.7.0
github.com/thanos-io/thanos v0.19.1-0.20210427154226-d5bd651319d2
github.com/uber/jaeger-client-go v2.28.0+incompatible
github.com/uber/jaeger-client-go v2.29.1+incompatible
github.com/weaveworks/common v0.0.0-20210419092856-009d1eebd624
go.etcd.io/bbolt v1.3.5
go.etcd.io/etcd v0.5.0-alpha.5.0.20200520232829-54ba9589114f
go.etcd.io/etcd/client/v3 v3.5.0-alpha.0.0.20210225194612-fa82d11a958a
go.etcd.io/etcd/server/v3 v3.5.0-alpha.0.0.20210225194612-fa82d11a958a
go.uber.org/atomic v1.7.0
golang.org/x/net v0.0.0-20210525063256-abc453219eb5
go.uber.org/atomic v1.8.0
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
google.golang.org/api v0.46.0
google.golang.org/grpc v1.37.0
golang.org/x/time v0.0.0-20210611083556-38a9dc6acbc6
google.golang.org/api v0.48.0
google.golang.org/grpc v1.38.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
sigs.k8s.io/yaml v1.2.0
Expand Down
194 changes: 144 additions & 50 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/compactor/compactor.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var (
}

DefaultBlocksCompactorFactory = func(ctx context.Context, cfg Config, logger log.Logger, reg prometheus.Registerer) (compact.Compactor, compact.Planner, error) {
compactor, err := tsdb.NewLeveledCompactor(ctx, reg, logger, cfg.BlockRanges.ToMilliseconds(), downsample.NewPool())
compactor, err := tsdb.NewLeveledCompactor(ctx, reg, logger, cfg.BlockRanges.ToMilliseconds(), downsample.NewPool(), nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This nil will result in this code:

	if mergeFunc == nil {
		mergeFunc = storage.NewCompactingChunkSeriesMerger(storage.ChainedSeriesMerge)
	}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's correct. Will keep the previous behaviour 👍

if err != nil {
return nil, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/compactor/compactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ func createTSDBBlock(t *testing.T, bkt objstore.Bucket, userID string, minT, max
MinBlockDuration: int64(2 * 60 * 60 * 1000), // 2h period
MaxBlockDuration: int64(2 * 60 * 60 * 1000), // 2h period
RetentionDuration: int64(15 * 86400 * 1000), // 15 days
})
}, nil)
require.NoError(t, err)

db.DisableCompactions()
Expand Down
2 changes: 1 addition & 1 deletion pkg/configs/legacy_promql/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ func NewStorage(t T) storage.Storage {
db, err := tsdb.Open(dir, nil, nil, &tsdb.Options{
MinBlockDuration: int64(24 * time.Hour / time.Millisecond),
MaxBlockDuration: int64(24 * time.Hour / time.Millisecond),
})
}, nil)
if err != nil {
t.Fatalf("Opening test storage failed: %s", err)
}
Expand Down
10 changes: 9 additions & 1 deletion pkg/configs/userconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ func (c RulesConfig) parseV2() (map[string][]rules.Rule, error) {
labels.FromMap(rl.Labels),
labels.FromMap(rl.Annotations),
nil,
"",
colega marked this conversation as resolved.
Show resolved Hide resolved
true,
log.With(util_log.Logger, "alert", rl.Alert.Value),
))
Expand Down Expand Up @@ -417,7 +418,14 @@ func (c RulesConfig) parseV1() (map[string][]rules.Rule, error) {
}

rule = rules.NewAlertingRule(
r.Name, expr, r.Duration, r.Labels, r.Annotations, nil, true,
r.Name,
expr,
r.Duration,
r.Labels,
r.Annotations,
nil,
"",
true,
log.With(util_log.Logger, "alert", r.Name),
)

Expand Down
1 change: 1 addition & 0 deletions pkg/configs/userconfig/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func TestParseLegacyAlerts(t *testing.T) {
labels.Label{Name: "message", Value: "I am a message"},
},
nil,
"",
true,
log.With(util_log.Logger, "alert", "TestAlert"),
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/ingester_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ func (i *Ingester) createTSDB(userID string) (*userTSDB, error) {
SeriesLifecycleCallback: userDB,
BlocksToDelete: userDB.blocksToDelete,
MaxExemplars: i.cfg.BlocksStorageConfig.TSDB.MaxExemplars,
})
}, nil)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the stats for TSDB's head, used to track the WAL replay status

if err != nil {
return nil, errors.Wrapf(err, "failed to open TSDB: %s", udir)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/ingester/ingester_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3317,7 +3317,7 @@ func TestHeadCompactionOnStartup(t *testing.T) {
NoLockfile: true,
MinBlockDuration: chunkRange,
MaxBlockDuration: chunkRange,
})
}, nil)
require.NoError(t, err)

db.DisableCompactions()
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/querier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func mockTSDB(t *testing.T, mint model.Time, samples int, step, chunkOffset time
opts := tsdb.DefaultHeadOptions()
opts.ChunkDirRoot = dir
// We use TSDB head only. By using full TSDB DB, and appending samples to it, closing it would cause unnecessary HEAD compaction, which slows down the test.
head, err := tsdb.NewHead(nil, nil, nil, opts)
head, err := tsdb.NewHead(nil, nil, nil, opts, nil)
require.NoError(t, err)
t.Cleanup(func() {
_ = head.Close()
Expand Down
2 changes: 1 addition & 1 deletion pkg/ruler/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ type RulesManager interface {
Stop()

// Updates rules manager state.
Update(interval time.Duration, files []string, externalLabels labels.Labels) error
Update(interval time.Duration, files []string, externalLabels labels.Labels, externalURL string) error

// Returns current rules groups.
RuleGroups() []*rules.Group
Expand Down
2 changes: 1 addition & 1 deletion pkg/ruler/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func (r *DefaultMultiTenantManager) syncRulesToManager(ctx context.Context, user
go manager.Run()
r.userManagers[user] = manager
}
err = manager.Update(r.cfg.EvaluationInterval, files, nil)
err = manager.Update(r.cfg.EvaluationInterval, files, nil, r.cfg.ExternalURL.String())
if err != nil {
r.lastReloadSuccessful.WithLabelValues(user).Set(0)
level.Error(r.logger).Log("msg", "unable to update rule manager", "user", user, "err", err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ruler/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (m *mockRulesManager) Stop() {
close(m.done)
}

func (m *mockRulesManager) Update(_ time.Duration, _ []string, _ labels.Labels) error {
func (m *mockRulesManager) Update(_ time.Duration, _ []string, _ labels.Labels, _ string) error {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/storegateway/bucket_stores_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ func generateStorageBlock(t *testing.T, storageDir, userID string, metricName st
require.NoError(t, os.RemoveAll(tmpDir))
}()

db, err := tsdb.Open(tmpDir, log.NewNopLogger(), nil, tsdb.DefaultOptions())
db, err := tsdb.Open(tmpDir, log.NewNopLogger(), nil, tsdb.DefaultOptions(), nil)
require.NoError(t, err)
defer func() {
require.NoError(t, db.Close())
Expand Down
2 changes: 1 addition & 1 deletion pkg/storegateway/gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ func mockTSDB(t *testing.T, dir string, numSeries, numBlocks int, minT, maxT int
MinBlockDuration: 2 * time.Hour.Milliseconds(),
MaxBlockDuration: 2 * time.Hour.Milliseconds(),
RetentionDuration: 15 * 24 * time.Hour.Milliseconds(),
})
}, nil)
require.NoError(t, err)

db.DisableCompactions()
Expand Down
2 changes: 1 addition & 1 deletion tools/blocksconvert/builder/tsdb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestTsdbBuilder(t *testing.T) {
id, err := b.finishBlock("unit test", map[string]string{"ext_label": "12345"})
require.NoError(t, err)

db, err := tsdb.Open(dir, util_log.Logger, prometheus.NewRegistry(), tsdb.DefaultOptions())
db, err := tsdb.Open(dir, util_log.Logger, prometheus.NewRegistry(), tsdb.DefaultOptions(), nil)
require.NoError(t, err)

blocks := db.Blocks()
Expand Down
60 changes: 60 additions & 0 deletions vendor/cloud.google.com/go/CHANGES.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading