Provisioning: datasources auto deletion (#83034)

This commit is contained in:
Mikel Vuka
2024-04-08 11:45:39 +02:00
committed by GitHub
parent 4b4bdc7c33
commit 724517dc40
16 changed files with 205 additions and 2 deletions

View File

@@ -81,6 +81,14 @@ If the data source already exists, Grafana reconfigures it to match the provisio
The configuration file can also list data sources to automatically delete, called `deleteDatasources`.
Grafana deletes the data sources listed in `deleteDatasources` _before_ adding or updating those in the `datasources` list.
You can configure Grafana to automatically delete provisioned data sources when they're removed from the provisioning file.
To do so, add `prune: true` to the root of your provisioning file.
With this configuration, Grafana also removes the provisioned data sources if you remove the provisioning file entirely.
{{% admonition type="note" %}}
The `prune` parameter is available in Grafana v11.1 and higher.
{{% /admonition %}}
### Running multiple Grafana instances
If you run multiple instances of Grafana, add a version number to each data source in the configuration and increase it when you update the configuration.
@@ -100,6 +108,10 @@ deleteDatasources:
- name: Graphite
orgId: 1
# Mark provisioned data sources for deletion if they are no longer in a provisioning file.
# It takes no effect if data sources are already listed in the deleteDatasources section.
prune: true
# List of data sources to insert/update depending on what's
# available in the database.
datasources: