From 38340be5e2cf99938f88d05a07d04bea4c70b8b6 Mon Sep 17 00:00:00 2001 From: AndrewPaglusch Date: Fri, 8 Dec 2023 22:50:16 -0600 Subject: [PATCH] add prometheus metrics --- defaults/main.yml | 6 ++++++ templates/lighthouse_config.yml.j2 | 9 +++++++++ templates/node_config.yml.j2 | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 92f36e9..492bb8d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -17,6 +17,12 @@ nebula_lighthouse_public_port: 4242 nebula_lighthouse_is_relay: true nebula_lighthouse_extra_config: {} +nebula_metrics_prometheus_enabled: false +nebula_metrics_prometheus_listen: "127.0.0.1:4244" +nebula_metrics_prometheus_path: "/metrics" +nebula_metrics_prometheus_namespace: nebula +nebula_metrics_prometheus_interval: 10s + nebula_firewall_block_action: drop nebula_inbound_rules: diff --git a/templates/lighthouse_config.yml.j2 b/templates/lighthouse_config.yml.j2 index 8806bde..5b04f9c 100644 --- a/templates/lighthouse_config.yml.j2 +++ b/templates/lighthouse_config.yml.j2 @@ -68,6 +68,15 @@ logging: level: info format: text +{% if nebula_metrics_prometheus_enabled %} +stats: + type: prometheus + listen: {{ nebula_metrics_prometheus_listen }} + path: {{ nebula_metrics_prometheus_path }} + namespace: {{ nebula_metrics_prometheus_namespace }} + interval: {{ nebula_metrics_prometheus_interval }} +{% endif %} + # you NEED this firewall section. # # Nebula has its own firewall in addition to anything diff --git a/templates/node_config.yml.j2 b/templates/node_config.yml.j2 index cce328f..5f83f29 100644 --- a/templates/node_config.yml.j2 +++ b/templates/node_config.yml.j2 @@ -67,6 +67,15 @@ logging: level: info format: text +{% if nebula_metrics_prometheus_enabled %} +stats: + type: prometheus + listen: {{ nebula_metrics_prometheus_listen }} + path: {{ nebula_metrics_prometheus_path }} + namespace: {{ nebula_metrics_prometheus_namespace }} + interval: {{ nebula_metrics_prometheus_interval }} +{% endif %} + # you NEED this firewall section. # # Nebula has its own firewall in addition to anything