Skip to content

Commit

Permalink
Add instrumentation config to TOML files
Browse files Browse the repository at this point in the history
- Enable exometer and prometheus for now.
  It would be needed to pass tests.
- In the future we would most likely only enable prometheus by
  default.
- Prometheus HTTP endpoint is exposed by default.
  • Loading branch information
chrzaszcz committed Feb 15, 2024
1 parent 9302206 commit 35204ed
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions rel/fed1.vars-toml.config
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions rel/files/mongooseim.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}}
Expand Down Expand Up @@ -259,6 +269,8 @@

[modules.mod_carboncopy]

{{{instrumentation}}}

[shaper.normal]
max_rate = 1000

Expand Down
1 change: 1 addition & 0 deletions rel/mim1.vars-toml.config
Original file line number Diff line number Diff line change
Expand Up @@ -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\""}.
Expand Down
1 change: 1 addition & 0 deletions rel/mim2.vars-toml.config
Original file line number Diff line number Diff line change
Expand Up @@ -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\""}.
Expand Down
1 change: 1 addition & 0 deletions rel/mim3.vars-toml.config
Original file line number Diff line number Diff line change
Expand Up @@ -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".

Expand Down
1 change: 1 addition & 0 deletions rel/prod.vars-toml.config
Original file line number Diff line number Diff line change
Expand Up @@ -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\""}.
Expand Down
1 change: 1 addition & 0 deletions rel/reg1.vars-toml.config
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 6 additions & 0 deletions rel/vars-toml.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@
{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]"}.

%% This is temporary, and most likely we will only enable Prometheus by default
{instrumentation, "[instrumentation.exometer]

[instrumentation.prometheus]"}.

"./configure.vars.config".

%% Defined by appending configure.vars.config
Expand Down

0 comments on commit 35204ed

Please sign in to comment.