From d6c93c12bf45397a347aefb57025c8ec5bbc9c1d Mon Sep 17 00:00:00 2001 From: Chris Marchbanks Date: Fri, 3 May 2024 08:09:06 -0600 Subject: [PATCH] Prometheus: Add reqAction to Prometheus routes (#87208) Add reqAction to Prometheus routes This should allow provisioned service accounts that do not have a role to use the /proxy endpoints for Prometheus. This is desired for some integrations that need to query for labels or other data not part of /ds/query. --- .../plugins/datasource/prometheus/plugin.json | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/plugin.json b/public/app/plugins/datasource/prometheus/plugin.json index ab3c527c430..5c22bed1c53 100644 --- a/public/app/plugins/datasource/prometheus/plugin.json +++ b/public/app/plugins/datasource/prometheus/plugin.json @@ -7,52 +7,62 @@ { "method": "POST", "path": "api/v1/query", - "reqRole": "Viewer" + "reqRole": "Viewer", + "reqAction": "datasources:query" }, { "method": "POST", "path": "api/v1/query_range", - "reqRole": "Viewer" + "reqRole": "Viewer", + "reqAction": "datasources:query" }, { "method": "POST", "path": "api/v1/series", - "reqRole": "Viewer" + "reqRole": "Viewer", + "reqAction": "datasources:query" }, { "method": "POST", "path": "api/v1/labels", - "reqRole": "Viewer" + "reqRole": "Viewer", + "reqAction": "datasources:query" }, { "method": "POST", "path": "api/v1/query_exemplars", - "reqRole": "Viewer" + "reqRole": "Viewer", + "reqAction": "datasources:query" }, { "method": "GET", "path": "/rules", - "reqRole": "Viewer" + "reqRole": "Viewer", + "reqAction": "datasources:query" }, { "method": "POST", "path": "/rules", - "reqRole": "Editor" + "reqRole": "Editor", + "reqAction": "datasources:edit" }, { "method": "DELETE", "path": "/rules", - "reqRole": "Editor" + "reqRole": "Editor", + "reqAction": "datasources:edit" }, { "method": "DELETE", "path": "/config/v1/rules", - "reqRole": "Editor" + "reqRole": "Editor", + "reqAction": "datasources:edit" }, { "method": "POST", "path": "/config/v1/rules", - "reqRole": "Editor" + "reqRole": "Editor", + "reqAction": "datasources:edit" } ], "includes": [