Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

kandra: Make exporter ports listen only on localhost.

Alex Vandivere317fb558298
diff --git a/puppet/kandra/files/memcached_exporter b/puppet/kandra/files/memcached_exporter
index d39c1ece539..b2476497b37 100755
--- a/puppet/kandra/files/memcached_exporter
+++ b/puppet/kandra/files/memcached_exporter
@@ -393,6 +393,6 @@ class MemcachedCollector(Collector):
if __name__ == "__main__":
REGISTRY.register(MemcachedCollector())
- start_http_server(11212)
+ start_http_server(11212, addr="127.0.0.1")
while True:
time.sleep(60)
diff --git a/puppet/kandra/templates/prometheus/grok_exporter.yaml.template.erb b/puppet/kandra/templates/prometheus/grok_exporter.yaml.template.erb
index 193e699b99b..ed25a2c5a6d 100644
--- a/puppet/kandra/templates/prometheus/grok_exporter.yaml.template.erb
+++ b/puppet/kandra/templates/prometheus/grok_exporter.yaml.template.erb
@@ -65,4 +65,5 @@ metrics:
server:
protocol: http
+ host: 127.0.0.1
port: 9144
diff --git a/puppet/kandra/templates/supervisor/conf.d/prometheus_node_exporter.conf.template.erb b/puppet/kandra/templates/supervisor/conf.d/prometheus_node_exporter.conf.template.erb
index 5b83c4e513a..5711a0bae61 100644
--- a/puppet/kandra/templates/supervisor/conf.d/prometheus_node_exporter.conf.template.erb
+++ b/puppet/kandra/templates/supervisor/conf.d/prometheus_node_exporter.conf.template.erb
@@ -1,5 +1,5 @@
[program:prometheus_node_exporter]
-command=<%= @bin %> --collector.supervisord --collector.supervisord.url=unix:///var/run/supervisor.sock --no-collector.hwmon
+command=<%= @bin %> --collector.supervisord --collector.supervisord.url=unix:///var/run/supervisor.sock --no-collector.hwmon --web.listen-address=127.0.0.1:9100
priority=10
autostart=true
autorestart=true
diff --git a/puppet/kandra/templates/supervisor/conf.d/prometheus_postgres_exporter.conf.template.erb b/puppet/kandra/templates/supervisor/conf.d/prometheus_postgres_exporter.conf.template.erb
index cd181855cc2..56575692bc9 100644
--- a/puppet/kandra/templates/supervisor/conf.d/prometheus_postgres_exporter.conf.template.erb
+++ b/puppet/kandra/templates/supervisor/conf.d/prometheus_postgres_exporter.conf.template.erb
@@ -1,5 +1,5 @@
[program:prometheus_postgres_exporter]
-command=<%= @bin %> --collector.stat_user_indexes
+command=<%= @bin %> --collector.stat_user_indexes --web.listen-address=127.0.0.1:9187
environment=DATA_SOURCE_NAME="postgresql://prometheus@:5432/zulip?host=/var/run/postgresql"
priority=10
autostart=true
diff --git a/puppet/kandra/templates/supervisor/conf.d/prometheus_process_exporter.conf.template.erb b/puppet/kandra/templates/supervisor/conf.d/prometheus_process_exporter.conf.template.erb
index f6092769e8f..20a0fa435b7 100644
--- a/puppet/kandra/templates/supervisor/conf.d/prometheus_process_exporter.conf.template.erb
+++ b/puppet/kandra/templates/supervisor/conf.d/prometheus_process_exporter.conf.template.erb
@@ -1,5 +1,5 @@
[program:prometheus_process_exporter]
-command=<%= @bin %> -config.path <%= @conf %> -recheck-with-time-limit 1m
+command=<%= @bin %> -config.path <%= @conf %> -recheck-with-time-limit 1m -web.listen-address 127.0.0.1:9256
priority=10
autostart=true
autorestart=true
diff --git a/puppet/kandra/templates/supervisor/conf.d/prometheus_redis_exporter.conf.template.erb b/puppet/kandra/templates/supervisor/conf.d/prometheus_redis_exporter.conf.template.erb
index 889dcfc1068..a19a4e1e914 100644
--- a/puppet/kandra/templates/supervisor/conf.d/prometheus_redis_exporter.conf.template.erb
+++ b/puppet/kandra/templates/supervisor/conf.d/prometheus_redis_exporter.conf.template.erb
@@ -1,5 +1,5 @@
[program:prometheus_redis_exporter]
-command=/usr/local/bin/secret-env-wrapper REDIS_PASSWORD=redis_password <%= @bin %>
+command=/usr/local/bin/secret-env-wrapper REDIS_PASSWORD=redis_password <%= @bin %> --web.listen-address=127.0.0.1:9121
priority=10
autostart=true
autorestart=true
diff --git a/puppet/kandra/templates/supervisor/conf.d/prometheus_uwsgi_exporter.conf.template.erb b/puppet/kandra/templates/supervisor/conf.d/prometheus_uwsgi_exporter.conf.template.erb
index 8f926d803c3..529fbdc0efc 100644
--- a/puppet/kandra/templates/supervisor/conf.d/prometheus_uwsgi_exporter.conf.template.erb
+++ b/puppet/kandra/templates/supervisor/conf.d/prometheus_uwsgi_exporter.conf.template.erb
@@ -1,5 +1,5 @@
[program:prometheus_uwsgi_exporter]
-command=<%= @bin %> --stats.uri=unix:///home/zulip/deployments/uwsgi-stats --web.listen-address=:9238
+command=<%= @bin %> --stats.uri=unix:///home/zulip/deployments/uwsgi-stats --web.listen-address=127.0.0.1:9238
priority=10
autostart=true
autorestart=true
diff --git a/puppet/zulip/files/rabbitmq/rabbitmq.config b/puppet/zulip/files/rabbitmq/rabbitmq.config
index a0e4cf4dd5b..47b4fe83401 100644
--- a/puppet/zulip/files/rabbitmq/rabbitmq.config
+++ b/puppet/zulip/files/rabbitmq/rabbitmq.config
@@ -1,2 +1,3 @@
[{kernel, [{inet_dist_use_interface, {127,0,0,1}}]},
- {rabbit, [{tcp_listeners, [{"127.0.0.1", 5672}]}]}].
+ {rabbit, [{tcp_listeners, [{"127.0.0.1", 5672}]}]},
+ {rabbitmq_prometheus, [{tcp_config, [{ip, {127,0,0,1}}, {port, 15692}]}]}].
diff --git a/puppet/zulip/templates/supervisor/smokescreen.conf.erb b/puppet/zulip/templates/supervisor/smokescreen.conf.erb
index d9acadc9673..25bec53d71f 100644
--- a/puppet/zulip/templates/supervisor/smokescreen.conf.erb
+++ b/puppet/zulip/templates/supervisor/smokescreen.conf.erb
@@ -14,7 +14,7 @@ end
-%>
[program:smokescreen]
-command=<%= @bin %> --listen-ip <%= @listen_address %> --expose-prometheus-metrics --prometheus-port 4760<%= acl %>
+command=<%= @bin %> --listen-ip <%= @listen_address %> --expose-prometheus-metrics --prometheus-listen-ip 127.0.0.1 --prometheus-port 4760<%= acl %>
priority=15
autostart=true
autorestart=true