-
Notifications
You must be signed in to change notification settings - Fork 4
/
system_monitor.app.src
88 lines (85 loc) · 3.76 KB
/
system_monitor.app.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
%% -*- mode: erlang -*-
%%--------------------------------------------------------------------------------
%% Copyright 2022 k32
%% Copyright 2020 Klarna Bank AB
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%--------------------------------------------------------------------------------
{application, system_monitor,
[ {description, "Monitoring app that exports Erlang VM introspection data to the external databases."}
, {licenses, ["Apache 2.0"]}
, {vsn, "git"}
, {registered, []}
, {modules, []}
, {mod, {system_monitor_app, []}}
, {applications, [kernel, stdlib, supervisor3, epgsql]}
, {env,
[ %% Specifies how many topmost processes should be reported per
%% category (such as `top_memory', `top_reductions', etc.)
{top_num_items, 10}
%% Specifies how often process top should be collected (in ms):
, {top_sample_interval, 2000}
%% Specifies sample size for the approximate metrics, such as
%% 'percentage of processes started by an app', and 'percentage
%% of processes running a function':
, {top_sample_size, 1000}
%% Stop reporting exact process data when the number of
%% processes is above this threshold, in order to avoid
%% hammering the VM with introspection BIFs (this doesn't affect
%% approximate monitors that rely on sampling):
, {top_max_procs, 15000}
%% Don't report values to `app_top' and `fun_top' below the
%% threshold as insignificant:
, {top_significance_threshold,
#{ current_function => 0.01 % 1 percent of all processes
, initial_call => 0.01 % 1 percent of all processes
, reductions => 0.01 % 1 percent of total reductions
, abs_reductions => 100 % Absolute number of reductions
, memory => 0.01 % 1 percent of total memory
, num_processes => 100 % absolute number of processes
}}
%% List of registered processes that should be always reported:
, {vips, [mnesia_tm, mnesia_locker]}
%% Data reporting callback. It is called whenever the data is collected.
, {callback_mod, system_monitor_dummy}
%% Postgres callback settings:
, {db_hostname, "localhost"}
, {db_port, 5432}
, {db_username, "system_monitor"}
, {db_password, "system_monitor_password"}
, {db_name, "system_monitor"}
, {db_connection_timeout, 5000}
%% Specify node-specific healthcheck function as `{module(),
%% function()}', for example: `{my_app, node_status}'. This
%% function should return an HTML-formatted status report:
, {node_status_fun, undefined}
%% List of status check functions: The format is
%%
%% `{Module, FunctionName, RunAtTerminate, Interval(Ticks)}'
, {status_checks, [ {system_monitor, check_process_count, false, 30}
, {system_monitor, suspect_procs, false, 5}
]}
, {tick_interval, 1000}
%% BEAM event settings:
, {beam_events,
[ busy_port
, busy_dist_port
, {long_gc, 500}
, {long_schedule, 500}
]}
%% Suspect process settings:
, {suspect_procs_max_memory, 524288000} %% 500 MB
, {suspect_procs_max_message_queue_len, 5000}
, {suspect_procs_max_total_heap_size, 524288000} %% 500 MB
]}
]}.