mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
devenv: updated devenv provision scripts
This commit is contained in:
parent
645974ec8d
commit
b464a28cca
1
.gitignore
vendored
1
.gitignore
vendored
@ -43,6 +43,7 @@ fig.yml
|
|||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
docker-compose.yaml
|
docker-compose.yaml
|
||||||
/conf/provisioning/**/custom.yaml
|
/conf/provisioning/**/custom.yaml
|
||||||
|
/conf/provisioning/**/dev.yaml
|
||||||
/conf/ldap_dev.toml
|
/conf/ldap_dev.toml
|
||||||
profile.cov
|
profile.cov
|
||||||
/grafana
|
/grafana
|
||||||
|
9
devenv/dashboards.yaml
Normal file
9
devenv/dashboards.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: 1
|
||||||
|
|
||||||
|
providers:
|
||||||
|
- name: 'gdev dashboards'
|
||||||
|
folder: 'gdev dashboards'
|
||||||
|
type: file
|
||||||
|
options:
|
||||||
|
path: devenv/dev-dashboards
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
apiVersion: 1
|
|
||||||
|
|
||||||
providers:
|
|
||||||
- name: 'dev dashboards'
|
|
||||||
folder: 'dev dashboards'
|
|
||||||
type: file
|
|
||||||
options:
|
|
||||||
path: devenv/dashboards/dev-dashboards
|
|
||||||
|
|
@ -1,38 +1,38 @@
|
|||||||
apiVersion: 1
|
apiVersion: 1
|
||||||
|
|
||||||
datasources:
|
datasources:
|
||||||
- name: Graphite
|
- name: gdev-graphite
|
||||||
type: graphite
|
type: graphite
|
||||||
access: proxy
|
access: proxy
|
||||||
url: http://localhost:8080
|
url: http://localhost:8080
|
||||||
jsonData:
|
jsonData:
|
||||||
graphiteVersion: "1.1"
|
graphiteVersion: "1.1"
|
||||||
|
|
||||||
- name: Prometheus
|
- name: gdev-prometheus
|
||||||
type: prometheus
|
type: prometheus
|
||||||
access: proxy
|
access: proxy
|
||||||
isDefault: true
|
isDefault: true
|
||||||
url: http://localhost:9090
|
url: http://localhost:9090
|
||||||
|
|
||||||
- name: InfluxDB
|
- name: gdev-influxdb
|
||||||
type: influxdb
|
type: influxdb
|
||||||
access: proxy
|
access: proxy
|
||||||
database: site
|
database: site
|
||||||
user: grafana
|
user: grafana
|
||||||
password: grafana
|
password: grafana
|
||||||
url: http://localhost:8086
|
url: http://localhost:8086
|
||||||
jsonData:
|
jsonData:
|
||||||
timeInterval: "15s"
|
timeInterval: "15s"
|
||||||
|
|
||||||
- name: OpenTsdb
|
- name: gdev-opentsdb
|
||||||
type: opentsdb
|
type: opentsdb
|
||||||
access: proxy
|
access: proxy
|
||||||
url: http://localhost:4242
|
url: http://localhost:4242
|
||||||
jsonData:
|
jsonData:
|
||||||
tsdbResolution: 1
|
tsdbResolution: 1
|
||||||
tsdbVersion: 1
|
tsdbVersion: 1
|
||||||
|
|
||||||
- name: Elastic
|
- name: gdev-elasticsearch-metrics
|
||||||
type: elasticsearch
|
type: elasticsearch
|
||||||
access: proxy
|
access: proxy
|
||||||
database: "[metrics-]YYYY.MM.DD"
|
database: "[metrics-]YYYY.MM.DD"
|
||||||
@ -40,22 +40,22 @@ datasources:
|
|||||||
jsonData:
|
jsonData:
|
||||||
interval: Daily
|
interval: Daily
|
||||||
timeField: "@timestamp"
|
timeField: "@timestamp"
|
||||||
|
|
||||||
- name: MySQL
|
- name: gdev-mysql
|
||||||
type: mysql
|
type: mysql
|
||||||
url: localhost:3306
|
url: localhost:3306
|
||||||
database: grafana
|
database: grafana
|
||||||
user: grafana
|
user: grafana
|
||||||
password: password
|
password: password
|
||||||
|
|
||||||
- name: MSSQL
|
- name: gdev-mssql
|
||||||
type: mssql
|
type: mssql
|
||||||
url: localhost:1433
|
url: localhost:1433
|
||||||
database: grafana
|
database: grafana
|
||||||
user: grafana
|
user: grafana
|
||||||
password: "Password!"
|
password: "Password!"
|
||||||
|
|
||||||
- name: Postgres
|
- name: gdev-postgres
|
||||||
type: postgres
|
type: postgres
|
||||||
url: localhost:5432
|
url: localhost:5432
|
||||||
database: grafana
|
database: grafana
|
||||||
@ -64,7 +64,7 @@ datasources:
|
|||||||
jsonData:
|
jsonData:
|
||||||
sslmode: "disable"
|
sslmode: "disable"
|
||||||
|
|
||||||
- name: Cloudwatch
|
- name: gdev-cloudwatch
|
||||||
type: cloudwatch
|
type: cloudwatch
|
||||||
editable: true
|
editable: true
|
||||||
jsonData:
|
jsonData:
|
@ -23,41 +23,36 @@ requiresJsonnet() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defaultDashboards() {
|
defaultDashboards() {
|
||||||
requiresJsonnet
|
ln -s -f ../../../devenv/dashboards.yaml ../conf/provisioning/dashboards/dev.yaml
|
||||||
|
|
||||||
ln -s -f -r ./dashboards/dev-dashboards/dev-dashboards.yaml ../conf/provisioning/dashboards/custom.yaml
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultDatasources() {
|
defaultDatasources() {
|
||||||
echo "setting up all default datasources using provisioning"
|
echo "setting up all default datasources using provisioning"
|
||||||
|
|
||||||
ln -s -f -r ./datasources/default/default.yaml ../conf/provisioning/datasources/custom.yaml
|
ln -s -f ../../../devenv/datasources.yaml ../conf/provisioning/datasources/dev.yaml
|
||||||
}
|
}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo -e "install.sh\n\tThis script installs my basic setup for a debian laptop\n"
|
echo -e "install.sh\n\tThis script setups dev provision for datasources and dashboards"
|
||||||
echo "Usage:"
|
echo "Usage:"
|
||||||
echo " bulk-dashboards - create and provisioning 400 dashboards"
|
echo " bulk-dashboards - create and provisioning 400 dashboards"
|
||||||
echo " default-datasources - provisiong all core datasources"
|
echo " no args - provisiong core datasources and dev dashboards"
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local cmd=$1
|
local cmd=$1
|
||||||
|
|
||||||
if [[ -z "$cmd" ]]; then
|
|
||||||
usage
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $cmd == "bulk-dashboards" ]]; then
|
if [[ $cmd == "bulk-dashboards" ]]; then
|
||||||
bulkDashboard
|
bulkDashboard
|
||||||
elif [[ $cmd == "default-datasources" ]]; then
|
|
||||||
defaultDatasources
|
|
||||||
elif [[ $cmd == "default-dashboards" ]]; then
|
|
||||||
defaultDashboards
|
|
||||||
else
|
else
|
||||||
|
defaultDashboards
|
||||||
|
defaultDatasources
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$cmd" ]]; then
|
||||||
usage
|
usage
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user