Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[query] add POST to /series endpoint #1606

Merged
merged 2 commits into from
May 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/query/api/v1/handler/prometheus/remote/match.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ 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
// 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