diff --git a/deployment/docker/docker-compose-cluster.yml b/deployment/docker/docker-compose-cluster.yml index 06e76d88d..a00bbc0ff 100644 --- a/deployment/docker/docker-compose-cluster.yml +++ b/deployment/docker/docker-compose-cluster.yml @@ -28,7 +28,7 @@ services: restart: always volumes: - grafanadata:/var/lib/grafana - - ./provisioning/datasources/prometheus-datasource:/etc/grafana/provisioning/datasources + - ./provisioning/datasources/prometheus-datasource/cluster.yml:/etc/grafana/provisioning/datasources/cluster.yml - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards - ./../../dashboards/victoriametrics-cluster.json:/var/lib/grafana/dashboards/vm.json - ./../../dashboards/vmagent.json:/var/lib/grafana/dashboards/vmagent.json diff --git a/deployment/docker/docker-compose.yml b/deployment/docker/docker-compose.yml index 896d64537..b6fbdb3d9 100644 --- a/deployment/docker/docker-compose.yml +++ b/deployment/docker/docker-compose.yml @@ -53,7 +53,7 @@ services: - 3000:3000 volumes: - grafanadata:/var/lib/grafana - - ./provisioning/datasources/prometheus-datasource:/etc/grafana/provisioning/datasources + - ./provisioning/datasources/prometheus-datasource/single.yml:/etc/grafana/provisioning/datasources/single.yml - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards - ./../../dashboards/victoriametrics.json:/var/lib/grafana/dashboards/vm.json - ./../../dashboards/vmagent.json:/var/lib/grafana/dashboards/vmagent.json diff --git a/deployment/docker/provisioning/datasources/prometheus-datasource/prometheus-datasource.yml b/deployment/docker/provisioning/datasources/prometheus-datasource/cluster.yml similarity index 54% rename from deployment/docker/provisioning/datasources/prometheus-datasource/prometheus-datasource.yml rename to deployment/docker/provisioning/datasources/prometheus-datasource/cluster.yml index 9b768a337..f8bb30ab4 100644 --- a/deployment/docker/provisioning/datasources/prometheus-datasource/prometheus-datasource.yml +++ b/deployment/docker/provisioning/datasources/prometheus-datasource/cluster.yml @@ -1,20 +1,11 @@ apiVersion: 1 datasources: - - name: VictoriaMetrics - type: prometheus - access: proxy - url: http://victoriametrics:8428 - isDefault: true - jsonData: - prometheusType: Prometheus - prometheusVersion: 2.24.0 - - name: VictoriaMetrics - cluster type: prometheus access: proxy url: http://vmauth:8427/select/0/prometheus - isDefault: false + isDefault: true jsonData: prometheusType: Prometheus prometheusVersion: 2.24.0 diff --git a/deployment/docker/provisioning/datasources/prometheus-datasource/single.yml b/deployment/docker/provisioning/datasources/prometheus-datasource/single.yml new file mode 100644 index 000000000..ab80245bf --- /dev/null +++ b/deployment/docker/provisioning/datasources/prometheus-datasource/single.yml @@ -0,0 +1,11 @@ +apiVersion: 1 + +datasources: + - name: VictoriaMetrics + type: prometheus + access: proxy + url: http://victoriametrics:8428 + isDefault: true + jsonData: + prometheusType: Prometheus + prometheusVersion: 2.24.0 \ No newline at end of file diff --git a/deployment/docker/provisioning/datasources/victoriametrics-datasource/cluster.yml b/deployment/docker/provisioning/datasources/victoriametrics-datasource/cluster.yml new file mode 100644 index 000000000..7eefe6d47 --- /dev/null +++ b/deployment/docker/provisioning/datasources/victoriametrics-datasource/cluster.yml @@ -0,0 +1,13 @@ +apiVersion: 1 + +datasources: + - name: VictoriaMetrics - cluster + type: victoriametrics-datasource + access: proxy + url: http://vmauth:8427/select/0/prometheus + isDefault: true + # see https://grafana.com/docs/grafana/latest/administration/provisioning/#json-data + jsonData: + # vmuiUrl will auto resolve into http://vmauth:8427 and won't work at user's machine + # so we override it + vmuiUrl: http://localhost:8427/select/0/vmui diff --git a/deployment/docker/provisioning/datasources/victoriametrics-datasource/single.yml b/deployment/docker/provisioning/datasources/victoriametrics-datasource/single.yml new file mode 100644 index 000000000..c04a48dd6 --- /dev/null +++ b/deployment/docker/provisioning/datasources/victoriametrics-datasource/single.yml @@ -0,0 +1,13 @@ +apiVersion: 1 + +datasources: + - name: VictoriaMetrics + type: victoriametrics-datasource + access: proxy + url: http://victoriametrics:8428 + isDefault: true + # see https://grafana.com/docs/grafana/latest/administration/provisioning/#json-data + jsonData: + # vmuiUrl will auto resolve into http://victoriametrics:8428 and won't work at user's machine + # so we override it + vmuiUrl: http://localhost:8428/vmui \ No newline at end of file diff --git a/deployment/docker/provisioning/datasources/victoriametrics-datasource/victoriametrics-datasource.yml b/deployment/docker/provisioning/datasources/victoriametrics-datasource/victoriametrics-datasource.yml deleted file mode 100644 index 64468980f..000000000 --- a/deployment/docker/provisioning/datasources/victoriametrics-datasource/victoriametrics-datasource.yml +++ /dev/null @@ -1,46 +0,0 @@ -apiVersion: 1 - -# List of data sources to insert/update depending on what's -# available in the database. -datasources: - # Name of the VictoriaMetrics datasource - # displayed in Grafana panels and queries. - - name: VictoriaMetrics - # Sets the data source type. - type: victoriametrics-datasource - # Sets the access mode, either - # proxy or direct (Server or Browser in the UI). - # Some data sources are incompatible with any setting - # but proxy (Server). - access: proxy - # Sets default URL of the single node version of VictoriaMetrics - url: http://victoriametrics:8428 - # Sets the pre-selected datasource for new panels. - # You can set only one default data source per organization. - isDefault: true - # see https://grafana.com/docs/grafana/latest/administration/provisioning/#json-data - jsonData: - # vmuiUrl will auto resolve into http://victoriametrics:8428 and won't work at user's machine - # so we override it - vmuiUrl: http://localhost:8428/vmui - - # Name of the VictoriaMetrics datasource - # displayed in Grafana panels and queries. - - name: VictoriaMetrics - cluster - # Sets the data source type. - type: victoriametrics-datasource - # Sets the access mode, either - # proxy or direct (Server or Browser in the UI). - # Some data sources are incompatible with any setting - # but proxy (Server). - access: proxy - # Sets default URL of the cluster version of VictoriaMetrics - url: http://vmauth:8427/select/0/prometheus - # Sets the pre-selected datasource for new panels. - # You can set only one default data source per organization. - isDefault: false - # see https://grafana.com/docs/grafana/latest/administration/provisioning/#json-data - jsonData: - # vmuiUrl will auto resolve into http://vmauth:8427 and won't work at user's machine - # so we override it - vmuiUrl: http://localhost:8427/select/0/vmui diff --git a/deployment/docker/vm-datasource/docker-compose-cluster.yml b/deployment/docker/vm-datasource/docker-compose-cluster.yml index c1b76ea4d..a09901a46 100644 --- a/deployment/docker/vm-datasource/docker-compose-cluster.yml +++ b/deployment/docker/vm-datasource/docker-compose-cluster.yml @@ -8,7 +8,7 @@ services: - 3000:3000 volumes: - grafanadata:/var/lib/grafana - - ./provisioning/datasources/victoriametrics-datasource:/etc/grafana/provisioning/datasources + - ./provisioning/datasources/victoriametrics-datasource/cluster.yml:/etc/grafana/provisioning/datasources/cluster.yml - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards - ./provisioning/plugins/:/var/lib/grafana/plugins - ./../../dashboards/vm/victoriametrics-cluster.json:/var/lib/grafana/dashboards/vm.json diff --git a/deployment/docker/vm-datasource/docker-compose.yml b/deployment/docker/vm-datasource/docker-compose.yml index 30b95d642..cb7f35054 100644 --- a/deployment/docker/vm-datasource/docker-compose.yml +++ b/deployment/docker/vm-datasource/docker-compose.yml @@ -8,7 +8,7 @@ services: - 3000:3000 volumes: - grafanadata:/var/lib/grafana - - ./provisioning/datasources/victoriametrics-datasource:/etc/grafana/provisioning/datasources + - ./provisioning/datasources/victoriametrics-datasource/single.yml:/etc/grafana/provisioning/datasources/single.yml - ./provisioning/dashboards:/etc/grafana/provisioning/dashboards - ./provisioning/plugins/:/var/lib/grafana/plugins - ./../../dashboards/vm/victoriametrics.json:/var/lib/grafana/dashboards/vm.json