diff --git a/.github/workflows/erlang-checks.yml b/.github/workflows/erlang-checks.yml index ce2b643..74f590e 100644 --- a/.github/workflows/erlang-checks.yml +++ b/.github/workflows/erlang-checks.yml @@ -37,3 +37,4 @@ jobs: use-thrift: true thrift-version: ${{ needs.setup.outputs.thrift-version }} run-ct-with-compose: true + upload-coverage: false diff --git a/apps/bender/src/bender.erl b/apps/bender/src/bender.erl index a2299ba..f40bab0 100644 --- a/apps/bender/src/bender.erl +++ b/apps/bender/src/bender.erl @@ -34,6 +34,7 @@ stop() -> -spec start(normal, any()) -> {ok, pid()} | {error, any()}. start(_StartType, _StartArgs) -> + ok = setup_metrics(), supervisor:start_link({local, ?MODULE}, ?MODULE, []). -spec stop(any()) -> ok. @@ -134,3 +135,7 @@ enable_health_logging(Check) -> -spec get_prometheus_route() -> {iodata(), module(), _Opts :: any()}. get_prometheus_route() -> {"/metrics/[:registry]", prometheus_cowboy2_handler, []}. + +setup_metrics() -> + ok = woody_ranch_prometheus_collector:setup(), + ok = woody_hackney_prometheus_collector:setup(). diff --git a/apps/bender/src/bender_generator.erl b/apps/bender/src/bender_generator.erl index 85bf99d..33f3e76 100644 --- a/apps/bender/src/bender_generator.erl +++ b/apps/bender/src/bender_generator.erl @@ -14,6 +14,7 @@ -export([process_call/4]). -export([process_timeout/3]). -export([process_repair/4]). +-export([process_notification/4]). -type external_id() :: binary(). -type internal_id() :: binary() | {binary(), pos_integer()}. @@ -86,6 +87,10 @@ process_timeout(_Machine, _HandlerArgs, _HandlerOpts) -> process_repair(_Args, _Machine, _HandlerArgs, _HandlerOpts) -> not_implemented(repair). +-spec process_notification(args(_), machine(), handler_args(), handler_opts()) -> no_return(). +process_notification(_Args, _Machine, _HandlerArgs, _HandlerOpts) -> + not_implemented(notification). + %%% Internal functions -spec start(external_id(), internal_id(), user_context(), woody_context()) -> ok | {error, exists}. diff --git a/apps/bender/src/bender_sequence.erl b/apps/bender/src/bender_sequence.erl index de8be49..d204c71 100644 --- a/apps/bender/src/bender_sequence.erl +++ b/apps/bender/src/bender_sequence.erl @@ -14,6 +14,7 @@ -export([process_call/4]). -export([process_timeout/3]). -export([process_repair/4]). +-export([process_notification/4]). -type id() :: binary(). -type minimum() :: integer() | undefined. @@ -99,6 +100,10 @@ process_timeout(_Machine, _HandlerArgs, _HandlerOpts) -> process_repair(_Args, _Machine, _HandlerArgs, _HandlerOpts) -> not_implemented(repair). +-spec process_notification(args(_), machine(), handler_args(), handler_opts()) -> no_return(). +process_notification(_Args, _Machine, _HandlerArgs, _HandlerOpts) -> + not_implemented(notification). + %%% Internal functions -spec start(id(), init_args(), woody_context()) -> ok | {error, exists}. diff --git a/config/sys.config b/config/sys.config index 600c814..8b92442 100644 --- a/config/sys.config +++ b/config/sys.config @@ -106,5 +106,9 @@ {prometheus, [ {collectors, [default]} + ]}, + + {hackney, [ + {mod_metrics, woody_hackney_prometheus} ]} ]. diff --git a/rebar.lock b/rebar.lock index 66f757c..d941214 100644 --- a/rebar.lock +++ b/rebar.lock @@ -3,7 +3,7 @@ {<<"acceptor_pool">>,{pkg,<<"acceptor_pool">>,<<"1.0.0">>},2}, {<<"bender_proto">>, {git,"https://github.com/valitydev/bender-proto.git", - {ref,"71c56878c1cf154cdfab9bbc563ddba25abe7259"}}, + {ref,"753b935b52a52e41b571d6e580f7dfe1377364f1"}}, 0}, {<<"cache">>,{pkg,<<"cache">>,<<"2.3.3">>},1}, {<<"certifi">>,{pkg,<<"certifi">>,<<"2.8.0">>},2}, @@ -17,7 +17,7 @@ {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"erl_health">>, {git,"https://github.com/valitydev/erlang-health.git", - {ref,"7ffbc855bdbe79e23efad1803b0b185c9ea8d2f1"}}, + {ref,"49716470d0e8dab5e37db55d52dea78001735a3d"}}, 0}, {<<"genlib">>, {git,"https://github.com/valitydev/genlib.git", @@ -31,12 +31,12 @@ {<<"jsx">>,{pkg,<<"jsx">>,<<"3.1.0">>},1}, {<<"machinery">>, {git,"https://github.com/valitydev/machinery-erlang.git", - {ref,"62c32434c80a462956ad9d50f9bce47836580d77"}}, + {ref,"19cdc6c846f0ebf65ae193ca0988e353e53fe1d5"}}, 0}, {<<"metrics">>,{pkg,<<"metrics">>,<<"1.0.1">>},2}, {<<"mg_proto">>, - {git,"https://github.com/valitydev/machinegun-proto.git", - {ref,"a411c7d5d779389c70d2594eb4a28a916dce1721"}}, + {git,"https://github.com/valitydev/machinegun-proto", + {ref,"96f7f11b184c29d8b7e83cd7646f3f2c13662bda"}}, 1}, {<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.2.0">>},2}, {<<"msgpack_proto">>, @@ -59,7 +59,7 @@ {<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},2}, {<<"scoper">>, {git,"https://github.com/valitydev/scoper.git", - {ref,"41a14a558667316998af9f49149ee087ffa8bef2"}}, + {ref,"55a2a32ee25e22fa35f583a18eaf38b2b743429b"}}, 0}, {<<"snowflake">>, {git,"https://github.com/valitydev/snowflake.git", @@ -76,7 +76,7 @@ {<<"unicode_util_compat">>,{pkg,<<"unicode_util_compat">>,<<"0.7.0">>},2}, {<<"woody">>, {git,"https://github.com/valitydev/woody_erlang.git", - {ref,"5d46291a6bfcee0bae2a9346a7d927603a909249"}}, + {ref,"81219ba5408e1c67f5eaed3c7e566ede42da88d4"}}, 0}]}. [ {pkg_hash,[