mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
deployment/docker: replace Prometheus with vmagent (#635)
* replace Prometheus with vmagent in docker compose env; * cluster dashboard: exclude vmagent from job list; * cluster dasbhoard: reference datasource var instead of datasource name.
This commit is contained in:
parent
87946dcc53
commit
21cf6a1ec4
4 changed files with 32 additions and 52 deletions
|
@ -1,20 +1,11 @@
|
||||||
{
|
{
|
||||||
"__inputs": [
|
"__inputs": [],
|
||||||
{
|
|
||||||
"name": "DS_PROMETHEUS",
|
|
||||||
"label": "Prometheus",
|
|
||||||
"description": "",
|
|
||||||
"type": "datasource",
|
|
||||||
"pluginId": "prometheus",
|
|
||||||
"pluginName": "Prometheus"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"__requires": [
|
"__requires": [
|
||||||
{
|
{
|
||||||
"type": "grafana",
|
"type": "grafana",
|
||||||
"id": "grafana",
|
"id": "grafana",
|
||||||
"name": "Grafana",
|
"name": "Grafana",
|
||||||
"version": "7.0.2"
|
"version": "7.0.3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "panel",
|
"type": "panel",
|
||||||
|
@ -59,7 +50,7 @@
|
||||||
"gnetId": null,
|
"gnetId": null,
|
||||||
"graphTooltip": 0,
|
"graphTooltip": 0,
|
||||||
"id": null,
|
"id": null,
|
||||||
"iteration": 1591987127262,
|
"iteration": 1594940971206,
|
||||||
"links": [
|
"links": [
|
||||||
{
|
{
|
||||||
"icon": "doc",
|
"icon": "doc",
|
||||||
|
@ -89,7 +80,7 @@
|
||||||
"panels": [
|
"panels": [
|
||||||
{
|
{
|
||||||
"collapsed": false,
|
"collapsed": false,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "$ds",
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 1,
|
"h": 1,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
|
@ -1480,7 +1471,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsed": true,
|
"collapsed": true,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "$ds",
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 1,
|
"h": 1,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
|
@ -1946,7 +1937,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsed": true,
|
"collapsed": true,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "$ds",
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 1,
|
"h": 1,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
|
@ -2227,7 +2218,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsed": true,
|
"collapsed": true,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "$ds",
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 1,
|
"h": 1,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
|
@ -2914,7 +2905,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsed": true,
|
"collapsed": true,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "$ds",
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 1,
|
"h": 1,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
|
@ -3129,7 +3120,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsed": true,
|
"collapsed": true,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "$ds",
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 1,
|
"h": 1,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
|
@ -4052,7 +4043,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsed": true,
|
"collapsed": true,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "$ds",
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 1,
|
"h": 1,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
|
@ -4379,7 +4370,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"collapsed": true,
|
"collapsed": true,
|
||||||
"datasource": "${DS_PROMETHEUS}",
|
"datasource": "$ds",
|
||||||
"gridPos": {
|
"gridPos": {
|
||||||
"h": 1,
|
"h": 1,
|
||||||
"w": 24,
|
"w": 24,
|
||||||
|
@ -4894,14 +4885,14 @@
|
||||||
"allValue": null,
|
"allValue": null,
|
||||||
"current": {},
|
"current": {},
|
||||||
"datasource": "$ds",
|
"datasource": "$ds",
|
||||||
"definition": "label_values(vm_app_version{version=~\"^vm.*\"}, job)",
|
"definition": "label_values(vm_app_version{version=~\"^vm(insert|select|storage).*\"}, job)",
|
||||||
"hide": 0,
|
"hide": 0,
|
||||||
"includeAll": true,
|
"includeAll": true,
|
||||||
"label": null,
|
"label": null,
|
||||||
"multi": true,
|
"multi": true,
|
||||||
"name": "job",
|
"name": "job",
|
||||||
"options": [],
|
"options": [],
|
||||||
"query": "label_values(vm_app_version{version=~\"^vm.*\"}, job)",
|
"query": "label_values(vm_app_version{version=~\"^vm(insert|select|storage).*\"}, job)",
|
||||||
"refresh": 1,
|
"refresh": 1,
|
||||||
"regex": "",
|
"regex": "",
|
||||||
"skipUrlSync": false,
|
"skipUrlSync": false,
|
||||||
|
@ -4938,6 +4929,10 @@
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"text": "vmstorage"
|
"text": "vmstorage"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"selected": false,
|
||||||
|
"text": "vmagent"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"text": "vminsert"
|
"text": "vminsert"
|
||||||
|
|
|
@ -1,39 +1,33 @@
|
||||||
version: '3.5'
|
version: '3.5'
|
||||||
services:
|
services:
|
||||||
prometheus:
|
vmagent:
|
||||||
container_name: prometheus
|
container_name: vmagent
|
||||||
image: prom/prometheus:v2.19.1
|
image: victoriametrics/vmagent
|
||||||
depends_on:
|
depends_on:
|
||||||
- "vminsert"
|
- "vminsert"
|
||||||
- "vmselect"
|
|
||||||
ports:
|
ports:
|
||||||
- 9090:9090
|
- 8429:8429
|
||||||
volumes:
|
volumes:
|
||||||
- promdata:/prometheus
|
- vmagentdata:/vmagentdata
|
||||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
command:
|
command:
|
||||||
- '--config.file=/etc/prometheus/prometheus.yml'
|
- '--promscrape.config=/etc/prometheus/prometheus.yml'
|
||||||
- '--storage.tsdb.path=/prometheus'
|
- '--remoteWrite.url=http://vminsert:8480/insert/0/prometheus/'
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
grafana:
|
grafana:
|
||||||
container_name: grafana
|
container_name: grafana
|
||||||
image: grafana/grafana:7.0.3
|
image: grafana/grafana:7.0.3
|
||||||
entrypoint: >
|
|
||||||
/bin/sh -c "
|
|
||||||
cd /var/lib/grafana &&
|
|
||||||
mkdir -p dashboards &&
|
|
||||||
sed 's/$${DS_PROMETHEUS}/Prometheus/g' vm.json > dashboards/vm.json &&
|
|
||||||
/run.sh"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- "prometheus"
|
- "vmselect"
|
||||||
ports:
|
ports:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
restart: always
|
restart: always
|
||||||
volumes:
|
volumes:
|
||||||
- grafanadata:/var/lib/grafana
|
- grafanadata:/var/lib/grafana
|
||||||
- ./provisioning/:/etc/grafana/provisioning/
|
- ./provisioning/:/etc/grafana/provisioning/
|
||||||
- ./../../dashboards/victoriametrics.json:/var/lib/grafana/vm.json
|
- ./../../dashboards/victoriametrics.json:/var/lib/grafana/dashboards/vm.json
|
||||||
|
- ./../../dashboards/vmagent.json:/var/lib/grafana/dashboards/vmagent.json
|
||||||
|
|
||||||
vmstorage:
|
vmstorage:
|
||||||
container_name: vmstorage
|
container_name: vmstorage
|
||||||
|
@ -71,6 +65,6 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
promdata: {}
|
vmagentdata: {}
|
||||||
strgdata: {}
|
strgdata: {}
|
||||||
grafanadata: {}
|
grafanadata: {}
|
||||||
|
|
|
@ -2,13 +2,10 @@ global:
|
||||||
scrape_interval: 1s
|
scrape_interval: 1s
|
||||||
evaluation_interval: 1s
|
evaluation_interval: 1s
|
||||||
|
|
||||||
remote_write:
|
|
||||||
- url: "http://vminsert:8480/insert/0/prometheus/"
|
|
||||||
|
|
||||||
scrape_configs:
|
scrape_configs:
|
||||||
- job_name: 'prometheus'
|
- job_name: 'vmagent'
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['prometheus:9090']
|
- targets: ['vmagent:8429']
|
||||||
|
|
||||||
- job_name: 'vminsert'
|
- job_name: 'vminsert'
|
||||||
static_configs:
|
static_configs:
|
||||||
|
|
|
@ -1,14 +1,8 @@
|
||||||
apiVersion: 1
|
apiVersion: 1
|
||||||
|
|
||||||
datasources:
|
datasources:
|
||||||
- name: Prometheus
|
|
||||||
type: prometheus
|
|
||||||
access: proxy
|
|
||||||
url: http://prometheus:9090
|
|
||||||
isDefault: true
|
|
||||||
|
|
||||||
- name: VictoriaMetrics
|
- name: VictoriaMetrics
|
||||||
type: prometheus
|
type: prometheus
|
||||||
access: proxy
|
access: proxy
|
||||||
url: http://vmselect:8481/select/0/prometheus
|
url: http://vmselect:8481/select/0/prometheus
|
||||||
isDefault: false
|
isDefault: true
|
Loading…
Reference in a new issue