Skip to content

Commit

Permalink
[query] add POST to /series endpoint (#1606)
Browse files Browse the repository at this point in the history
  • Loading branch information
arnikola authored May 6, 2019
1 parent b1b848e commit 98044ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/query/api/v1/handler/prometheus/remote/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ import (
const (
// PromSeriesMatchURL is the url for remote prom series matcher handler.
PromSeriesMatchURL = handler.RoutePrefixV1 + "/series"
)

// PromSeriesMatchHTTPMethod is the HTTP method used with this resource.
PromSeriesMatchHTTPMethod = http.MethodGet
var (
// PromSeriesMatchHTTPMethods are the HTTP methods used with this resource.
PromSeriesMatchHTTPMethods = []string{http.MethodGet, http.MethodPost}
)

// PromSeriesMatchHandler represents a handler for prometheus series matcher endpoint.
Expand Down
8 changes: 5 additions & 3 deletions src/query/api/v1/httpd/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,11 @@ func (h *Handler) RegisterRoutes() error {
}

// Series match endpoints
h.router.HandleFunc(remote.PromSeriesMatchURL,
wrapped(remote.NewPromSeriesMatchHandler(h.storage, h.tagOptions)).ServeHTTP,
).Methods(remote.PromSeriesMatchHTTPMethod)
for _, method := range remote.PromSeriesMatchHTTPMethods {
h.router.HandleFunc(remote.PromSeriesMatchURL,
wrapped(remote.NewPromSeriesMatchHandler(h.storage, h.tagOptions)).ServeHTTP,
).Methods(method)
}

// Debug endpoints
h.router.HandleFunc(validator.PromDebugURL,
Expand Down

0 comments on commit 98044ad

Please sign in to comment.