diff --git a/defaults/main.yml b/defaults/main.yml index 83e1229..7e2eaac 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -15,6 +15,10 @@ beacon_node_public_address: '{{ ansible_hostname }}' beacon_node_cont_vol: '/docker/{{ beacon_node_cont_name }}' +# metrics +beacon_node_metrics_enabled: true +beacon_node_metrics_port: 9200 + # general container management cont_recreate: false cont_restart: false diff --git a/tasks/consul.yml b/tasks/consul.yml index d9d2dc1..c36d0fe 100644 --- a/tasks/consul.yml +++ b/tasks/consul.yml @@ -13,3 +13,13 @@ - id: beacon-node-health type: tcp tcp: 'localhost:{{ beacon_node_public_tcp_port }}' + + - id: '{{ beacon_node_cont_name }}-metrics' + name: 'beacon-node-metrics' + port: '{{ beacon_node_metrics_port }}' + address: '{{ ansible_local.tinc.vpn_ip }}' + tags: ['{{ env }}.{{ stage }}', 'beacon', 'nimbus', 'metrics'] + checks: + - id: beacon-node-metrics + type: http + http: 'http://localhost:{{ beacon_node_metrics_port }}/metrics' diff --git a/tasks/container.yml b/tasks/container.yml index 0dac38d..ba158e8 100644 --- a/tasks/container.yml +++ b/tasks/container.yml @@ -19,12 +19,18 @@ labels: com.centurylinklabs.watchtower.enable: 'true' ports: - - '{{ beacon_node_public_tcp_port }}:{{ beacon_node_listening_port }}' + - '{{ beacon_node_metrics_port }}:{{ beacon_node_metrics_port }}/tcp' + - '{{ beacon_node_public_tcp_port }}:{{ beacon_node_listening_port }}/tcp' - '{{ beacon_node_public_udp_port }}:{{ beacon_node_discovery_port }}/udp' command: | - --logLevel={{ beacon_node_log_level }} - --network={{ beacon_node_network }} - --tcpPort={{ beacon_node_listening_port }} - --udpPort={{ beacon_node_discovery_port }} + --eth1-network + --log-level={{ beacon_node_log_level }} + --tcp-port={{ beacon_node_listening_port }} + --udp-port={{ beacon_node_discovery_port }} + {% if beacon_node_metrics_enabled %} + --metrics-server + --metrics-server-address=0.0.0.0 + --metrics-server-port={{ beacon_node_metrics_port }} + {% endif %} volumes: - '{{ beacon_node_cont_vol }}/data:/root/.cache/nimbus'