Skip to content

Commit

Permalink
Merge pull request #125 from prometheus/superq/promql_client_go
Browse files Browse the repository at this point in the history
Update promql client_golang
  • Loading branch information
SuperQ authored Nov 8, 2024
2 parents 5cc9da7 + 2f962aa commit 01fc169
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 411 deletions.
2 changes: 1 addition & 1 deletion promql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18 as build-env
FROM golang:1.23 as build-env

WORKDIR /go/src/promql
COPY . /go/src/promql
Expand Down
2 changes: 1 addition & 1 deletion promql/cmd/promql-compliance-tester/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"flag"
"log"
"math"
"net/http"
"os"
Expand All @@ -14,7 +15,6 @@ import (
"github.com/pkg/errors"
"github.com/prometheus/client_golang/api"
v1 "github.com/prometheus/client_golang/api/prometheus/v1"
"github.com/prometheus/common/log"
"github.com/prometheus/compliance/promql/comparer"
"github.com/prometheus/compliance/promql/config"
"github.com/prometheus/compliance/promql/output"
Expand Down
4 changes: 2 additions & 2 deletions promql/comparer/comparer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ const (
// PromAPI allows running instant and range queries against a Prometheus-compatible API.
type PromAPI interface {
// Query performs a query for the given time.
Query(ctx context.Context, query string, ts time.Time) (model.Value, v1.Warnings, error)
Query(ctx context.Context, query string, ts time.Time, opts ...v1.Option) (model.Value, v1.Warnings, error)
// QueryRange performs a query for the given range.
QueryRange(ctx context.Context, query string, r v1.Range) (model.Value, v1.Warnings, error)
QueryRange(ctx context.Context, query string, r v1.Range, opts ...v1.Option) (model.Value, v1.Warnings, error)
}

// TestCase represents a fully expanded query to be tested.
Expand Down
18 changes: 8 additions & 10 deletions promql/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,24 @@ require (
github.com/cheggaaa/pb/v3 v3.1.5
github.com/google/go-cmp v0.6.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.8.1-0.20201120195816-39b478e90c0b
github.com/prometheus/common v0.14.0
github.com/prometheus/client_golang v1.20.5
github.com/prometheus/common v0.60.1
go.uber.org/atomic v1.11.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
github.com/fatih/color v1.15.0 // indirect
github.com/json-iterator/go v1.1.10 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6 // indirect
golang.org/x/sys v0.25.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
)
Loading

0 comments on commit 01fc169

Please sign in to comment.