diff --git a/rebar.config b/rebar.config index f9753e9..2801790 100644 --- a/rebar.config +++ b/rebar.config @@ -1,8 +1,7 @@ %% -*- erlang -*- {deps, [ - {exometer_core, ".*", {git, "git://github.com/Feuerlabs/exometer_core.git", "09c2a93"}}, - {afunix, ".*", {git, "git://github.com/tonyrog/afunix.git", "180eed9"}} + {exometer_core, ".*", {git, "git://github.com/Feuerlabs/exometer_core.git", "09c2a93"}} ]}. {erl_opts, diff --git a/src/exometer_collectd.app.src b/src/exometer_collectd.app.src index e3a08f4..daaaa7c 100644 --- a/src/exometer_collectd.app.src +++ b/src/exometer_collectd.app.src @@ -5,7 +5,7 @@ {vsn, git}, {registered, []}, {applications, [kernel, stdlib, - lager, afunix, exometer_core]}, + lager, exometer_core]}, {included_applications, []}, {env, []} ]}. diff --git a/src/exometer_report_collectd.erl b/src/exometer_report_collectd.erl index 4b2ef0a..3027b10 100644 --- a/src/exometer_report_collectd.erl +++ b/src/exometer_report_collectd.erl @@ -247,7 +247,7 @@ report_exometer_(Metric, DataPoint, Extra, Value, type_map = TypeMap} = St) -> case get_type(TypeMap, Extra, ets_key(Metric, DataPoint)) of error -> - ?log(warning, + ?log(warning, "Could not resolve ~p to a collectd type." "Update exometer_report_collectd -> type_map in app.config. " "Value lost~n", [ets_key(Metric, DataPoint)]), @@ -262,9 +262,9 @@ report_exometer_(Metric, DataPoint, Extra, Value, send_request(Sock, Request, Metric, DataPoint, Extra, Value, #st{read_timeout = TOut} = St) -> - try afunix:send(Sock, Request) of + try gen_tcp:send(Sock, Request) of ok -> - case afunix:recv(Sock, 0, TOut) of + case gen_tcp:recv(Sock, 0, TOut) of {ok, Bin} -> %% Parse the reply case parse_reply(Request, Bin, St) of @@ -351,7 +351,7 @@ connect_collectd(St) -> end. connect_collectd(SocketPath, ConnectTimeout) -> - afunix:connect(SocketPath, [{active, false}, {mode, binary}], ConnectTimeout). + gen_tcp:connect(SocketPath, [{active, false}, {mode, binary}], ConnectTimeout). unix_time() -> datetime_to_unix_time(erlang:universaltime()). @@ -422,7 +422,7 @@ get_type(TypeMap, Extra, Name) -> maybe_reconnect_after(Socket) -> %% Close socket if open - if Socket =/= undefined -> afunix:close(Socket); + if Socket =/= undefined -> gen_tcp:close(Socket); true -> true end, prepare_reconnect().