If you use a datasource that doesn’t support annotations it can be cumbersome to have to add ElasticSearch or something more meaningful just to add annotations.
Instead, you can try https://github.com/fzakaria/simple-annotations-plugin which allows the creation of annotations and stores them into the dashboard.json – that means that annotations can easily added to any graph regardless of the datasource.
Feedback welcome.
Hi @mefraimsson,
We use HTTP API for querying the annotations that aer already entered by users.
For this aim, we create a curl
curl -H "Authorization: Bearer token" http://hostip:3000/api/annotations?from=1643673600&to=1646092799
this query returns all the annotiations that have been already entered.
Our problem is: we want to save all these annotiations on Mongo DB by running curl each time. We do not want to have duplicated annotations for solving this problem we want to know that is there any elegant way to create a curl query which is able to query in timedelta (for examle if we create cronjob each curl must query a specific timestamp range in order to avoid annotiations duplication).
Unfortunately not I believe. With your mentioned curl command as long as there’s no more than 100 annotations in used time range you should be safe, otherwise not. You might need to handle the de-duplication before writing to Mongo DB.