The settings of the datasources in the UI are not saved when using provisioning after restarting Grafana

  • What Grafana version and what operating system are you using?
    Grafana version: 10.1
    OS : Ubuntu (grafana in docker)
  • What are you trying to achieve?
    Saving the datasource settings in the UI without overwriting the settings from the provisioning file when restarting Grafana
  • How are you trying to achieve it?
    In the provisioning folder, I added a yaml file with the settings of the datasources (with the ability to edit in the UI). In the UI, I made changes to the datasource and saved it, then restarted the Grafana docker container
  • What happened?
    All the changes made through the UI are gone. That is, the settings from yaml from provisioning were applied again. Changing the configuration version does not help, I tried to reduce and increase the version
  • What did you expect to happen?
    When using the datasource settings from provisioning, changes in the UI were saved.
  • Can you copy/paste the configuration(s) that you are having problems with?
    Here is my sample settings file for provisioning
-   name: rx-log-metrics
    editable: true
    type: elasticsearch
    access: proxy
    url: 'http://192.168.55.28:9200'
    jsonData:
        timeField: "@timestamp"
        esVersion: 7.16.1
        index: "rx-log-metrics*"
        logMessageField: message
        logLevelField: logLevel
    version: 11
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    No
  • Did you follow any online instructions? If so, what is the URL?
    Used this documentation Provision Grafana | Grafana documentation

Tell me, please, how do I make my case?

welcome @pavelmokrushin

try to add the following line under volumes: in your docker-compose file.

 - ./grafana-db/:/var/lib/grafana # persist Grafana database

Then, create a new directory where your docker-compose file is. The name of the new directory must match the name of the directory in the docker-compose file.

mkdir ./grafana-db

Change file ownership, so the docker container can read the contents of the folder as well as write to it

chown 472:root ./grafana-db/

Finally, compose the container as root

sudo docker compose up -d

Hope it helps!

I have volume configured for Grafana in docker. The problem is not that the database is being deleted, but that data from the provisioning datasource file is being overwritten in it, and I can’t influence it in any way

hi @pavelmokrushin

Thanks for the clarification

I tried from my end and I got the same results.

You are welcome to open a new issue in our public repo and link back to this post

Thank you, I will write there