Skip to content

Commit

Permalink
More prometheus metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
majastanislawska committed Jun 22, 2018
1 parent cc7906f commit bdc3980
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -4,3 +4,6 @@
[submodule "lib/accept"]
path = lib/accept
url = https://github.com/deadtrickster/accept.git
[submodule "lib/prometheus_process_collector"]
path = lib/prometheus_process_collector
url = https://github.com/deadtrickster/prometheus_process_collector.git
7 changes: 6 additions & 1 deletion Makefile
Expand Up @@ -3,7 +3,11 @@
DIALYZER = dialyzer
PLT_APPS = erts kernel stdlib sasl inets ssl public_key crypto compiler mnesia sasl eunit asn1 compiler runtime_tools syntax_tools xmerl edoc tools os_mon

ERL_OPTS= -pa ebin/ -pa lib/prometheus/_build/default/lib/prometheus/ebin -pa lib/accept/_build/default/lib/accept/ebin -s prometheus
ERL_OPTS= -pa ebin/ \
-pa lib/prometheus/_build/default/lib/prometheus/ebin \
-pa lib/accept/_build/default/lib/accept/ebin \
-pa lib/prometheus_process_collector/_build/default/lib/prometheus_process_collector/ebin \
-s prometheus

test_all: test test_apps

Expand Down Expand Up @@ -37,6 +41,7 @@ all: ebin logs blocks
git submodule update
(cd lib/prometheus && ./rebar3 compile)
(cd lib/accept && ./rebar3 compile)
(cd lib/prometheus_process_collector && ./rebar3 compile && cp _build/default/lib/prometheus_process_collector/priv/*.so ../../priv)
erlc +export_all -o ebin/ src/ar.erl
erl $(ERL_OPTS) -noshell -s ar rebuild -s init stop

Expand Down
1 change: 1 addition & 0 deletions arweave-server
Expand Up @@ -13,4 +13,5 @@ fi
exec erl $SHELL_OPTS -pa ebin/ \
-pa lib/prometheus/_build/default/lib/prometheus/ebin \
-pa lib/accept/_build/default/lib/accept/ebin \
-pa lib/prometheus_process_collector/_build/default/lib/prometheus_process_collector/ebin \
-s ar rebuild -s prometheus -run ar main "$@"
1 change: 1 addition & 0 deletions lib/prometheus_process_collector
4 changes: 4 additions & 0 deletions src/ar.erl
Expand Up @@ -146,6 +146,10 @@ start(
}) ->
% Optionally clear the block cache
if Clean -> ar_storage:clear(); true -> do_nothing end,
%register prometheus stats collector,
%prometheus collector app is started at cmdline
application:ensure_started(prometheus),
prometheus_registry:register_collector(prometheus_process_collector),
% Start apps which we depend on.
inets:start(),
ar_meta_db:start(),
Expand Down

0 comments on commit bdc3980

Please sign in to comment.