From b4a89128b68427a2e6092fbb8b09f433eb2e2bf1 Mon Sep 17 00:00:00 2001 From: bergquist Date: Fri, 27 Oct 2017 16:37:38 +0200 Subject: [PATCH] datasource as cfg: update docs to include globbig --- docs/sources/administration/provisioning.md | 57 +++++++++++++++++++-- docs/sources/installation/configuration.md | 8 +++ 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/docs/sources/administration/provisioning.md b/docs/sources/administration/provisioning.md index 3389f2957ba..acff13883f0 100644 --- a/docs/sources/administration/provisioning.md +++ b/docs/sources/administration/provisioning.md @@ -1,7 +1,7 @@ +++ -title = "Datasource provisioning" +title = "Provisioning" description = "" -keywords = ["grafana", "provisioning", "datasources"] +keywords = ["grafana", "provisioning"] type = "docs" [menu.docs] parent = "admin" @@ -14,8 +14,55 @@ weight = 8 > This feature is available from v4.7 -It's possible to manage datasources in Grafana with the `conf/datasources.yaml` configuration file. Any datasource defined in this config file will be added to the database. -If the datasource already exists Grafana will update it to match the configuration file. You can also configure grafana to delete datasources that are not listed in the config by setting `purge_other_datasources` to true, this is disabled by default. +It's possible to manage datasources in Grafana by adding one or more yaml config files in the [`conf/datasources`](/installation/configuration/#datasources) directory. Each config file can contain a list of `datasources` that will be added or updated during start up. If the datasource already exists, Grafana will update it to match the configuration file. The config file can also contain a list of datasources that should be deleted. That list is called `delete_datasources`. Grafana will delete datasources listed in `delete_datasources` before inserting/updating those in the `datasource` list. ### Running multiple grafana instances. -If you are running multiple instances of Grafana you might run into problems if they have different versions of the datasource.yaml configuration file. The best way to solve this problem is to add a version number to each datasource in the configuration and increase it when you update the config. Grafana will only update datasources with the same or lower version number than specified in the config. That way old configs cannot overwrite newer configs if they restart at the same time. It's also recommended to not use purge_other_datasources when running multiple instances since instances with old configs might delete datasources created by new configs. +If you are running multiple instances of Grafana you might run into problems if they have different versions of the datasource.yaml configuration file. The best way to solve this problem is to add a version number to each datasource in the configuration and increase it when you update the config. Grafana will only update datasources with the same or lower version number than specified in the config. That way old configs cannot overwrite newer configs if they restart at the same time. + +### Example datasource config file +```yaml +# list of datasources that should be deleted from the database +delete_datasources: + - name: Graphite + org_id: 1 + +# list of datasources to insert/update depending +# whats available in the datbase +datasources: + # name of the datasource. Required +- name: Graphite + # datasource type. Required + type: graphite + # access mode. direct or proxy. Required + access: proxy + # org id. will default to org_id 1 if not specified + org_id: 1 + # url + url: http://localhost:8080 + # database password, if used + password: + # database user, if used + user: + # database name, if used + database: + # enable/disable basic auth + basic_auth: + # basic auth username + basic_auth_user: + # basic auth password + basic_auth_password: + # enable/disable with credentials headers + with_credentials: + # mark as default datasource. Max one per org + is_default: + # json data + json_data: '{"graphiteVersion":"0.9"}' + # json object of data that will be encrypted in UI. + secure_json_fields: '' + # including this value garantees that instance with old configs cannot + # overwrite your last change. + version: 1 + # allow users to edit datasources from the UI. + editable: true +``` + diff --git a/docs/sources/installation/configuration.md b/docs/sources/installation/configuration.md index 24ddca9160f..e476a3ace02 100644 --- a/docs/sources/installation/configuration.md +++ b/docs/sources/installation/configuration.md @@ -87,6 +87,14 @@ command line in the init.d script or the systemd service file. It can be overridden in the configuration file or in the default environment variable file. +### plugins + +Directory where grafana will automatically scan and look for plugins + +### datasources + +Config files containing datasources that will be configured at startup + ## [server] ### http_addr