Make gateway compatible with Prometheus 1.0 and 2.0

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis 2018-01-13 09:32:49 +00:00
parent fe02ef5151
commit 262b0afda7

View File

@ -30,7 +30,7 @@ func NewPrometheusQuery(host string, port int, client *http.Client) PrometheusQu
// Fetch queries aggregated stats // Fetch queries aggregated stats
func (q PrometheusQuery) Fetch(query string) (*VectorQueryResponse, error) { func (q PrometheusQuery) Fetch(query string) (*VectorQueryResponse, error) {
req, reqErr := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s:%d/api/v1/query/?query=%s", q.Host, q.Port, query), nil) req, reqErr := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s:%d/api/v1/query?query=%s", q.Host, q.Port, query), nil)
if reqErr != nil { if reqErr != nil {
return nil, reqErr return nil, reqErr
} }