Skip to content

Commit

Permalink
feat(otel_log_handler): ensure dependencies are started in `adding_ha…
Browse files Browse the repository at this point in the history
…ndler/1` cb
  • Loading branch information
SergeTupchiy committed Nov 9, 2023
1 parent a084dd2 commit 5862458
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions apps/opentelemetry_experimental/src/otel_log_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ start_link(#{reg_name := RegName} = Config) ->
Config2 :: config_private(),
Reason :: term().
adding_handler(#{id := Id}=Config) ->
ok = start_apps(),
RegName = ?name_to_reg_name(?MODULE, Id),
AtomicRef = atomics:new(3, [{signed, true}]),
Config1 = Config#{reg_name => RegName,
Expand Down Expand Up @@ -374,6 +375,11 @@ terminate(_Reason, State, Data=#data{exporter=Exporter,
%% Internal functions
%%--------------------------------------------------------------------

start_apps() ->
_ = application:ensure_all_started(opentelemetry_exporter),
_ = application:ensure_all_started(opentelemetry_experimental),
ok.

start(Id, Config) ->
ChildSpec =
#{id => Id,
Expand Down
4 changes: 2 additions & 2 deletions rebar.config
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
opentelemetry_zipkin_pb]}.


{dialyzer, [{warnings, [no_unknown]}]}.
%{dialyzer, [{warnings, [no_unknown]}]}.

{cover_enabled, true}.
{cover_export_enabled, true}.
{covertool, [{coverdata_files, ["ct.coverdata"]}]}.
{cover_excl_apps, [opentelemetry_api_experimental, opentelemetry_experimental]}.
%{cover_excl_apps, [opentelemetry_api_experimental, opentelemetry_experimental]}.
{cover_excl_mods, [opentelemetry_exporter_trace_service_pb, opentelemetry_trace_service,
opentelemetry_zipkin_pb, opentelemetry_exporter_metrics_service_pb,
opentelemetry_exporter_logs_service_pb,
Expand Down

0 comments on commit 5862458

Please sign in to comment.