AppSignal - Tips
16 Jan 2019(how to) notify AppSignal of a new deploy
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:
- new deploy marker is not created
- the last deploy is not modified (its deploy date stays the same)
(how to) add Absinthe integration
# 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