Skip to content

Commit

Permalink
Prometheus api uses grafana/regexp now
Browse files Browse the repository at this point in the history
When initializing v1.NewAPI we're passing a compiled Regexp that
unmatches the expected type becuase we were importing "regexp" instead
of "github.com/grafana/regexp".

This commit makes it consistent by replacing "regexp" with
"github.com/grafana/regexp" and updating go mod.

Signed-off-by: Jesus Vazquez <jesus.vazquez@grafana.com>
  • Loading branch information
jesusvazquez committed Apr 20, 2022
1 parent f79d36c commit 5bbabf7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -57,6 +57,7 @@ require (
github.com/alecthomas/chroma v0.10.0
github.com/google/go-github/v32 v32.1.0
github.com/grafana-tools/sdk v0.0.0-20211220201350-966b3088eec9
github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
gopkg.in/alecthomas/kingpin.v2 v2.2.6
Expand Down Expand Up @@ -138,7 +139,6 @@ require (
github.com/googleapis/gax-go/v2 v2.2.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20191106031601-ce3c9ade29de // indirect
github.com/gosimple/slug v1.1.1 // indirect
github.com/grafana/regexp v0.0.0-20220304095617-2e8d9baf4ac2 // indirect
github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.2.0.20201207153454-9f6bf00c00a7 // indirect
github.com/hashicorp/consul/api v1.12.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/handlers.go
Expand Up @@ -11,12 +11,12 @@ import (
"html/template"
"net/http"
"path"
"regexp"
"sort"
"sync"

"github.com/go-kit/log"
"github.com/gorilla/mux"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/error_translate_queryable_test.go
Expand Up @@ -10,11 +10,11 @@ import (
"fmt"
"net/http"
"net/http/httptest"
"regexp"
"testing"
"time"

"github.com/go-kit/log"
"github.com/grafana/regexp"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/route"
Expand Down

0 comments on commit 5bbabf7

Please sign in to comment.