Skip to content

Commit

Permalink
manipulate series query
Browse files Browse the repository at this point in the history
  • Loading branch information
foosinn committed Jul 30, 2020
1 parent cc66e4e commit 49f431b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/labeler/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (l *Labeler) PromACLMiddlewareFor(u *url.URL) func(http.Handler) http.Handl
modified := false
r.Host = u.Hostname()

if r.URL.EscapedPath() == "/api/v1/query" || r.URL.EscapedPath() == "/api/v1/query_range" {
if r.URL.EscapedPath() == "/api/v1/query" || r.URL.EscapedPath() == "/api/v1/query_range" || r.URL.EscapedPath() == "/api/v1/series" {
// lookup acl in context
acl, ok := r.Context().Value("acl").(core.ACL)
if !ok {
Expand Down Expand Up @@ -91,7 +91,7 @@ func (l *Labeler) PromACLMiddlewareFor(u *url.URL) func(http.Handler) http.Handl
// labelize modifies a prometheus query to inject labels based on acl
func (l *Labeler) labelize(params *url.Values, acl core.ACL) (modified bool, err error) {
for key, value := range *params {
if key == "query" {
if key == "query" || key == "match[]" {
query := value[0]

start := time.Now()
Expand Down

0 comments on commit 49f431b

Please sign in to comment.