From e00e067d55030c2614fdcbdca3f1b15de1360fba Mon Sep 17 00:00:00 2001 From: mixayloff-dimaaylov <65488726+mixayloff-dimaaylov@users.noreply.github.com> Date: Sun, 16 Oct 2022 15:15:54 +0300 Subject: [PATCH] [grafana] dashboards: Allow changes from Grafana UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit В Grafana 6.5.1 появилась возможность сохранять изменения в *provisioned dashboards*. Эти изменения не попадают в файловую систему, но это всё равно удобнее, чем создавать клон дашборда. Ref: https://github.com/grafana/grafana/pull/19820 Docs: https://grafana.com/docs/grafana/v9.1/administration/provisioning/#dashboards --- .../provisioning/dashboards/clickhouse.yaml | 29 ++++++++++++----- .../provisioning/dashboards/sample.yaml | 31 ++++++++++++++----- 2 files changed, 45 insertions(+), 15 deletions(-) diff --git a/image_content/config/grafana/etc/grafana/provisioning/dashboards/clickhouse.yaml b/image_content/config/grafana/etc/grafana/provisioning/dashboards/clickhouse.yaml index ce47412..7565118 100644 --- a/image_content/config/grafana/etc/grafana/provisioning/dashboards/clickhouse.yaml +++ b/image_content/config/grafana/etc/grafana/provisioning/dashboards/clickhouse.yaml @@ -1,10 +1,25 @@ -# # config file version +# docs: https://grafana.com/docs/grafana/v9.1/administration/provisioning/#dashboards apiVersion: 1 providers: - - name: 'ClickHouse New' - orgId: 1 - folder: '' - type: file - options: - path: /var/lib/grafana/dashboards + # an unique provider name. Required + - name: 'ClickHouse New' + # Org id. Default to 1 + orgId: 1 + # name of the dashboard folder. + folder: '' + # folder UID. will be automatically generated if not specified + folderUid: '' + # provider type. Default to 'file' + type: file + # disable dashboard deletion + disableDeletion: true + # how often Grafana will scan for changed dashboards + updateIntervalSeconds: 10 + # allow updating provisioned dashboards from the UI + allowUiUpdates: true + options: + # path to dashboard files on disk. Required when using the 'file' type + path: /var/lib/grafana/dashboards + # use folder names from filesystem to create folders in Grafana + foldersFromFilesStructure: true diff --git a/image_content/config/grafana/etc/grafana/provisioning/dashboards/sample.yaml b/image_content/config/grafana/etc/grafana/provisioning/dashboards/sample.yaml index d70bd42..021b022 100644 --- a/image_content/config/grafana/etc/grafana/provisioning/dashboards/sample.yaml +++ b/image_content/config/grafana/etc/grafana/provisioning/dashboards/sample.yaml @@ -1,10 +1,25 @@ -# # config file version +# docs: https://grafana.com/docs/grafana/v9.1/administration/provisioning/#dashboards apiVersion: 1 -#providers: -# - name: 'default' -# orgId: 1 -# folder: '' -# type: file -# options: -# path: /var/lib/grafana/dashboards +# providers: +# # an unique provider name. Required +# - name: 'a unique provider name' +# # Org id. Default to 1 +# orgId: 1 +# # name of the dashboard folder. +# folder: '' +# # folder UID. will be automatically generated if not specified +# folderUid: '' +# # provider type. Default to 'file' +# type: file +# # disable dashboard deletion +# disableDeletion: false +# # how often Grafana will scan for changed dashboards +# updateIntervalSeconds: 10 +# # allow updating provisioned dashboards from the UI +# allowUiUpdates: false +# options: +# # path to dashboard files on disk. Required when using the 'file' type +# path: /var/lib/grafana/dashboards +# # use folder names from filesystem to create folders in Grafana +# foldersFromFilesStructure: true