After testing the new version of AppSignal for Elixir for a couple of weeks, we're happy to announce we've just released version 1.3 of our Elixir integration. The new version brings support for pure Plug applications, and a lot of other improvements.
To upgrade to the new version, simply run
mix deps.update appsignal, and you're good to go!
We've always had full support for Phoenix out of the box, but using AppSignal in Plug apps required some manual setup. In version 1.3, we've added
Appsignal.Plug, a new Plug handler which takes care of recording web transactions.
Appsignal.Phoenix.Instrumenter will continue to record instrumentation for Phoenix apps, like it did before. This means our Plug support is now the basis of our Phoenix integration.
Appsignal.Plug to your Plug app will automatically start and stop transactions. Setting up instrumentation for specific functions in your app can be done using our decorators. An example Plug application that has instrumentation for a slow function might look like this:
1defmodule AppsignalPlugExample do 2 use Plug.Router 3 use Appsignal.Instrumentation.Decorators 4 5 plug :match 6 plug :dispatch 7 8 get "/" do 9 slow() 10 send_resp(conn, 200, "Welcome") 11 end 12 13 @decorate transaction_event() 14 defp slow do 15 :timer.sleep(1000) 16 end 17 18 use Appsignal.Plug 19end
- We've added a request header white list to only receive the data we need. Of course, you can still use tagging to add more data to your samples.
- Previously, we put samples from Phoenix channels in the "background" namespace. We added a new namespace named "channels", which will host this data from now on.
- Besides ignoring actions and errors, you can now ignore namespaces. More information about ignoring namespaces can be found in our documentation.