How to execute a script to extract metrics from Prometheus

Hey there, is there a way to execute a custom script (Python? JS?) to extract metrics saved into Prometheus?
I can execute a script to get my purpose but I would like to do clicking a button into a Grafana dashboard.
For example, can I do it using the Data Manipulation plugin with it Custom Request section?
Currently I am using Grafana v8.5.15

I am pretty sure the Data Manipulation plugin can do that (maybe @mikhailvolkov can confirm).

Perhaps another way is to install the button panel plugin for the user to click and have Node-RED running on the same machine (to receive the command and then execute the custom script).

1 Like

Node-RED will be required as a backend service, isn’t it? To be honest, I would like to avoid further components if there is a way to bypass them.

@rug If you can implement your logic in JavaScript, then DM’s Custom Request can be an excellent way to avoid having a backend service.

Let us know if you are able to do it.

1 Like