grafana-prometheus-alertmanager-datasource icon indicating copy to clipboard operation
grafana-prometheus-alertmanager-datasource copied to clipboard

refactor: rewrite plugin to add multiples queries support

Open hbollon opened this issue 2 years ago • 0 comments

With this PR, I completely rewrite this plugin to add the possibility to have multiples possibles queries to execute and be able to choose the one we want through a scenario parameter. Indeed, I introduced a new QueryEditor type called EditorQuery, it's extends DataQuery and have a scenario attribute. All custom QueryEditors will now extends EditorQuery instead of DataQuery to have this new common attribute.

Screenshot from 2022-05-23 15-41-44

On the query editor view of the plugin, a new selector will be available to choose which query we want to build. If user change this settings, the query editor will be updated for the new scenario with associated fields for the query config. Atm, only one scenario is available which is the old one for alerts but a new one is coming to fetch silences rules from Alertmanager.

Before: Screenshot from 2022-05-23 15-34-19

Now: Screenshot from 2022-05-23 15-34-40

By doing this change, I must rewrite almost all this plugin. So, I refactor others aspects of the code and updated some parts of it to more modern typescript.

hbollon avatar May 23 '22 13:05 hbollon