Packages

Monitoring based on Telemetry + Prometheus

Current section

Files

Jump to
teleprom src teleprom_app.erl
Raw

src/teleprom_app.erl

%%%-------------------------------------------------------------------
%% @doc teleprom public API
%% @end
%%%-------------------------------------------------------------------
-module(teleprom_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
% setup http
cowboy:start_clear(
teleprom,
[{port, http_port()}, {num_acceptors, http_num_acceptors()}],
#{
env => #{dispatch => teleprom_http_router:get_routes()},
middlewares => [cowboy_router, teleprom_server_header_middleware, cowboy_handler]
}
),
teleprom_sup:start_link().
stop(_State) -> ok.
%% internal functions
http_num_acceptors() -> application:get_env(teleprom, http_num_acceptors, 128).
http_port() -> application:get_env(teleprom, http_port, 8087).