the app server must have been started with elixir --sname appname --cookie mycookie -S mix phoenix.server
connect to the server via ssh
- start an
iex
Session with (important: cookies must match but can be freely chosen, names can be freely chosen too):iex --sname foo --cookie mycookie
foo@host> node = :"appname@host"
# appnames must match
foo@host> Node.connect(node)
# Erlang-top runs until it is stopped
foo@host> Node.spawn(node, fn -> :etop.start end)
# Where x,y,z is taken from the etop output of the wanted process to inspect
foo@host> pid = pid(x,y,z)
# instead of :backtrace you can do other things as described in https://hexdocs.pm/elixir/Process.html#info/2
foo@host> Node.spawn(node, fn -> IO.puts inspect Process.info(pid, :backtrace) end)
# Stop etop
foo@host> Node.spawn(node, fn -> :etop.stop end)
Also, if you have the required libs available you can do a :observer.start
.