cloudspout / cloudspout-button-panel

Grafana panel to integrate with any kind of HTTP/REST API
MIT License
50 stars 35 forks source link

Integrating variables and ad hoc filters #11

Closed raulsperoni closed 3 years ago

raulsperoni commented 3 years ago

Hi! First thank you, this is a great plugin. I'm using grafana for some admin tasks and this is very useful.

For my needs I forked and modified your code.

In the editor I allow to add other kind of parameters: "variable parameters" that will be resolved before the request. Also I allow to use the variable notation in the label of the button. "This is the label for $variable"

In the panel I'm resolving the variables configured in the editor: first I look for ad hoc filters (I use them in elasticsearch) then for regular variables like text box variables.

The use case form me is the ability to invoke an endpoint with current dashboard filters and variables.

What do you think? would you be interested in a pull request?

derjust commented 3 years ago

I can totally see the use case for Grafana variables. I'm more than happy to accept PRs - I created this plugin for my very simple use case but happy to extend it

derjust commented 3 years ago

Variables in the Button text should work now

richimus123 commented 3 years ago

Awesome, I was just wondering if this was in the works. Any ETA on when this would make it into a release?

derjust commented 3 years ago

Using templateSrv should address the use case - have to re-check the PR if I missed something

richimus123 commented 3 years ago

From your release notes, this adds support for variables in the following ways:

Any chance of adding support in the payload as well? Should I open a different enhancement request?

derjust commented 3 years ago

That shouldn't be too hard actually. I will give it a shot