Skip to content

Commit

Permalink
fix: better span name for gen_lb call
Browse files Browse the repository at this point in the history
  • Loading branch information
chsukivra committed May 14, 2024
1 parent ade24eb commit 2315c52
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gen_lb.erl
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,19 @@ call(Ref, Args) ->
call(Ref, Args, []).

call(Ref, Args, Options0) ->
SpanName = case Ref of
_ when is_atom(Ref) ->
iolist_to_binary([<<"gen_lb call ">>, atom_to_binary(Ref)]);
_ ->
<<"gen_lb call">>
end,
StartOpts = #{ attributes => #{},
links => [],
is_recording => true,
start_time => opentelemetry:timestamp(),
kind => ?SPAN_KIND_INTERNAL
},
?with_span(gen_lb, StartOpts,
?with_span(SpanName, StartOpts,
fun (_SpanCtx) ->
Ctx = otel_ctx:get_current(),
Options = [{otel_ctx, Ctx}] ++ Options0,
Expand Down

0 comments on commit 2315c52

Please sign in to comment.