From 8d6670bc920cd3c9be7ae536cb109c85a49c4b90 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 12 Nov 2025 11:28:00 +0100 Subject: [PATCH 1/6] adding victoria --- docker/docker-compose.yaml | 13 ++++++------- docker/volumes/victoria/.gitignore | 5 +++++ 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 docker/volumes/victoria/.gitignore diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 910997c..020b29a 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -12,17 +12,16 @@ services: volumes: - ./volumes/msd:/msd - prometheus: - image: quay.io/prometheus/prometheus:v2.51.1 + victoria: + image: victoriametrics/victoria-metrics:v1.129.1 network_mode: host volumes: - ./config/prometheus:/config - - ./volumes/prometheus/:/prometheus + - ./volumes/victoria/:/victoria command: - - --config.file - - /config/config.yaml - - --storage.tsdb.path=/prometheus - - --storage.tsdb.retention.time=6m + - --promscrape.config=/config/config.yaml + - --storageDataPath=/victoria + - --retentionPeriod=6 user: "${UID}:${GID}" deploy: resources: diff --git a/docker/volumes/victoria/.gitignore b/docker/volumes/victoria/.gitignore new file mode 100644 index 0000000..facdf81 --- /dev/null +++ b/docker/volumes/victoria/.gitignore @@ -0,0 +1,5 @@ +# Ignore everything in this directory +* + +# But keep this .gitignore +!.gitignore From 1bbd4d0ef50b830226d042f2f4bcc8373a5e4270 Mon Sep 17 00:00:00 2001 From: nikolamilosa Date: Wed, 12 Nov 2025 12:37:34 +0100 Subject: [PATCH 2/6] feat: replacing prometheus with victoria metrics --- docker/README.md | 13 +++++++------ .../provisioning/datasources/observability.yaml | 2 +- docker/config/prometheus/config-template.yaml | 1 - docker/docker-compose.yaml | 1 + docker/volumes/prometheus/.gitignore | 5 ----- 5 files changed, 9 insertions(+), 13 deletions(-) delete mode 100755 docker/volumes/prometheus/.gitignore diff --git a/docker/README.md b/docker/README.md index c99b8e7..ba766ea 100644 --- a/docker/README.md +++ b/docker/README.md @@ -111,8 +111,9 @@ Once started, you will see the following applications: * Grafana - http://localhost:3000 - default creds can be see in `./config/grafana/grafana.ini` * Service discovery - http://localhost:8000 -After 5-10 minutes you should see targets discovered in prometheus on the [targets page](http://localhost:9090/targets?search=). Initially, they might apear in red and if you keep monitoring they should -slowly start getting blue, which means that the targets are successfuly scraped. +After 5-10 minutes you should see targets discovered in victoria on the [targets page](http://localhost:8428/targets). +Initially, they might apear in red and if you keep monitoring they should +slowly start getting green, which means that the targets are successfuly scraped. You should also see some data incoming in the grafana [sample dashboard for the node exporter](http://localhost:3000/d/1/node-exporter?orgId=1&from=now-3h&to=now&timezone=utc&var-datasource=prometheus&var-instance=$__all&var-diskdevice=%5Ba-z%5D%2B%7Cnvme%5B0-9%5D%2Bn%5B0-9%5D%2B%7Cmmcblk%5B0-9%5D%2B). @@ -138,12 +139,12 @@ the other ones that contain `severity: warning` with `severity: critical`. To access the stack remotely you can do the following: ```bash -ssh -L 3000:localhost:3000 -L 9090:localhost:9090 -L 8000:localhost:8000 +ssh -L 3000:localhost:3000 -L 8428:localhost:8428 -L 8000:localhost:8000 ``` Example command with all parameters: ```bash -ssh -L 3000:localhost:3000 -L 9090:localhost:9090 -i ~/.ssh/priv_key.pem myuser@192.168.15.15 +ssh -L 3000:localhost:3000 -L 8428:localhost:8428 -i ~/.ssh/priv_key.pem myuser@192.168.15.15 ``` ## Extending @@ -202,11 +203,11 @@ curl http://localhost:8000/prom/targets?node_provider_id=&dc_i *NOTE*: The initial sync of service discovery may take up to 15 minutes! Syncing will be clearly logged in the multiservice discovery. -### Prometheus +### Victoria #### No targets visible in targets view -If you don't see anything in the [prometheus targets view](http://localhost:9090/targets?search=), +If you don't see anything in the [prometheus targets view](http://localhost:8428/targets?search=), that means that prometheus failed to receive targets from the service discovery. To check the logs run: diff --git a/docker/config/grafana/provisioning/datasources/observability.yaml b/docker/config/grafana/provisioning/datasources/observability.yaml index 825b528..433f637 100644 --- a/docker/config/grafana/provisioning/datasources/observability.yaml +++ b/docker/config/grafana/provisioning/datasources/observability.yaml @@ -5,6 +5,6 @@ datasources: uid: prometheus type: prometheus access: proxy - url: http://$PROM_HOST:9090 + url: http://$PROM_HOST:8428 jsonData: httpMethod: POST diff --git a/docker/config/prometheus/config-template.yaml b/docker/config/prometheus/config-template.yaml index 25da4d1..9651235 100644 --- a/docker/config/prometheus/config-template.yaml +++ b/docker/config/prometheus/config-template.yaml @@ -28,7 +28,6 @@ anchors: http_configs: &http_configs http_sd_configs: - url: http://multiservice-discovery:8000/prom/targets - refresh_interval: 15s global: # Change this to control how frequently prometheus diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 020b29a..bf2179a 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -22,6 +22,7 @@ services: - --promscrape.config=/config/config.yaml - --storageDataPath=/victoria - --retentionPeriod=6 + - --enableTCP6 user: "${UID}:${GID}" deploy: resources: diff --git a/docker/volumes/prometheus/.gitignore b/docker/volumes/prometheus/.gitignore deleted file mode 100755 index facdf81..0000000 --- a/docker/volumes/prometheus/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore everything in this directory -* - -# But keep this .gitignore -!.gitignore From 12de0809091c217e91c57d42cc61c1caaddeec65 Mon Sep 17 00:00:00 2001 From: Pietro Date: Wed, 12 Nov 2025 13:58:19 +0100 Subject: [PATCH 3/6] Update victoria version --- docker/docker-compose.yaml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index bf2179a..37e8f29 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -12,17 +12,19 @@ services: volumes: - ./volumes/msd:/msd - victoria: - image: victoriametrics/victoria-metrics:v1.129.1 + victoriametrics: + image: victoriametrics/victoria-metrics:v1.97.1 network_mode: host volumes: - ./config/prometheus:/config - ./volumes/victoria/:/victoria command: + - --storageDataPath=/victoria-metrics-data + - --httpListenAddr=:9090 + - --retentionPeriod=1y - --promscrape.config=/config/config.yaml - - --storageDataPath=/victoria - - --retentionPeriod=6 - - --enableTCP6 + - --promscrape.configCheckInterval=30s + - --enableTCP6=true user: "${UID}:${GID}" deploy: resources: @@ -40,3 +42,5 @@ services: - ./config/grafana:/etc/grafana - ./volumes/grafana:/var/lib/grafana user: "${UID}:${GID}" + depends_on: + - victoriametrics From eb4cf67a85853f5fc92e276ebbcb16d3656f708c Mon Sep 17 00:00:00 2001 From: Pietro Date: Wed, 12 Nov 2025 14:01:25 +0100 Subject: [PATCH 4/6] Fix docs --- docker/README.md | 4 ++-- .../grafana/provisioning/datasources/observability.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/README.md b/docker/README.md index ba766ea..b61a89b 100644 --- a/docker/README.md +++ b/docker/README.md @@ -139,12 +139,12 @@ the other ones that contain `severity: warning` with `severity: critical`. To access the stack remotely you can do the following: ```bash -ssh -L 3000:localhost:3000 -L 8428:localhost:8428 -L 8000:localhost:8000 +ssh -L 3000:localhost:3000 -L 9090:localhost:9090 -L 8000:localhost:8000 ``` Example command with all parameters: ```bash -ssh -L 3000:localhost:3000 -L 8428:localhost:8428 -i ~/.ssh/priv_key.pem myuser@192.168.15.15 +ssh -L 3000:localhost:3000 -L 9090:localhost:9090 -i ~/.ssh/priv_key.pem myuser@192.168.15.15 ``` ## Extending diff --git a/docker/config/grafana/provisioning/datasources/observability.yaml b/docker/config/grafana/provisioning/datasources/observability.yaml index 433f637..825b528 100644 --- a/docker/config/grafana/provisioning/datasources/observability.yaml +++ b/docker/config/grafana/provisioning/datasources/observability.yaml @@ -5,6 +5,6 @@ datasources: uid: prometheus type: prometheus access: proxy - url: http://$PROM_HOST:8428 + url: http://$PROM_HOST:9090 jsonData: httpMethod: POST From 5b1d7fdd4c4b301b8af7d6acac9f8a253abb2f58 Mon Sep 17 00:00:00 2001 From: Pietro Date: Wed, 12 Nov 2025 14:02:12 +0100 Subject: [PATCH 5/6] Fix readme --- docker/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/README.md b/docker/README.md index b61a89b..eb4754a 100644 --- a/docker/README.md +++ b/docker/README.md @@ -111,7 +111,7 @@ Once started, you will see the following applications: * Grafana - http://localhost:3000 - default creds can be see in `./config/grafana/grafana.ini` * Service discovery - http://localhost:8000 -After 5-10 minutes you should see targets discovered in victoria on the [targets page](http://localhost:8428/targets). +After 5-10 minutes you should see targets discovered in victoria on the [targets page](http://localhost:9090/targets). Initially, they might apear in red and if you keep monitoring they should slowly start getting green, which means that the targets are successfuly scraped. @@ -207,7 +207,7 @@ will be clearly logged in the multiservice discovery. #### No targets visible in targets view -If you don't see anything in the [prometheus targets view](http://localhost:8428/targets?search=), +If you don't see anything in the [prometheus targets view](http://localhost:9090/targets?search=), that means that prometheus failed to receive targets from the service discovery. To check the logs run: From 5ba6f0a675b05baa5d579459acc823efc5afe5fe Mon Sep 17 00:00:00 2001 From: Pietro Date: Wed, 12 Nov 2025 14:03:31 +0100 Subject: [PATCH 6/6] fix datapath --- docker/docker-compose.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 37e8f29..3713a75 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -19,7 +19,7 @@ services: - ./config/prometheus:/config - ./volumes/victoria/:/victoria command: - - --storageDataPath=/victoria-metrics-data + - --storageDataPath=/victoria - --httpListenAddr=:9090 - --retentionPeriod=1y - --promscrape.config=/config/config.yaml