Skip to content

Commit

Permalink
feat(repo): Added metrics for publisher and dashboards
Browse files Browse the repository at this point in the history
  • Loading branch information
0xterminator committed Jan 22, 2025
1 parent fc5ead3 commit 1c7f41e
Show file tree
Hide file tree
Showing 21 changed files with 1,918 additions and 108 deletions.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,12 @@ bench:

run-publisher: NETWORK="testnet"
run-publisher: MODE="dev"
run-publisher: PORT="4000"
run-publisher: TELEMETRY_PORT="9001"
run-publisher: PORT="9001"
run-publisher: NATS_URL="localhost:4222"
run-publisher: EXTRA_ARGS=""
run-publisher: FROM_HEIGHT="0"
run-publisher: check-network
@./scripts/run_publisher.sh
@./scripts/run_publisher.sh --mode $(MODE) --network $(NETWORK) --port $(PORT) --from-height $(FROM_HEIGHT) --extra-args $(EXTRA_ARGS)

run-publisher-mainnet-dev:
$(MAKE) run-publisher NETWORK=mainnet MODE=dev FROM_HEIGHT=0
Expand Down Expand Up @@ -285,7 +284,7 @@ run-webserver-testnet-profiling:
# ------------------------------------------------------------

# Define service profiles
DOCKER_SERVICES := nats docker cockroach
DOCKER_SERVICES := nats docker cockroach monitoring

run-docker-compose: PROFILE="all"
run-docker-compose:
Expand Down
1 change: 1 addition & 0 deletions cluster/docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
105 changes: 105 additions & 0 deletions cluster/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ services:
restart: always
ports:
- 4222:4222
- 8222:8222
volumes:
- ./nats-config/core.conf:/etc/nats/nats.conf
- ./nats-config/accounts.conf:/etc/nats/accounts.conf
command:
- -m
- '8222'
- --name=fuel-streams-nats
- --js
- --config=/etc/nats/nats.conf
Expand All @@ -24,6 +27,7 @@ services:
- all
- cockroach
image: cockroachdb/cockroach:v23.2.2
container_name: cockroachdb
ports:
- "26257:26257"
- "8080:8080"
Expand All @@ -36,5 +40,106 @@ services:
timeout: 5s
retries: 5

prometheus:
profiles:
- all
- monitoring
image: prom/prometheus:latest
container_name: prometheus
restart: always
volumes:
- ./monitoring/prometheus/:/etc/prometheus/
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
ports:
- 9090:9090

node-exporter:
profiles:
- all
- monitoring
image: prom/node-exporter:latest
container_name: node-exporter
restart: always
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- '--path.procfs=/host/proc'
- '--path.sysfs=/host/sys'
- --collector.filesystem.ignored-mount-points
- "^/(sys|proc|dev|host|etc|rootfs/var/lib/docker/containers|rootfs/var/lib/docker/overlay2|rootfs/run/docker/netns|rootfs/var/lib/docker/aufs)($$|/)"
ports:
- 9100:9100
depends_on:
- prometheus
deploy:
mode: global

cadvisor:
profiles:
- all
- monitoring
image: gcr.io/cadvisor/cadvisor
container_name: cadvisor
restart: always
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- 9200:8080
depends_on:
- prometheus
deploy:
mode: global

alertmanager:
profiles:
- all
- monitoring
image: prom/alertmanager:latest
container_name: alertmanager
restart: always
volumes:
- ./monitoring/alertmanager/:/etc/alertmanager/
command:
- '--config.file=/etc/alertmanager/config.yml'
- '--storage.path=/alertmanager'
depends_on:
- prometheus
ports:
- 9093:9093

grafana:
profiles:
- all
- monitoring
image: grafana/grafana:latest
container_name: grafana
user: '472'
restart: always
environment:
GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource,grafana-worldmap-panel,grafana-piechart-panel"
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/provisioning/:/etc/grafana/provisioning/
env_file:
- ./monitoring/grafana/config.monitoring
ports:
- 3000:3000
depends_on:
- prometheus

volumes:
cockroach_data:
prometheus_data:
grafana_data:
11 changes: 11 additions & 0 deletions cluster/docker/monitoring/alertmanager/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
route:
receiver: 'slack'

receivers:
- name: 'slack'

# slack_configs:
# - send_resolved: true
# username: '<username>'
# channel: '#<channel-name>'
# api_url: '<incomming-webhook-url>'
9 changes: 9 additions & 0 deletions cluster/docker/monitoring/grafana/config.monitoring
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
GF_SECURITY_ADMIN_USER=admin
GF_SECURITY_ADMIN_PASSWORD=admin
GF_USERS_ALLOW_SIGN_UP=false
GF_SERVER_DOMAIN=myrul.com
GF_SMTP_ENABLED=true
GF_SMTP_HOST=smtp.gmail.com:587
[email protected]
GF_SMTP_PASSWORD=mypassword
[email protected]
Loading

0 comments on commit 1c7f41e

Please sign in to comment.