Deploy `Grafana` provision data for Datasources.

This commit is contained in:
Kazuhiro MUSASHI 2020-11-13 00:31:15 +09:00
parent 6369b92026
commit 506a63697c
3 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,25 @@
# # config file version
apiVersion: 1
# # list of datasources that should be deleted from the database
deleteDatasources:
- name: Loki
orgId: 1
# # list of datasources to insert/update depending
# # on what's available in the database
datasources:
# <string, required> name of the datasource. Required
- name: Loki
# <string, required> datasource type. Required
type: loki
# <string, required> access mode. direct or proxy. Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> url
url: http://localhost:3100
version: 1
# <bool> allow users to edit datasources from the UI.
editable: false

View File

@ -0,0 +1,25 @@
# # config file version
apiVersion: 1
# # list of datasources that should be deleted from the database
deleteDatasources:
- name: Prometheus
orgId: 1
# # list of datasources to insert/update depending
# # on what's available in the database
datasources:
# <string, required> name of the datasource. Required
- name: Prometheus
# <string, required> datasource type. Required
type: prometheus
# <string, required> access mode. direct or proxy. Required
access: proxy
# <int> org id. will default to orgId 1 if not specified
orgId: 1
# <string> url
url: http://localhost:9090
version: 1
# <bool> allow users to edit datasources from the UI.
editable: false

View File

@ -7,6 +7,14 @@
end end
end end
%w(loki.yaml prometheus.yaml).each do |conf|
remote_file "/etc/grafana/provisioning/datasources/#{conf}" do
owner 'root'
group 'grafana'
mode '640'
end
end
# Start/Enable `grafana`: # Start/Enable `grafana`:
service 'grafana-server' do service 'grafana-server' do
action [ :enable, :start ] action [ :enable, :start ]