From 1b717f2d91083a3ba72614926f83769d2868c3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chrz=C4=85szcz?= Date: Wed, 14 Feb 2024 14:48:13 +0100 Subject: [PATCH] Template metrics config --- rel/fed1.vars-toml.config | 1 + rel/files/mongooseim.toml | 10 ++++++++++ rel/mim1.vars-toml.config | 1 + rel/mim2.vars-toml.config | 1 + rel/mim3.vars-toml.config | 1 + rel/prod.vars-toml.config | 1 + rel/reg1.vars-toml.config | 1 + rel/vars-toml.config | 7 ++++++- 8 files changed, 22 insertions(+), 1 deletion(-) diff --git a/rel/fed1.vars-toml.config b/rel/fed1.vars-toml.config index 34c4b2420f..6abdd550e4 100644 --- a/rel/fed1.vars-toml.config +++ b/rel/fed1.vars-toml.config @@ -12,6 +12,7 @@ {http_graphql_api_user_endpoint_port, 5566}. {http_api_endpoint_port, 5294}. {http_api_client_endpoint_port, 8095}. +{http_prometheus_endpoint_port, 9095}. %% This node is for s2s testing. %% "localhost" host should NOT be defined. diff --git a/rel/files/mongooseim.toml b/rel/files/mongooseim.toml index 5c2f52db06..ddaae8486f 100644 --- a/rel/files/mongooseim.toml +++ b/rel/files/mongooseim.toml @@ -117,6 +117,16 @@ host = "_" path = "/api/graphql" schema_endpoint = "user" +{{#http_prometheus_endpoint}} + +[[listen.http]] + {{{http_prometheus_endpoint}}} + transport.num_acceptors = 10 + + [[listen.http.handlers.mongoose_prometheus_handler]] + host = "_" + path = "/metrics" +{{/http_prometheus_endpoint}} [[listen.c2s]] port = {{{c2s_port}}} diff --git a/rel/mim1.vars-toml.config b/rel/mim1.vars-toml.config index 6c909e77e5..8b0769a716 100644 --- a/rel/mim1.vars-toml.config +++ b/rel/mim1.vars-toml.config @@ -16,6 +16,7 @@ {http_graphql_api_user_endpoint_port, 5561}. {http_api_endpoint_port, 8088}. {http_api_client_endpoint_port, 8089}. +{http_prometheus_endpoint_port, 9091}. {hosts, "\"localhost\", \"anonymous.localhost\", \"localhost.bis\""}. {host_types, "\"test type\", \"dummy auth\", \"anonymous\""}. diff --git a/rel/mim2.vars-toml.config b/rel/mim2.vars-toml.config index ef2992d590..67033bd9de 100644 --- a/rel/mim2.vars-toml.config +++ b/rel/mim2.vars-toml.config @@ -14,6 +14,7 @@ {http_graphql_api_admin_endpoint_port, 5552}. {http_graphql_api_domain_admin_endpoint_port, 5542}. {http_graphql_api_user_endpoint_port, 5562}. +{http_prometheus_endpoint_port, 9092}. {hosts, "\"localhost\", \"anonymous.localhost\", \"localhost.bis\""}. {host_types, "\"test type\", \"dummy auth\""}. diff --git a/rel/mim3.vars-toml.config b/rel/mim3.vars-toml.config index 9d00c27336..a2e91723eb 100644 --- a/rel/mim3.vars-toml.config +++ b/rel/mim3.vars-toml.config @@ -14,6 +14,7 @@ {http_graphql_api_user_endpoint_port, 5563}. {http_api_endpoint_port, 8092}. {http_api_client_endpoint_port, 8193}. +{http_prometheus_endpoint_port, 9093}. "./vars-toml.config". diff --git a/rel/prod.vars-toml.config b/rel/prod.vars-toml.config index 666ef865a3..88bbf033be 100644 --- a/rel/prod.vars-toml.config +++ b/rel/prod.vars-toml.config @@ -13,6 +13,7 @@ {http_graphql_api_user_endpoint_port, 5561}. {http_api_endpoint_port, 8088}. {http_api_client_endpoint_port, 8089}. +{http_prometheus_endpoint_port, 9091}. {hosts, "\"localhost\""}. {default_server_domain, "\"localhost\""}. diff --git a/rel/reg1.vars-toml.config b/rel/reg1.vars-toml.config index da485e138c..6b138f9f68 100644 --- a/rel/reg1.vars-toml.config +++ b/rel/reg1.vars-toml.config @@ -13,6 +13,7 @@ {http_graphql_api_user_endpoint_port, 5564}. {http_api_endpoint_port, 8074}. {http_api_client_endpoint_port, 8075}. +{http_prometheus_endpoint_port, 9094}. %% This node is for global distribution testing. %% reg is short for region. diff --git a/rel/vars-toml.config b/rel/vars-toml.config index 4608f2bf7b..2f3821a446 100644 --- a/rel/vars-toml.config +++ b/rel/vars-toml.config @@ -15,10 +15,15 @@ {http_api_endpoint, "ip_address = \"127.0.0.1\" port = {{http_api_endpoint_port}}"}. {http_api_client_endpoint, "port = {{ http_api_client_endpoint_port }}"}. +{http_prometheus_endpoint, "port = {{ http_prometheus_endpoint_port }}"}. {s2s_use_starttls, "\"optional\""}. {s2s_certfile, "\"priv/ssl/fake_server.pem\""}. {internal_databases, "[internal_databases.mnesia]"}. -{metrics_section, "[metrics.exometer]"}. + +%% This is temporary, and most likely we will only enable Prometheus by default +{metrics_section, "[metrics.exometer] + +[metrics.prometheus]"}. "./configure.vars.config".