I have bound grafana to a rest API and it works pretty well.
However the authentication is through bearer token only, which expires everyday.
I do have a script that generates a new token everyday, however, I’m struggling to update the sqlite entry in the sqlite database grafana.db
I appears the headers are stored in the field
secure_json_data
from table
data_source
this secure_json_data seems encrypted, but I don’t know how to correctly encrypt my new bearer. Any hint ?
I’m using JSON API plug in by Marcus Olsson.
I can actually get a new token through scripting language, my issue is how to automatically update the datasource with the updated token.
Like I said, I think I found where this information is stored in the grafana sqlite database, however as it is encrypted, I don’t know how to update the field with the expected encryption.
Alright, this ended up very useful.
I managed to specify the api token through provisionning.
Now I noticed grafana server had to be restarted for datasource.yaml modifications to be taken in account, is there any more elegant way to update my token daily without have to stop/start the server ?