diff --git a/compose.static.yml b/compose.static.yml index 1f88299f..d0df5f78 100644 --- a/compose.static.yml +++ b/compose.static.yml @@ -148,3 +148,29 @@ services: - /usr/local/bin/etcd - --advertise-client-urls=http://etcd:2379 - --listen-client-urls=http://0.0.0.0:2379 + + prometheus: + container_name: prometheus + image: prom/prometheus:latest + volumes: + - ./testnet/monitoring/prometheus-config.yml:/etc/prometheus/prometheus.yml:z + command: + - --config.file=/etc/prometheus/prometheus.yml + - --storage.tsdb.retention.time=7d + ports: + - 127.0.0.1:9090:9090 + restart: on-failure + + grafana: + container_name: grafana + image: grafana/grafana:latest + env_file: + - ./testnet/monitoring/grafana/plugins.env + volumes: + - ./testnet/monitoring/grafana/grafana.ini:/etc/grafana/grafana.ini + ./testnet/monitoring/grafana/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml + ports: + - 9091:3000 + restart: on-failure + depends_on: + - prometheus diff --git a/nodes/nomos-node/config.yaml b/nodes/nomos-node/config.yaml index 808dcf98..f63aca7c 100644 --- a/nodes/nomos-node/config.yaml +++ b/nodes/nomos-node/config.yaml @@ -6,9 +6,9 @@ consensus: private_key: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] fountain_settings: null overlay_settings: - nodes: [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]] + nodes: ["0000000000000000000000000000000000000000000000000000000000000000", "0000000000000000000000000000000000000000000000000000000000000001"] number_of_committees: 1 - current_leader: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + current_leader: 0000000000000000000000000000000000000000000000000000000000000000 leader: cur: 0 committee_membership: !Sad diff --git a/testnet/Dockerfile b/testnet/Dockerfile index b81e172d..b18997ba 100644 --- a/testnet/Dockerfile +++ b/testnet/Dockerfile @@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -yq \ WORKDIR /nomos COPY . . -RUN cargo build --release --all +RUN cargo build --release --all --features metrics # NODE IMAGE ---------------------------------------------------------- diff --git a/testnet/explorer_config.yaml b/testnet/explorer_config.yaml new file mode 100644 index 00000000..a5b47758 --- /dev/null +++ b/testnet/explorer_config.yaml @@ -0,0 +1,10 @@ +log: + backend: "Stdout" + format: "Json" + level: "info" + +api: + backend_settings: + address: 0.0.0.0:9090 + cors_origins: [] + diff --git a/testnet/monitoring/grafana/datasources.yaml b/testnet/monitoring/grafana/datasources.yaml new file mode 100644 index 00000000..2d99f845 --- /dev/null +++ b/testnet/monitoring/grafana/datasources.yaml @@ -0,0 +1,11 @@ +apiVersion: 1 + +datasources: + - name: Prometheus + type: prometheus + access: proxy + org_id: 1 + url: http://prometheus:9090 + is_default: true + version: 1 + editable: true diff --git a/testnet/monitoring/grafana/grafana.ini b/testnet/monitoring/grafana/grafana.ini new file mode 100644 index 00000000..3c60e138 --- /dev/null +++ b/testnet/monitoring/grafana/grafana.ini @@ -0,0 +1,51 @@ +instance_name = nomos dashboard + +;[dashboards.json] +;enabled = true +;path = /home/git/grafana/grafana-dashboards/dashboards + + +#################################### Auth ########################## +[auth] +disable_login_form = false + +#################################### Anonymous Auth ########################## +[auth.anonymous] +# enable anonymous access +enabled = true + +# specify organization name that should be used for unauthenticated users +;org_name = Public + +# specify role for unauthenticated users +; org_role = Admin +org_role = Viewer + +;[security] +;admin_user = ocr +;admin_password = ocr + +;[users] +# disable user signup / registration +;allow_sign_up = false + +# Set to true to automatically assign new users to the default organization (id 1) +;auto_assign_org = true + +# Default role new users will be automatically assigned (if disabled above is set to true) +;auto_assign_org_role = Viewer + +#################################### SMTP / Emailing ########################## +;[smtp] +;enabled = false +;host = localhost:25 +;user = +;password = +;cert_file = +;key_file = +;skip_verify = false +;from_address = admin@grafana.localhost + +;[emails] +;welcome_email_on_sign_up = false + diff --git a/testnet/monitoring/grafana/plugins.env b/testnet/monitoring/grafana/plugins.env new file mode 100644 index 00000000..2a4b4876 --- /dev/null +++ b/testnet/monitoring/grafana/plugins.env @@ -0,0 +1 @@ +GF_INSTALL_PLUGINS=grafana-worldmap-panel,grafana-piechart-panel,yesoreyeram-boomtheme-panel,briangann-gauge-panel,pierosavi-imageit-panel,bessler-pictureit-panel,vonage-status-panel diff --git a/testnet/monitoring/prometheus-config.yml b/testnet/monitoring/prometheus-config.yml new file mode 100644 index 00000000..7be135f9 --- /dev/null +++ b/testnet/monitoring/prometheus-config.yml @@ -0,0 +1,14 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + external_labels: + monitor: "Monitoring" + +scrape_configs: + - job_name: "libp2p" + static_configs: + - targets: + - bootstrap:18080 + - libp2p_node_1:18080 + - libp2p_node_2:18080 + - libp2p_node_3:18080 diff --git a/testnet/scripts/run_bootstrap_node.sh b/testnet/scripts/run_bootstrap_node.sh index 180940ab..525f7f10 100755 --- a/testnet/scripts/run_bootstrap_node.sh +++ b/testnet/scripts/run_bootstrap_node.sh @@ -17,4 +17,4 @@ echo "CONSENSUS_PRIV_KEY: ${CONSENSUS_PRIV_KEY}" echo "DA_VOTER: ${DA_VOTER}" echo "OVERLAY_NODES: ${OVERLAY_NODES}" -exec /usr/bin/nomos-node /etc/nomos/bootstrap_config.yaml +exec /usr/bin/nomos-node /etc/nomos/bootstrap_config.yaml --with-metrics diff --git a/testnet/scripts/run_nomos_node.sh b/testnet/scripts/run_nomos_node.sh index 742a604f..ea462f95 100755 --- a/testnet/scripts/run_nomos_node.sh +++ b/testnet/scripts/run_nomos_node.sh @@ -33,4 +33,4 @@ echo "DA_VOTER: ${DA_VOTER}" echo "OVERLAY_NODES: ${OVERLAY_NODES}" echo "NET_INITIAL_PEERS: ${NET_INITIAL_PEERS}" -exec /usr/bin/nomos-node /etc/nomos/libp2p_config.yaml +exec /usr/bin/nomos-node /etc/nomos/libp2p_config.yaml --with-metrics diff --git a/tests/src/nodes/nomos.rs b/tests/src/nodes/nomos.rs index d6c0cb33..af656493 100644 --- a/tests/src/nodes/nomos.rs +++ b/tests/src/nodes/nomos.rs @@ -345,8 +345,6 @@ fn create_node_config( cors_origins: vec![], }, }, - #[cfg(feature = "metrics")] - metrics: Default::default(), da: nomos_da::Settings { da_protocol: full_replication::Settings { voter: id,