Skip to content

Commit

Permalink
Fix dializyer complaint about trace_info
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryseed committed Jan 9, 2025
1 parent adcb939 commit ce499ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 8 additions & 2 deletions lib/new_relic/tracer/macro.ex
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,14 @@ defmodule NewRelic.Tracer.Macro do
end

def traced_function_body(body, module, function, args, trace_info) do
trace_annotation =
case trace_info do
{name, options} -> {name, options}
name -> {name, []}
end

quote do
with {_, opts} <- unquote(trace_info),
with {_, opts} <- unquote(trace_annotation),
:external <- Keyword.get(opts, :category) do
Process.put(:nr_already_tracing_external, true)
end
Expand Down Expand Up @@ -231,7 +237,7 @@ defmodule NewRelic.Tracer.Macro do

Tracer.Report.call(
{unquote(module), unquote(function), unquote(build_call_args(args))},
unquote(trace_info),
unquote(trace_annotation),
inspect(self()),
{span, previous_span || :root},
{start_time, start_time_mono, end_time_mono, child_duration_ms, reductions}
Expand Down
7 changes: 1 addition & 6 deletions lib/new_relic/tracer/report.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ defmodule NewRelic.Tracer.Report do
edge,
timing
) do
{name, options} =
case trace_annotation do
{name, options} -> {name, options}
name -> {name, []}
end

{name, options} = trace_annotation
category = Keyword.get(options, :category, :function)

report(
Expand Down

0 comments on commit ce499ec

Please sign in to comment.