Skip to content

Commit

Permalink
fix(docker): grafana local config + private network (#4299)
Browse files Browse the repository at this point in the history
* fixed grafana local config + private network

* Make grafana-local compatible with iota-private-network

* Use external network

* Update prometheus.yaml

* Make grafana-local compatible with iota-private-network

* Add README.md

* Format files

---------

Co-authored-by: Hans Moog <[email protected]>
Co-authored-by: Piotr Macek <[email protected]>
  • Loading branch information
3 people authored Dec 2, 2024
1 parent 5494cff commit 32dca27
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 15 deletions.
7 changes: 7 additions & 0 deletions docker/grafana-local/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Prometheus and Grafana monitoring for `iota-private-network`

This docker-compose configuration allows launching instances of the Prometheus and Grafana applications for monitoring of locally deployed `iota-private-network`.

In order to run this monitoring setup, you first need to have `iota-private-network` setup running, because it creates the network that Prometheus and Grafana join.

To deploy the setup, simply run `docker compose up -d`.
14 changes: 14 additions & 0 deletions docker/grafana-local/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
volumes:
- ./tempo.yaml:/etc/tempo.yaml
- ${TMPDIR}/tempo-data:/tmp/tempo
networks:
iota-network:
ports:
- "14268:14268" # jaeger ingest
- "3200:3200" # tempo
Expand All @@ -20,13 +22,19 @@ services:
- --config.file=/etc/prometheus.yaml
- --web.enable-remote-write-receiver
- --enable-feature=exemplar-storage
networks:
iota-network:
volumes:
- ./prometheus.yaml:/etc/prometheus.yaml
ports:
- "9090:9090"
extra_hosts:
- "host.docker.internal:host-gateway"

grafana:
image: grafana/grafana:10.1.1
networks:
iota-network:
volumes:
- ./grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
- ./dashboards:/etc/grafana/provisioning/dashboards
Expand All @@ -42,6 +50,8 @@ services:
image: prom/node-exporter:latest
container_name: node-exporter
restart: unless-stopped
networks:
iota-network:
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
Expand All @@ -53,3 +63,7 @@ services:
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
ports:
- "9100:9100"
networks:
iota-network:
external:
name: iota-private-network_iota-network
36 changes: 21 additions & 15 deletions docker/grafana-local/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,53 +5,59 @@ global:
scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090", "host.docker.internal:9184"]
- targets: ["localhost:9090"]
- job_name: "Validator_0"
static_configs:
- targets: ["host.docker.internal:2002"]
- targets: ["validator-1:9184"]
labels:
host: validator0
network: local
- job_name: "Validator_1"
static_configs:
- targets: ["host.docker.internal:2012"]
- targets: ["validator-2:9184"]
labels:
host: validator1
network: local
- job_name: "Validator_2"
static_configs:
- targets: ["host.docker.internal:2022"]
- targets: ["validator-3:9184"]
labels:
host: validator2
network: local
- job_name: "Validator_3"
static_configs:
- targets: ["host.docker.internal:2032"]
- targets: ["validator-4:9184"]
labels:
host: validator3
network: local
- job_name: "Client_1"
- job_name: "Fullnode_0"
static_configs:
- targets: ["host.docker.internal:8081"]
- targets: ["fullnode-1:9184"]
labels:
host: client1
host: fullnode0
network: local
- job_name: "Client_2"
- job_name: "Fullnode_1"
static_configs:
- targets: ["host.docker.internal:8082"]
- targets: ["fullnode-2:9184"]
labels:
host: client2
host: fullnode1
network: local
- job_name: "Client_3"
- job_name: "Fullnode_2"
static_configs:
- targets: ["host.docker.internal:8083"]
- targets: ["fullnode-3:9184"]
labels:
host: client3
host: fullnode2
network: local
- job_name: "Fullnode_3"
static_configs:
- targets: ["fullnode-4:9184"]
labels:
host: fullnode3
network: local
- job_name: "tempo"
static_configs:
- targets: ["tempo:3200"]
- job_name: "node"
- job_name: "node-exporter"
static_configs:
- targets: ["host.docker.internal:9100"]
labels:
Expand Down

0 comments on commit 32dca27

Please sign in to comment.