AppSignal - Tips


(how to) notify AppSignal of a new deploy

  1. https://docs.appsignal.com/application/markers/deploy-markers.html#config-option

add revision config option:

  # config/appsignal.exs

  config :appsignal, :config,
    active: true,
-   name: "MyApp"
+   name: "MyApp",
+   revision: Mix.Project.config()[:version]

NOTE: don’t forget to update project version in mix.exs.

deploying release with the same version has no effect:

(how to) add Absinthe integration

  1. https://docs.appsignal.com/elixir/integrations/absinthe.html
# lib/my_app_web/plugs/appsignal_absinthe_plug.ex

defmodule MyAppWeb.Plugs.AppsignalAbsinthePlug do
  def init(opts), do: opts

  @path "/api"
  def call(%Plug.Conn{request_path: @path, method: "POST"} = conn, _opts) do
    Appsignal.Transaction.set_action("POST " <> @path)
    conn
  end

  def call(conn, _), do: conn
end
# lib/my_app_web/router.ex

defmodule MyAppWeb.Router do
  use MyAppWeb, :router

  pipeline :api do
    plug :accepts, ["json"]
    plug MyAppWeb.Plugs.AppsignalAbsinthePlug
  end

  # ...
end