How can I make alerts work with my custom datasource plug-in? What should I make in the backend?

I am getting the scary “tsdb.HandleRequest() error Could not find executor for data source type” error.

I have understood through this thread (How to avoid "Error: tsdb.HandleRequest() error Could not find executor for data source type:mydb") that I need to make changes to the backend, somewhere in /grafana/pkg/tsdb/…

However I don’t know where to even start.

Could you guys give some clues or examples, or tell me what to replicate (based on the existing datasources)?

It would be wonderful to have an example (maybe an extension to this one: https://github.com/grafana/simple-json-datasource) for the people who want to change the backend in order to make the alerts work for their datasources.

Thanks!

There are a couple of examples you could look at to get started:

1 Like

I am facing the same problem.
Currently, I’m trying to create a Custom Datasource plugin.
However, it is stated in http://docs.grafana.org/alerting/rules/ that “Alert” is a feature that needs support in the Grafana core backend.
I have checked above examples but there is no mention of how to modify the back-end.
Please give me a clearer guidance.

@nemewsys were you able to move forward on this ? trying to port the druid plugin to backend

I tried to use simple json datasource backend plugin branch
But the alert conditions are not respecting the time range
Also when i try running make file the plugins breaks with error=“tsdb.HandleRequest() error Could not find executor for data source type: grafana-simple-json-datasource”.

1 Like

Could you pls share how did you add data source in backend, for alert list?

1 Like

There should be lots of information and examples out there: