Skip to content

Commit

Permalink
Don't compile in direct calls to callback functions
Browse files Browse the repository at this point in the history
  • Loading branch information
GregMefford committed Oct 11, 2018
1 parent 590e695 commit 801da6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/spandex_phoenix/instrumenter.ex
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ defmodule SpandexPhoenix.Instrumenter do
def phoenix_controller_call(:start, _compiled_meta, %{conn: conn}) do
controller = Phoenix.Controller.controller_module(conn)
action = Phoenix.Controller.action_name(conn)
@tracer.start_span("Phoenix.Controller", resource: "#{controller}.#{action}")
apply(@tracer, :start_span, ["Phoenix.Controller", [resource: "#{controller}.#{action}"]])
end

def phoenix_controller_call(:stop, _time_diff, _start_meta) do
@tracer.finish_span()
apply(@tracer, :finish_span, [])
end

def phoenix_controller_render(:start, _compiled_meta, %{view: view}) do
@tracer.start_span("Phoenix.View", resource: view)
apply(@tracer, :start_span, ["Phoenix.View", [resource: view]])
end

def phoenix_controller_render(:stop, _time_diff, _start_meta) do
@tracer.finish_span()
apply(@tracer, :finish_span, [])
end
end

0 comments on commit 801da6b

Please sign in to comment.