From 7a2ab93e7a0819d6c89cc366d0c61115096216f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Bedi?= Date: Thu, 8 Apr 2021 18:10:59 +0200 Subject: [PATCH] Prometheus: Allow exemplars endpoint in data source proxy (#32802) --- pkg/api/pluginproxy/ds_proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/pluginproxy/ds_proxy.go b/pkg/api/pluginproxy/ds_proxy.go index 1e14d21377c..e5cf53dacc9 100644 --- a/pkg/api/pluginproxy/ds_proxy.go +++ b/pkg/api/pluginproxy/ds_proxy.go @@ -253,7 +253,7 @@ func (proxy *DataSourceProxy) validateRequest() error { if proxy.ctx.Req.Request.Method == "PUT" { return errors.New("puts not allowed on proxied Prometheus datasource") } - if proxy.ctx.Req.Request.Method == "POST" && !(proxy.proxyPath == "api/v1/query" || proxy.proxyPath == "api/v1/query_range" || proxy.proxyPath == "api/v1/series" || proxy.proxyPath == "api/v1/labels") { + if proxy.ctx.Req.Request.Method == "POST" && !(proxy.proxyPath == "api/v1/query" || proxy.proxyPath == "api/v1/query_range" || proxy.proxyPath == "api/v1/series" || proxy.proxyPath == "api/v1/labels" || proxy.proxyPath == "api/v1/query_exemplars") { return errors.New("posts not allowed on proxied Prometheus datasource except on /query, /query_range, /series and /labels") } }