%% -*- erlang -*-

[%% ================================================================================
 %% application config
 %% ================================================================================
 {osmo_s1gw, [
   %% SCTP server configuration
   {sctp_server, #{
      %% local (bind) address for incoming eNB connections
      laddr => "127.0.1.1",
      %% local (bind) port for incoming eNB connections
      lport => 36412,
      %% socket options (if omitted or left empty, defaults apply)
      sockopts => #{ }
   }},
   %% SCTP client configuration
   {sctp_client, #{
      %% local (bind) address for outgoing connections to the MME
      laddr => "127.0.2.1",
      %% remote address for outgoing connections to the MME
      raddr => "127.0.2.10",
      %% remote port for outgoing connections to the MME
      rport => 36412,
      %% socket options (if omitted or left empty, defaults apply)
      sockopts => #{ }
   }},
   %% MME pool
   {mme_pool, [
      #{name => "mme0", laddr => "127.0.2.1", raddr => "127.0.2.10"},
      #{name => "mme1", laddr => "127.0.2.1", raddr => "127.0.2.11"},
      #{name => "mme2", laddr => "127.0.2.1", raddr => "127.0.2.12"}
   ]},
   {pfcp_loc_addr, "127.0.3.1"}, %% local address for incoming PFCP PDUs from the UPF
   {pfcp_rem_addr, "127.0.3.10"} %% remote address for outgoing PFCP PDUs to the UPF
 ]},
 %% ================================================================================
 %% kernel config
 %% ================================================================================
 {kernel, [
   {logger_level, debug},
   {logger, [
     {handler, gsmtap, logger_gsmtap_h,
      #{level => debug,
        config => #{rem_addr => "127.0.0.1",
                    app_name => "OsmoS1GW"}}},
     {handler, default, logger_std_h,
      #{formatter =>
        {logger_color_formatter, #{legacy_header => false,
                                   single_line => false,
                                   template => [time, " ", color, "[", level, "]",
                                                {pid, [" ", pid, ""], ""},
                                                {prefix, [" ", prefix, " ::"], ""},
                                                " ", msg,
                                                {mfa, [" (", mfa, ":", line, ")"], ""},
                                                reset, "\n"]}}}}]}
  ]
 },
 {exometer_core,
  [{predefined,
    [%{[erlang, memory], {function, erlang, memory, [], value, []}, []},
     %{[erlang, system_info], {function, erlang, system_info, ['$dp'], value, [process_count]}, []},
     %{[erlang, statistics], {function, erlang, statistics, ['$dp'], value, [run_queue]}, []},
     %{[erlang, io], {function, erlang, statistics, [io], match, {{'_', input}, {'_', output}}}, []}
    ]
   },
   {report,
    [{reporters,
      [%%{exometer_report_tty, []},
       {exometer_report_statsd,
        [{hostname, "127.0.4.10"},
         {port, 8125},
         {prefix, "s1gw"},
         {type_map, []}
        ]
       }
      ]
     },
     {subscribers,
      [%%{select, {[{ {['_' | '_'],'_','_'}, [], ['$_']}],
       %% exometer_report_tty, value, 1000, true}}
       {select, {[{ {['_' | '_'],counter,'_'}, [], ['$_']}],
                 exometer_report_statsd,
                 value,
                 1000,
                 true,
                 [{report_type, counter}]
                }
       },
       {select, {[{ {['_' | '_'],gauge,'_'}, [], ['$_']}],
                 exometer_report_statsd,
                 value,
                 1000,
                 true,
                 [{report_type, gauge}]
                }
       }
      ]
     }
    ]
   }
  ]
 }
].

%% vim:set ts=2 sw=2 et:
