diff --git a/.env b/.env index e0b20bb..58be982 100644 --- a/.env +++ b/.env @@ -2,6 +2,6 @@ # You SHOULD specify point releases here so that build time and run time Erlang/OTPs # are the same. See: https://github.com/erlware/relx/pull/902 SERVICE_NAME=url-shortener -OTP_VERSION=24.2.0 +OTP_VERSION=24.3.4 REBAR_VERSION=3.18 -THRIFT_VERSION=0.14.2.2 +THRIFT_VERSION=0.14.2.3 diff --git a/Makefile b/Makefile index e7b8703..25c966b 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,6 @@ # For example, to run with podman put `DOCKER=podman` there. -include Makefile.env --include .env - # NOTE # Variables specified in `.env` file are used to pick and setup specific # component versions, both when building a development image and when running @@ -18,7 +16,7 @@ DEV_IMAGE_ID = $(file < .image.dev) DOCKER ?= docker DOCKERCOMPOSE ?= docker-compose -DOCKERCOMPOSE_W_ENV = DEV_IMAGE_TAG=$(DEV_IMAGE_TAG) $(DOCKERCOMPOSE) +DOCKERCOMPOSE_W_ENV = DEV_IMAGE_TAG=$(DEV_IMAGE_TAG) $(DOCKERCOMPOSE) -f compose.yaml -f compose.tracing.yaml REBAR ?= rebar3 TEST_CONTAINER_NAME ?= testrunner @@ -42,7 +40,7 @@ DOCKER_WC_OPTIONS := -v $(PWD):$(PWD) --workdir $(PWD) DOCKER_WC_EXTRA_OPTIONS ?= --rm DOCKER_RUN = $(DOCKER) run -t $(DOCKER_WC_OPTIONS) $(DOCKER_WC_EXTRA_OPTIONS) -DOCKERCOMPOSE_RUN = $(DOCKERCOMPOSE_W_ENV) run --rm $(DOCKER_WC_OPTIONS) $(TEST_CONTAINER_NAME) +DOCKERCOMPOSE_RUN = $(DOCKERCOMPOSE_W_ENV) run --rm $(DOCKER_WC_OPTIONS) # Utility tasks @@ -53,11 +51,11 @@ wc-%: dev-image $(DOCKER_RUN) $(DEV_IMAGE_TAG) make $* wdeps-shell: dev-image - $(DOCKERCOMPOSE_RUN) su; \ + $(DOCKERCOMPOSE_RUN) $(TEST_CONTAINER_NAME) su; \ $(DOCKERCOMPOSE_W_ENV) down wdeps-%: dev-image - $(DOCKERCOMPOSE_RUN) make $*; \ + $(DOCKERCOMPOSE_RUN) -T $(TEST_CONTAINER_NAME) make $*; \ res=$$?; \ $(DOCKERCOMPOSE_W_ENV) down; \ exit $$res diff --git a/apps/shortener/src/shortener.app.src b/apps/shortener/src/shortener.app.src index 1461a09..7ce04f1 100644 --- a/apps/shortener/src/shortener.app.src +++ b/apps/shortener/src/shortener.app.src @@ -19,7 +19,10 @@ token_keeper_client, woody, woody_user_identity, - erl_health + erl_health, + opentelemetry_api, + opentelemetry_exporter, + opentelemetry ]}, {env, []}, {modules, []}, diff --git a/apps/shortener/src/shortener_bouncer.erl b/apps/shortener/src/shortener_bouncer.erl index 4d7f89d..c645d53 100644 --- a/apps/shortener/src/shortener_bouncer.erl +++ b/apps/shortener/src/shortener_bouncer.erl @@ -1,6 +1,6 @@ -module(shortener_bouncer). --include_lib("bouncer_proto/include/bouncer_context_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_ctx_thrift.hrl"). -export([gather_context_fragments/4]). -export([judge/2]). diff --git a/apps/shortener/src/shortener_bouncer_context.erl b/apps/shortener/src/shortener_bouncer_context.erl index 6219110..edee006 100644 --- a/apps/shortener/src/shortener_bouncer_context.erl +++ b/apps/shortener/src/shortener_bouncer_context.erl @@ -1,6 +1,7 @@ -module(shortener_bouncer_context). --include_lib("bouncer_proto/include/bouncer_context_v1_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_base_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_ctx_v1_thrift.hrl"). -type fragment() :: bouncer_client:context_fragment(). -type acc() :: bouncer_context_helpers:context_fragment(). @@ -45,13 +46,13 @@ build(Prototypes, {Acc0, External}) -> build(operation, #{id := OperationID} = Params, Acc) -> Slug = maps:get(slug, Params, #{}), - Acc#bctx_v1_ContextFragment{ - shortener = #bctx_v1_ContextUrlShortener{ - op = #bctx_v1_UrlShortenerOperation{ + Acc#ctx_v1_ContextFragment{ + shortener = #ctx_v1_ContextUrlShortener{ + op = #ctx_v1_UrlShortenerOperation{ id = operation_id_to_binary(OperationID), - shortened_url = #bctx_v1_ShortenedUrl{ + shortened_url = #ctx_v1_ShortenedUrl{ id = maps:get(id, Slug, undefined), - owner = #bouncer_base_Entity{ + owner = #base_Entity{ id = maps:get(owner, Slug, undefined) } } diff --git a/apps/shortener/src/shortener_handler.erl b/apps/shortener/src/shortener_handler.erl index 0ff34f7..1236d3c 100644 --- a/apps/shortener/src/shortener_handler.erl +++ b/apps/shortener/src/shortener_handler.erl @@ -1,5 +1,8 @@ -module(shortener_handler). +-include_lib("opentelemetry_api/include/otel_tracer.hrl"). +-include_lib("opentelemetry_api/include/opentelemetry.hrl"). + %% Swagger handler -behaviour(swag_server_ushort_logic_handler). @@ -35,11 +38,11 @@ swag_server_ushort:handler_opts(_) ) -> Result :: false | {true, shortener_auth:preauth_context()}. -authorize_api_key(OperationID, ApiKey, _Context, _HandlerOpts) -> - ok = scoper:add_scope('swag.server', #{operation => OperationID}), +authorize_api_key(OperationID, ApiKey, Context, _HandlerOpts) -> + ok = set_otel_context(Context), case shortener_auth:preauthorize_api_key(ApiKey) of - {ok, Context} -> - {true, Context}; + {ok, Context1} -> + {true, Context1}; {error, Error} -> _ = logger:info("API Key preauthorization failed for ~p due to ~p", [OperationID, Error]), false @@ -47,12 +50,21 @@ authorize_api_key(OperationID, ApiKey, _Context, _HandlerOpts) -> -spec handle_request(operation_id(), request_data(), request_ctx(), any()) -> {ok | error, swag_server_ushort:response()}. -handle_request(OperationID, Req, SwagContext0, _Opts) -> +handle_request(OperationID, Req, SwagContext, Opts) -> + SpanName = <<"server ", (atom_to_binary(OperationID))/binary>>, + ?with_span(SpanName, #{kind => ?SPAN_KIND_SERVER}, fun(_SpanCtx) -> + scoper:scope('swag.server', #{operation => OperationID}, fun() -> + handle_request_(OperationID, Req, SwagContext, Opts) + end) + end). + +handle_request_(OperationID, Req, SwagContext0, _Opts) -> try WoodyContext0 = create_woody_ctx(Req), SwagContext1 = authenticate_api_key(SwagContext0, WoodyContext0), AuthContext = get_auth_context(SwagContext1), WoodyContext1 = put_user_identity(WoodyContext0, AuthContext), + ok = set_context_meta(AuthContext), Slug = prefetch_slug(Req, WoodyContext1), case shortener_auth:authorize_operation(make_prototypes(OperationID, Slug), SwagContext1, WoodyContext1) of allowed -> @@ -67,8 +79,6 @@ handle_request(OperationID, Req, SwagContext0, _Opts) -> {error, {401, #{}, undefined}}; error:{woody_error, {Source, Class, Details}} -> {error, handle_woody_error(Source, Class, Details)} - after - ok = scoper:remove_scope() end. -spec map_error(error_type(), validation_error()) -> error_message(). @@ -127,6 +137,14 @@ collect_user_identity(AuthContext) -> email => shortener_auth:get_user_email(AuthContext) }). +set_context_meta(AuthContext) -> + Meta = #{ + metadata => #{ + 'user-identity' => collect_user_identity(AuthContext) + } + }, + scoper:add_meta(Meta). + handle_woody_error(_Source, result_unexpected, _Details) -> {500, #{}, <<>>}; handle_woody_error(_Source, resource_unavailable, _Details) -> @@ -255,6 +273,14 @@ get_source_url_whitelist() -> % upon initialization maps:get(source_url_whitelist, genlib_app:env(shortener, api), []). +set_otel_context(#{cowboy_req := Req}) -> + Headers = cowboy_req:headers(Req), + %% Implicitly puts OTEL context into process dictionary. + %% Since cowboy does not reuse process for other requests, we don't care + %% about cleaning it up. + _OtelCtx = otel_propagator_text_map:extract(maps:to_list(Headers)), + ok. + %% -type state() :: undefined. diff --git a/apps/shortener/test/shortener_auth_SUITE.erl b/apps/shortener/test/shortener_auth_SUITE.erl index 4f93ea5..ab45d3a 100644 --- a/apps/shortener/test/shortener_auth_SUITE.erl +++ b/apps/shortener/test/shortener_auth_SUITE.erl @@ -1,8 +1,8 @@ -module(shortener_auth_SUITE). --include_lib("bouncer_proto/include/bouncer_decisions_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_decision_thrift.hrl"). -include_lib("bouncer_proto/include/bouncer_base_thrift.hrl"). --include_lib("bouncer_proto/include/bouncer_context_v1_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_ctx_v1_thrift.hrl"). -include_lib("shortener_token_keeper_data.hrl"). -include_lib("shortener_bouncer_data.hrl"). @@ -300,19 +300,19 @@ append_request_id(Params = #{header := Headers}) -> format_ts(Ts) -> genlib_rfc3339:format(Ts, second). -get_operation_id(#bctx_v1_ContextFragment{ - shortener = #bctx_v1_ContextUrlShortener{op = #bctx_v1_UrlShortenerOperation{id = OperationID}} +get_operation_id(#ctx_v1_ContextFragment{ + shortener = #ctx_v1_ContextUrlShortener{op = #ctx_v1_UrlShortenerOperation{id = OperationID}} }) -> OperationID. get_owner_info(Context) -> {get_owner_id(Context), get_user_id(Context)}. -get_owner_id(#bctx_v1_ContextFragment{ - shortener = #bctx_v1_ContextUrlShortener{op = #bctx_v1_UrlShortenerOperation{shortened_url = Url}} +get_owner_id(#ctx_v1_ContextFragment{ + shortener = #ctx_v1_ContextUrlShortener{op = #ctx_v1_UrlShortenerOperation{shortened_url = Url}} }) -> - #bctx_v1_ShortenedUrl{owner = #bouncer_base_Entity{id = OwnerID}} = Url, + #ctx_v1_ShortenedUrl{owner = #base_Entity{id = OwnerID}} = Url, OwnerID. -get_user_id(#bctx_v1_ContextFragment{user = #bctx_v1_User{id = UserID}}) -> +get_user_id(#ctx_v1_ContextFragment{user = #ctx_v1_User{id = UserID}}) -> UserID. diff --git a/apps/shortener/test/shortener_bouncer_data.hrl b/apps/shortener/test/shortener_bouncer_data.hrl index a6601fc..efe2314 100644 --- a/apps/shortener/test/shortener_bouncer_data.hrl +++ b/apps/shortener/test/shortener_bouncer_data.hrl @@ -1,14 +1,15 @@ -ifndef(shortener_bouncer_data_included__). -define(shortener_bouncer_data_included__, ok). --include_lib("bouncer_proto/include/bouncer_decisions_thrift.hrl"). --include_lib("bouncer_proto/include/bouncer_context_v1_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_decision_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_ctx_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_ctx_v1_thrift.hrl"). -define(TEST_USER_REALM, <<"external">>). -define(TEST_RULESET_ID, <<"service/authz/api">>). --define(JUDGEMENT(Resolution), #bdcs_Judgement{resolution = Resolution}). --define(ALLOWED, {allowed, #bdcs_ResolutionAllowed{}}). --define(FORBIDDEN, {forbidden, #bdcs_ResolutionForbidden{}}). +-define(JUDGEMENT(Resolution), #decision_Judgement{resolution = Resolution}). +-define(ALLOWED, {allowed, #decision_ResolutionAllowed{}}). +-define(FORBIDDEN, {forbidden, #decision_ResolutionForbidden{}}). -endif. diff --git a/apps/shortener/test/shortener_ct_helper_bouncer.erl b/apps/shortener/test/shortener_ct_helper_bouncer.erl index 5f8f7f0..f30b112 100644 --- a/apps/shortener/test/shortener_ct_helper_bouncer.erl +++ b/apps/shortener/test/shortener_ct_helper_bouncer.erl @@ -23,7 +23,7 @@ mock_client(SupOrConfig) -> [ { org_management, - {orgmgmt_auth_context_provider_thrift, 'AuthContextProvider'}, + {orgmgmt_authctx_provider_thrift, 'AuthContextProvider'}, fun('GetUserContext', {UserID}) -> {encoded_fragment, Fragment} = bouncer_client:bake_context_fragment( bouncer_context_helpers:make_user_fragment(#{ @@ -47,7 +47,7 @@ mock_arbiter(JudgeFun, SupOrConfig) -> [ { bouncer, - {bouncer_decisions_thrift, 'Arbiter'}, + {bouncer_decision_thrift, 'Arbiter'}, fun('Judge', {?TEST_RULESET_ID, Context}) -> Fragments = decode_context(Context), Combined = combine_fragments(Fragments), @@ -59,11 +59,11 @@ mock_arbiter(JudgeFun, SupOrConfig) -> ) ). -decode_context(#bdcs_Context{fragments = Fragments}) -> +decode_context(#decision_Context{fragments = Fragments}) -> maps:map(fun(_, Fragment) -> decode_fragment(Fragment) end, Fragments). -decode_fragment(#bctx_ContextFragment{type = v1_thrift_binary, content = Content}) -> - Type = {struct, struct, {bouncer_context_v1_thrift, 'ContextFragment'}}, +decode_fragment(#ctx_ContextFragment{type = v1_thrift_binary, content = Content}) -> + Type = {struct, struct, {bouncer_ctx_v1_thrift, 'ContextFragment'}}, Codec = thrift_strict_binary_codec:new(Content), {ok, Fragment, _} = thrift_strict_binary_codec:read(Codec, Type), Fragment. @@ -80,7 +80,7 @@ combine_fragments(Fragments) -> [Fragment | Rest] = maps:values(Fragments), lists:foldl(fun combine_fragments/2, Fragment, Rest). -combine_fragments(Fragment1 = #bctx_v1_ContextFragment{}, Fragment2 = #bctx_v1_ContextFragment{}) -> +combine_fragments(Fragment1 = #ctx_v1_ContextFragment{}, Fragment2 = #ctx_v1_ContextFragment{}) -> combine_records(Fragment1, Fragment2). combine_records(Record1, Record2) -> diff --git a/apps/shortener/test/shortener_ct_helper_token_keeper.erl b/apps/shortener/test/shortener_ct_helper_token_keeper.erl index 5ab81f4..c90b99d 100644 --- a/apps/shortener/test/shortener_ct_helper_token_keeper.erl +++ b/apps/shortener/test/shortener_ct_helper_token_keeper.erl @@ -1,7 +1,7 @@ -module(shortener_ct_helper_token_keeper). -include_lib("token_keeper_proto/include/tk_token_keeper_thrift.hrl"). --include_lib("token_keeper_proto/include/tk_context_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_ctx_thrift.hrl"). -include_lib("shortener_token_keeper_data.hrl"). -define(TOKEN_ID, <<"LETMEIN">>). @@ -99,13 +99,13 @@ create_bouncer_context(AuthParams, UserParams) -> %% encode_context(Context) -> - #bctx_ContextFragment{ + #ctx_ContextFragment{ type = v1_thrift_binary, content = encode_context_content(Context) }. encode_context_content(Context) -> - Type = {struct, struct, {bouncer_context_v1_thrift, 'ContextFragment'}}, + Type = {struct, struct, {bouncer_ctx_v1_thrift, 'ContextFragment'}}, Codec = thrift_strict_binary_codec:new(), case thrift_strict_binary_codec:write(Codec, Type, Context) of {ok, Codec1} -> diff --git a/apps/shortener/test/shortener_general_SUITE.erl b/apps/shortener/test/shortener_general_SUITE.erl index 5d9e283..9549371 100644 --- a/apps/shortener/test/shortener_general_SUITE.erl +++ b/apps/shortener/test/shortener_general_SUITE.erl @@ -1,7 +1,7 @@ -module(shortener_general_SUITE). --include_lib("bouncer_proto/include/bouncer_decisions_thrift.hrl"). --include_lib("bouncer_proto/include/bouncer_context_v1_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_decision_thrift.hrl"). +-include_lib("bouncer_proto/include/bouncer_ctx_v1_thrift.hrl"). -export([init/1]). @@ -312,7 +312,7 @@ woody_timeout_test(C) -> Params = construct_params(SourceUrl), {Time, {error, {invalid_response_code, 503}}} = timer:tc(fun() -> - shorten_url(Params, C2) + shorten_url(Params, 30 * 1000, C2) end), true = (Time >= 3000000), genlib_app:stop_unload_applications(Apps). @@ -343,9 +343,13 @@ set_api_auth_token(Token, C) -> %% shorten_url(ShortenedUrlParams, C) -> + shorten_url(ShortenedUrlParams, 5000, C). + +shorten_url(ShortenedUrlParams, RecvTimeout, C) -> swag_client_ushort_shortener_api:shorten_url( ?config(api_endpoint, C), - append_common_params(#{body => ShortenedUrlParams}, C) + append_common_params(#{body => ShortenedUrlParams}, C), + [{recv_timeout, RecvTimeout}] ). delete_shortened_url(ID, C) -> diff --git a/compose.tracing.yaml b/compose.tracing.yaml new file mode 100644 index 0000000..105a1af --- /dev/null +++ b/compose.tracing.yaml @@ -0,0 +1,27 @@ +services: + testrunner: + depends_on: + jaeger: + condition: service_healthy + environment: + - OTEL_SERVICE_NAME=shortener + - OTEL_TRACES_EXPORTER=otlp + - OTEL_TRACES_SAMPLER=parentbased_always_on + - OTEL_EXPORTER_OTLP_PROTOCOL=http_protobuf + - OTEL_EXPORTER_OTLP_ENDPOINT=http://jaeger:4318 + + jaeger: + image: jaegertracing/all-in-one:1.47 + environment: + - COLLECTOR_OTLP_ENABLED=true + healthcheck: + test: "/go/bin/all-in-one-linux status" + interval: 2s + timeout: 1s + retries: 20 + ports: + - 4317:4317 # OTLP gRPC receiver + - 4318:4318 # OTLP http receiver + - 5778:5778 + - 14250:14250 + - 16686:16686 diff --git a/docker-compose.yml b/compose.yaml similarity index 81% rename from docker-compose.yml rename to compose.yaml index 83b526e..7cb8aa1 100644 --- a/docker-compose.yml +++ b/compose.yaml @@ -20,15 +20,13 @@ services: command: /sbin/init machinegun: - image: docker.io/rbkmoney/machinegun:c05a8c18cd4f7966d70b6ad84cac9429cdfe37ae - ports: - - "8022" + image: ghcr.io/valitydev/machinegun:sha-5c0db56 command: /opt/machinegun/bin/machinegun foreground volumes: - ./test/machinegun/config.yaml:/opt/machinegun/etc/config.yaml - ./test/machinegun/cookie:/opt/machinegun/etc/cookie healthcheck: - test: curl http://localhost:8022/health + test: "/opt/machinegun/bin/machinegun ping" interval: 5s timeout: 1s retries: 20 diff --git a/rebar.config b/rebar.config index 85f59f7..1c75e41 100644 --- a/rebar.config +++ b/rebar.config @@ -46,7 +46,12 @@ %% NOTE %% Pinning to version "1.11.2" from hex here causes constant upgrading and recompilation of the entire project - {jose, {git, "https://github.com/potatosalad/erlang-jose.git", {tag, "1.11.2"}}} + {jose, {git, "https://github.com/potatosalad/erlang-jose.git", {tag, "1.11.2"}}}, + + %% OpenTelemetry deps + {opentelemetry_api, "1.2.1"}, + {opentelemetry, "1.3.0"}, + {opentelemetry_exporter, "1.3.0"} ]}. {xref_checks, [ @@ -77,7 +82,7 @@ {prometheus, "4.8.1"}, {prometheus_cowboy, "0.1.8"}, {logger_logstash_formatter, - {git, "https://github.com/valitydev/logger_logstash_formatter.git", {ref, "87e52c7"}}}, + {git, "https://github.com/valitydev/logger_logstash_formatter.git", {ref, "08a66a6"}}}, {iosetopts, {git, "https://github.com/valitydev/iosetopts.git", {ref, "edb445c"}}}, % for introspection on production {recon, "2.3.2"} @@ -91,6 +96,7 @@ {runtime_tools, load}, % profiler {tools, load}, + {opentelemetry, temporary}, % log formatter {logger_logstash_formatter, load}, prometheus, diff --git a/rebar.lock b/rebar.lock index 958c3de..103e02f 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,18 +1,20 @@ {"1.2.0", -[{<<"bouncer_client">>, +[{<<"acceptor_pool">>,{pkg,<<"acceptor_pool">>,<<"1.0.0">>},2}, + {<<"bouncer_client">>, {git,"https://github.com/valitydev/bouncer-client-erlang.git", - {ref,"9f5cb1d9b82793ba57121e4fd23912c47b7ff0c7"}}, + {ref,"f7ab2fdf3bd39d447d4dd039280ef98937ce7c87"}}, 0}, {<<"bouncer_proto">>, - {git,"https://github.com/valitydev/bouncer-proto", - {ref,"8da12fe98bc751e7f8f17f64ad4f571a6a63b0fe"}}, - 1}, + {git,"https://github.com/valitydev/bouncer-proto.git", + {ref,"23d1761355d76923ee0f2797f106e9fb6ecf06c1"}}, + 0}, {<<"cache">>,{pkg,<<"cache">>,<<"2.3.3">>},1}, {<<"certifi">>,{pkg,<<"certifi">>,<<"2.6.1">>},1}, {<<"cg_mon">>, {git,"https://github.com/rbkmoney/cg_mon.git", {ref,"5a87a37694e42b6592d3b4164ae54e0e87e24e18"}}, 1}, + {<<"chatterbox">>,{pkg,<<"ts_chatterbox">>,<<"0.13.0">>},2}, {<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.9.0">>},0}, {<<"cowboy_access_log">>, {git,"https://github.com/valitydev/cowboy_access_log.git", @@ -23,21 +25,24 @@ {ref,"5a3b084fb8c5a4ff58e3c915a822d709d6023c3b"}}, 0}, {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},1}, + {<<"ctx">>,{pkg,<<"ctx">>,<<"0.6.0">>},2}, {<<"email_validator">>,{pkg,<<"email_validator">>,<<"1.1.0">>},0}, {<<"erl_health">>, {git,"https://github.com/valitydev/erlang-health.git", - {ref,"5958e2f35cd4d09f40685762b82b82f89b4d9333"}}, + {ref,"7ffbc855bdbe79e23efad1803b0b185c9ea8d2f1"}}, 0}, {<<"genlib">>, {git,"https://github.com/valitydev/genlib.git", - {ref,"82c5ff3866e3019eb347c7f1d8f1f847bed28c10"}}, + {ref,"f6074551d6586998e91a97ea20acb47241254ff3"}}, 0}, {<<"gproc">>,{pkg,<<"gproc">>,<<"0.9.0">>},1}, + {<<"grpcbox">>,{pkg,<<"grpcbox">>,<<"0.16.0">>},1}, {<<"gun">>, {git,"https://github.com/ninenines/gun.git", {ref,"e7dd9f227e46979d8073e71c683395a809b78cb4"}}, 1}, {<<"hackney">>,{pkg,<<"hackney">>,<<"1.17.4">>},0}, + {<<"hpack">>,{pkg,<<"hpack_erl">>,<<"0.2.3">>},3}, {<<"idna">>,{pkg,<<"idna">>,<<"6.1.1">>},1}, {<<"jesse">>, {git,"https://github.com/valitydev/jesse.git", @@ -51,18 +56,26 @@ {<<"metrics">>,{pkg,<<"metrics">>,<<"1.0.1">>},1}, {<<"mg_proto">>, {git,"https://github.com/valitydev/machinegun-proto.git", - {ref,"1cd15771196efe9b12f09290a93f9f34bdcb317a"}}, + {ref,"96f7f11b184c29d8b7e83cd7646f3f2c13662bda"}}, 0}, {<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.2.0">>},1}, + {<<"opentelemetry">>,{pkg,<<"opentelemetry">>,<<"1.3.0">>},0}, + {<<"opentelemetry_api">>,{pkg,<<"opentelemetry_api">>,<<"1.2.1">>},0}, + {<<"opentelemetry_exporter">>, + {pkg,<<"opentelemetry_exporter">>,<<"1.3.0">>}, + 0}, + {<<"opentelemetry_semantic_conventions">>, + {pkg,<<"opentelemetry_semantic_conventions">>,<<"0.2.0">>}, + 1}, {<<"org_management_proto">>, {git,"https://github.com/valitydev/org-management-proto", - {ref,"f433223706284000694e54e839fafb10db84e2b3"}}, + {ref,"04de2f4ad697430c75f8efa04716d30753bd7c4b"}}, 1}, {<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.4.1">>},0}, {<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},1}, {<<"scoper">>, {git,"https://github.com/valitydev/scoper.git", - {ref,"7f3183df279bc8181efe58dafd9cae164f495e6f"}}, + {ref,"41a14a558667316998af9f49149ee087ffa8bef2"}}, 0}, {<<"snowflake">>, {git,"https://github.com/valitydev/snowflake.git", @@ -81,18 +94,21 @@ {git,"https://github.com/valitydev/thrift_erlang.git", {ref,"c280ff266ae1c1906fb0dcee8320bb8d8a4a3c75"}}, 1}, + {<<"tls_certificate_check">>, + {pkg,<<"tls_certificate_check">>,<<"1.19.0">>}, + 1}, {<<"token_keeper_client">>, {git,"https://github.com/valitydev/token-keeper-client.git", - {ref,"06cc71293e28f3e01fe981069c48c9782d0ab1f2"}}, + {ref,"642b20e622ef5d3ed41127bdc9b2b0fc1d43c7e5"}}, 0}, {<<"token_keeper_proto">>, {git,"https://github.com/valitydev/token-keeper-proto.git", - {ref,"448afd93571f4f7feea655e29ea4b0e98fd808f5"}}, + {ref,"8b8bb4333828350301ae2fe801c0c8de61c6529c"}}, 1}, {<<"unicode_util_compat">>,{pkg,<<"unicode_util_compat">>,<<"0.7.0">>},1}, {<<"woody">>, {git,"https://github.com/valitydev/woody_erlang.git", - {ref,"0c2e16dfc8a51f6f63fcd74df982178a9aeab322"}}, + {ref,"5d46291a6bfcee0bae2a9346a7d927603a909249"}}, 0}, {<<"woody_user_identity">>, {git,"https://github.com/valitydev/woody_erlang_user_identity.git", @@ -100,35 +116,55 @@ 0}]}. [ {pkg_hash,[ + {<<"acceptor_pool">>, <<"43C20D2ACAE35F0C2BCD64F9D2BDE267E459F0F3FD23DAB26485BF518C281B21">>}, {<<"cache">>, <<"B23A5FE7095445A88412A6E614C933377E0137B44FFED77C9B3FEF1A731A20B2">>}, {<<"certifi">>, <<"DBAB8E5E155A0763EEA978C913CA280A6B544BFA115633FA20249C3D396D9493">>}, + {<<"chatterbox">>, <<"6F059D97BCAA758B8EA6FFFE2B3B81362BD06B639D3EA2BB088335511D691EBF">>}, {<<"cowboy">>, <<"865DD8B6607E14CF03282E10E934023A1BD8BE6F6BACF921A7E2A96D800CD452">>}, {<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>}, + {<<"ctx">>, <<"8FF88B70E6400C4DF90142E7F130625B82086077A45364A78D208ED3ED53C7FE">>}, {<<"email_validator">>, <<"7E09A862E9AA99AE2CA6FD2A718D2B94360E32940A1339B53DFEE6B774BCDB03">>}, {<<"gproc">>, <<"853CCB7805E9ADA25D227A157BA966F7B34508F386A3E7E21992B1B484230699">>}, + {<<"grpcbox">>, <<"B83F37C62D6EECA347B77F9B1EC7E9F62231690CDFEB3A31BE07CD4002BA9C82">>}, {<<"hackney">>, <<"99DA4674592504D3FB0CFEF0DB84C3BA02B4508BAE2DFF8C0108BAA0D6E0977C">>}, + {<<"hpack">>, <<"17670F83FF984AE6CD74B1C456EDDE906D27FF013740EE4D9EFAA4F1BF999633">>}, {<<"idna">>, <<"8A63070E9F7D0C62EB9D9FCB360A7DE382448200FBBD1B106CC96D3D8099DF8D">>}, {<<"jsx">>, <<"D12516BAA0BB23A59BB35DCCAF02A1BD08243FCBB9EFE24F2D9D056CCFF71268">>}, {<<"metrics">>, <<"25F094DEA2CDA98213CECC3AEFF09E940299D950904393B2A29D191C346A8486">>}, {<<"mimerl">>, <<"67E2D3F571088D5CFD3E550C383094B47159F3EEE8FFA08E64106CDF5E981BE3">>}, + {<<"opentelemetry">>, <<"988AC3C26ACAC9720A1D4FB8D9DC52E95B45ECFEC2D5B5583276A09E8936BC5E">>}, + {<<"opentelemetry_api">>, <<"7B69ED4F40025C005DE0B74FCE8C0549625D59CB4DF12D15C32FE6DC5076FF42">>}, + {<<"opentelemetry_exporter">>, <<"1D8809C0D4F4ACF986405F7700ED11992BCBDB6A4915DD11921E80777FFA7167">>}, + {<<"opentelemetry_semantic_conventions">>, <<"B67FE459C2938FCAB341CB0951C44860C62347C005ACE1B50F8402576F241435">>}, {<<"parse_trans">>, <<"6E6AA8167CB44CC8F39441D05193BE6E6F4E7C2946CB2759F015F8C56B76E5FF">>}, {<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>}, {<<"ssl_verify_fun">>, <<"CF344F5692C82D2CD7554F5EC8FD961548D4FD09E7D22F5B62482E5AEAEBD4B0">>}, + {<<"tls_certificate_check">>, <<"C76C4C5D79EE79A2B11C84F910C825D6F024A78427C854F515748E9BD025E987">>}, {<<"unicode_util_compat">>, <<"BC84380C9AB48177092F43AC89E4DFA2C6D62B40B8BD132B1059ECC7232F9A78">>}]}, {pkg_hash_ext,[ + {<<"acceptor_pool">>, <<"0CBCD83FDC8B9AD2EEE2067EF8B91A14858A5883CB7CD800E6FCD5803E158788">>}, {<<"cache">>, <<"44516CE6FA03594D3A2AF025DD3A87BFE711000EB730219E1DDEFC816E0AA2F4">>}, {<<"certifi">>, <<"524C97B4991B3849DD5C17A631223896272C6B0AF446778BA4675A1DFF53BB7E">>}, + {<<"chatterbox">>, <<"B93D19104D86AF0B3F2566C4CBA2A57D2E06D103728246BA1AC6C3C0FF010AA7">>}, {<<"cowboy">>, <<"2C729F934B4E1AA149AFF882F57C6372C15399A20D54F65C8D67BEF583021BDE">>}, {<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>}, + {<<"ctx">>, <<"A14ED2D1B67723DBEBBE423B28D7615EB0BDCBA6FF28F2D1F1B0A7E1D4AA5FC2">>}, {<<"email_validator">>, <<"2B1E6DF7BB14155C8D7D131F1C95CF4676200BC056EEBA82123396833FF94DA2">>}, {<<"gproc">>, <<"587E8AF698CCD3504CF4BA8D90F893EDE2B0F58CABB8A916E2BF9321DE3CF10B">>}, + {<<"grpcbox">>, <<"294DF743AE20A7E030889F00644001370A4F7CE0121F3BBDAF13CF3169C62913">>}, {<<"hackney">>, <<"DE16FF4996556C8548D512F4DBE22DD58A587BF3332E7FD362430A7EF3986B16">>}, + {<<"hpack">>, <<"06F580167C4B8B8A6429040DF36CC93BBA6D571FAEAEC1B28816523379CBB23A">>}, {<<"idna">>, <<"92376EB7894412ED19AC475E4A86F7B413C1B9FBB5BD16DCCD57934157944CEA">>}, {<<"jsx">>, <<"0C5CC8FDC11B53CC25CF65AC6705AD39E54ECC56D1C22E4ADB8F5A53FB9427F3">>}, {<<"metrics">>, <<"69B09ADDDC4F74A40716AE54D140F93BEB0FB8978D8636EADED0C31B6F099F16">>}, {<<"mimerl">>, <<"F278585650AA581986264638EBF698F8BB19DF297F66AD91B18910DFC6E19323">>}, + {<<"opentelemetry">>, <<"8E09EDC26AAD11161509D7ECAD854A3285D88580F93B63B0B1CF0BAC332BFCC0">>}, + {<<"opentelemetry_api">>, <<"6D7A27B7CAD2AD69A09CABF6670514CAFCEC717C8441BEB5C96322BAC3D05350">>}, + {<<"opentelemetry_exporter">>, <<"2B40007F509D38361744882FD060A8841AF772AB83BB542AA5350908B303AD65">>}, + {<<"opentelemetry_semantic_conventions">>, <<"D61FA1F5639EE8668D74B527E6806E0503EFC55A42DB7B5F39939D84C07D6895">>}, {<<"parse_trans">>, <<"620A406CE75DADA827B82E453C19CF06776BE266F5A67CFF34E1EF2CBB60E49A">>}, {<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>}, {<<"ssl_verify_fun">>, <<"BDB0D2471F453C88FF3908E7686F86F9BE327D065CC1EC16FA4540197EA04680">>}, + {<<"tls_certificate_check">>, <<"4083B4A298ADD534C96125337CB01161C358BB32DD870D5A893AAE685FD91D70">>}, {<<"unicode_util_compat">>, <<"25EEE6D67DF61960CF6A794239566599B09E17E668D3700247BC498638152521">>}]} ]. diff --git a/test/machinegun/config.yaml b/test/machinegun/config.yaml index a01c5d3..3afa56d 100644 --- a/test/machinegun/config.yaml +++ b/test/machinegun/config.yaml @@ -8,3 +8,13 @@ namespaces: url: http://url-shortener:8022/v1/stateproc storage: type: memory + +logging: + out_type: stdout + level: info + +opentelemetry: + service_name: machinegun + exporter: + protocol: http/protobuf + endpoint: http://jaeger:4318