AppSignal v0.7.1 Appsignal.Phoenix.Instrumenter

Phoenix instrumentation hooks

This module can be used as a Phoenix instrumentation module. Adding this module to the list of Phoenix instrumenters will result in the phoenix_controller_call and phoenix_controller_render events to become part of your request timeline.

Add this to your config.exs:

config :phoenix_app, PhoenixApp.Endpoint,
  instrumenters: [Appsignal.Phoenix.Instrumenter]

Note: Channels (phoenix_channel_join hook) are currently not supported.

Custom instrumentation events

You might be using your endpoint’s instrument/4 macro to create custom instrumentation. If you want those events to become part of the Appsignal timeline as well, you need to create a custom instrumenter module with the help of Appsignal.Phoenix.InstrumenterDSL:

defmodule PhoenixApp.CustomInstrumenter do

  import Appsignal.Phoenix.InstrumenterDSL
  instrumenter :phoenix_controller_call
  instrumenter :phoenix_controller_render
  instrumenter :custom_event
  instrumenter :another_custom_event
end

And then, use that instead of the Appsignal instrumenter in your config.exs:

config :phoenix_app, PhoenixApp.Endpoint,
  instrumenters: [PhoenixApp.CustomInstrumenter]

See the Phoenix integration guide for information on how to instrument other aspects of Phoenix.