Skip to content

Commit

Permalink
Update PromQL till March 30
Browse files Browse the repository at this point in the history
Signed-off-by: Harkishen-Singh <[email protected]>

This commit updates the PromQL code upto commit
3e4bd4d9135200f6e74a2ba3ef47dba1de8656d9

This commit also includes the changes for the new
PromQL stats support which is an optional feature.
  • Loading branch information
Harkishen-Singh committed May 25, 2022
1 parent 2f52466 commit f2233c7
Show file tree
Hide file tree
Showing 19 changed files with 937 additions and 295 deletions.
10 changes: 4 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ require (
github.com/golang/snappy v0.0.4
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/hashicorp/go-hclog v1.2.0
github.com/jackc/pgconn v1.11.0
Expand All @@ -25,22 +26,20 @@ require (
github.com/jaegertracing/jaeger v1.33.0
github.com/oklog/run v1.1.0
github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/jaeger v0.49.0
github.com/opentracing/opentracing-go v1.2.0
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/peterbourgon/ff/v3 v3.1.2
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.12.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.34.0
github.com/prometheus/prometheus v1.8.2-0.20220117154355-4855a0c067e2
github.com/prometheus/prometheus v1.8.2-0.20220329205120-3e4bd4d91352
github.com/sergi/go-diff v1.2.0
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
github.com/stretchr/testify v1.7.1
github.com/testcontainers/testcontainers-go v0.13.0
github.com/thanos-io/thanos v0.25.2
github.com/uber/jaeger-client-go v2.30.0+incompatible
go.opentelemetry.io/collector/model v0.49.0
go.opentelemetry.io/collector/pdata v0.49.0 // indirect
go.opentelemetry.io/collector/pdata v0.49.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.31.0
go.opentelemetry.io/otel v1.6.3
go.opentelemetry.io/otel/exporters/jaeger v1.6.3
Expand All @@ -51,11 +50,10 @@ require (
go.uber.org/automaxprocs v1.5.1
go.uber.org/goleak v1.1.12
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150
google.golang.org/genproto v0.0.0-20220217155828-d576998c0009 // indirect
google.golang.org/grpc v1.46.0
google.golang.org/protobuf v1.28.0
gopkg.in/yaml.v2 v2.4.0
)

// Make sure Prometheus version is pinned as Prometheus semver does not include Go APIs.
replace github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20220117154355-4855a0c067e2
replace github.com/prometheus/prometheus => github.com/prometheus/prometheus v1.8.2-0.20220329205120-3e4bd4d91352
401 changes: 194 additions & 207 deletions go.sum

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion pkg/api/parser/text/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ func ParseRequest(r *http.Request, wr *prompb.WriteRequest) error {
}

var (
p = textparse.New(b, r.Header.Get("Content-Type"))
defTime = int64(model.TimeFromUnixNano(timeProvider().UnixNano()))
et textparse.Entry
)

p, err := textparse.New(b, r.Header.Get("Content-Type"))
if err != nil {
return fmt.Errorf("parsing contents from request body: %w", err)
}

for {
if et, err = p.Next(); err != nil {
if err == io.EOF {
Expand Down
2 changes: 1 addition & 1 deletion pkg/promql/bench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func BenchmarkRangeQuery(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
qry, err := engine.NewRangeQuery(
teststorage, c.expr,
teststorage, nil, c.expr,
time.Unix(int64((numIntervals-c.steps)*10), 0),
time.Unix(int64(numIntervals*10), 0), time.Second*10)
if err != nil {
Expand Down
Loading

0 comments on commit f2233c7

Please sign in to comment.