I’m developing a backend datasource plugin that can function as an annotations source.
I’ve implemented the backend and the query API is functional and I can see events in Grafana. However, the events from my datasource are not always available, i.e. they depend on certain external events.
In the annotations query editor, to map the the fields like “time”, “title”, “text” etc I need an event to be returned in the results but this does not always return a result due to what I mentioned above. If I can increase the time range of the query in the annotation editor I can go back further until I find an event, but this does not seem to be possible.
Is there any way to achieve this? Any other suggestions are also welcome.
Hi @admincd43
the user is the responsible of selecting the time range and as such, if there’s no data the user should be the one deciding to adjust the time range themselves not the plugin.
There is no option to adjust the time range in the annotations query editor page.
I am not referring to the panels where you can adjust the time range. Apologies if this was not clear in the original question.
To add some more context, this is while creating the annotation for the first time in the annotation query editor. The annotion fields like text, time, have to be mapped to actual fields in the event, and for that an event has to exist.
So I think I found a solution or workaround to this. I’ve added some more context in another comment.
The time span sent to the plugin while mapping values in the annotation editor is the same as what was chosen in the dashboard’s panel view. So if I select a time range (as a user) in the dashboard panels view where I know events exist, and then go to the annotation editor (which does not have a time range picker), that solves the problem.