Skip to content

Commit fe421bc

Browse files
authored
revendors cortex & loki + compatibility fixes (#189)
1 parent 4c91805 commit fe421bc

File tree

1,620 files changed

+88846
-35296
lines changed

Some content is hidden

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

1,620 files changed

+88846
-35296
lines changed

go.mod

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ require (
88
github.com/alecthomas/chroma v0.7.0
99
github.com/alecthomas/repr v0.0.0-20181024024818-d37bc2a10ba1 // indirect
1010
github.com/alecthomas/units v0.0.0-20210208195552-ff826a37aa15
11-
github.com/cortexproject/cortex v1.7.1-0.20210310163109-5d23b16190f6
11+
github.com/cortexproject/cortex v1.9.1-0.20210603172355-5e508061891a
1212
github.com/dlclark/regexp2 v1.2.0 // indirect
1313
github.com/go-kit/kit v0.10.0
1414
github.com/gocql/gocql v0.0.0-20200526081602-cd04bd7f22a7
1515
github.com/gogo/protobuf v1.3.2
16-
github.com/golang/snappy v0.0.3-0.20201103224600-674baa8c7fc3
16+
github.com/golang/snappy v0.0.3
1717
github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac // indirect
1818
github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82 // indirect
1919
github.com/gonum/integrate v0.0.0-20181209220457-a422b5c0fdf2 // indirect
@@ -24,23 +24,23 @@ require (
2424
github.com/google/go-github/v32 v32.1.0
2525
github.com/gorilla/mux v1.7.3
2626
github.com/grafana-tools/sdk v0.0.0-20210310213032-c3f3511b3e9b
27-
github.com/grafana/loki v1.6.2-0.20210310125813-306cc724380c
27+
github.com/grafana/loki v1.6.2-0.20210604065612-c3af249fe0f7
2828
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
2929
github.com/oklog/ulid v1.3.1
3030
github.com/opentracing-contrib/go-stdlib v1.0.0
3131
github.com/opentracing/opentracing-go v1.2.0
3232
github.com/pkg/errors v0.9.1
33-
github.com/prometheus/alertmanager v0.21.1-0.20210310093010-0f9cab6991e6
34-
github.com/prometheus/client_golang v1.9.0
35-
github.com/prometheus/common v0.18.0
36-
github.com/prometheus/prometheus v1.8.2-0.20210215121130-6f488061dfb4
33+
github.com/prometheus/alertmanager v0.22.1-0.20210603124511-8b584eb2265e
34+
github.com/prometheus/client_golang v1.10.0
35+
github.com/prometheus/common v0.26.1-0.20210603143733-6ef301f414bf
36+
github.com/prometheus/prometheus v1.8.2-0.20210510213326-e313ffa8abf6
3737
github.com/sirupsen/logrus v1.7.0
3838
github.com/stretchr/testify v1.7.0
39-
github.com/thanos-io/thanos v0.13.1-0.20210226164558-03dace0a1aa1
40-
github.com/weaveworks/common v0.0.0-20210112142934-23c8d7fa6120
39+
github.com/thanos-io/thanos v0.19.1-0.20210427154226-d5bd651319d2
40+
github.com/weaveworks/common v0.0.0-20210419092856-009d1eebd624
4141
go.uber.org/atomic v1.7.0
42-
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
43-
google.golang.org/api v0.39.0
42+
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
43+
google.golang.org/api v0.46.0
4444
gopkg.in/alecthomas/kingpin.v2 v2.2.6
4545
gopkg.in/yaml.v2 v2.4.0
4646
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
@@ -66,8 +66,5 @@ replace github.com/gocql/gocql => github.com/grafana/gocql v0.0.0-20200605141915
6666
replace github.com/bradfitz/gomemcache => github.com/themihai/gomemcache v0.0.0-20180902122335-24332e2d58ab
6767

6868
// Required for Alertmanager
69-
replace github.com/go-openapi/errors => github.com/go-openapi/errors v0.19.4
70-
71-
replace github.com/go-openapi/validate => github.com/go-openapi/validate v0.19.8
7269

7370
replace github.com/hashicorp/consul => github.com/hashicorp/consul v1.8.1

go.sum

Lines changed: 300 additions & 73 deletions
Large diffs are not rendered by default.

pkg/backfill/backfill.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func CreateBlocks(input IteratorCreator, mint, maxt int64, maxSamplesInAppender
118118
}
119119

120120
l := i.Labels()
121-
if _, err := app.Add(i.Labels(), ts, v); err != nil {
121+
if _, err := app.Append(0, i.Labels(), ts, v); err != nil {
122122
return errors.Wrap(err, fmt.Sprintf("add sample for metric=%s ts=%s value=%f", l, model.Time(ts).Time().Format(time.RFC3339Nano), v))
123123
}
124124

pkg/bench/write_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type writeClient struct {
4040

4141
// newWriteClient creates a new client for remote write.
4242
func newWriteClient(name string, tenantName string, conf *remote.ClientConfig, logger log.Logger, requestHistogram *prometheus.HistogramVec) (*writeClient, error) {
43-
httpClient, err := config_util.NewClientFromConfig(conf.HTTPClientConfig, "bench_write_client", false, false)
43+
httpClient, err := config_util.NewClientFromConfig(conf.HTTPClientConfig, "bench_write_client", config_util.WithHTTP2Disabled())
4444
if err != nil {
4545
return nil, err
4646
}

pkg/commands/analyse_prometheus.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (cmd *PrometheusAnalyseCommand) run(k *kingpin.ParseContext) error {
5757

5858
ctx, cancel := context.WithTimeout(context.Background(), cmd.readTimeout)
5959
defer cancel()
60-
metricNames, _, err := v1api.LabelValues(ctx, labels.MetricName, time.Now().Add(-10*time.Minute), time.Now())
60+
metricNames, _, err := v1api.LabelValues(ctx, labels.MetricName, nil, time.Now().Add(-10*time.Minute), time.Now())
6161
if err != nil {
6262
return errors.Wrap(err, "error querying for metric names")
6363
}

pkg/rules/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"path/filepath"
99
"strings"
1010

11-
"github.com/grafana/loki/pkg/ruler/manager"
11+
"github.com/grafana/loki/pkg/ruler"
1212
"github.com/prometheus/prometheus/pkg/rulefmt"
1313
log "github.com/sirupsen/logrus"
1414
yaml "gopkg.in/yaml.v3"
@@ -132,7 +132,7 @@ func ParseLoki(f string) ([]RuleNamespace, []error) {
132132
grps = append(grps, g.RuleGroup)
133133
}
134134

135-
if errs := manager.ValidateGroups(grps...); len(errs) > 0 {
135+
if errs := ruler.ValidateGroups(grps...); len(errs) > 0 {
136136
return nil, errs
137137
}
138138

pkg/rules/rules_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,8 @@ func TestLintExpressions(t *testing.T) {
250250
},
251251
{
252252
name: "logql simple",
253-
expr: `count_over_time({ foo != "bar" }[12m]) > 1`,
254-
expected: `(count_over_time({foo!="bar"}[12m]) > 1)`,
253+
expr: `count_over_time({ foo = "bar" }[12m]) > 1`,
254+
expected: `(count_over_time({foo="bar"}[12m]) > 1)`,
255255
count: 1, modified: 1,
256256
logql: true,
257257
},

0 commit comments

Comments
 (0)