Skip to content

Commit

Permalink
chore: refine ErlSysMon logging (#2135)
Browse files Browse the repository at this point in the history
* chore: fix flaky schema check

* Revert "fix: reduce exit trapping and error logging on supervision tree termination"

This reverts commit e2fb447.

* chore: resolve flaky tests, remove unnecessary exit trapping

* chore: refine ErlSysMon logging
  • Loading branch information
Ziinc authored Jul 10, 2024
1 parent c692106 commit 08ce873
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/logflare/erl_sys_mon.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,20 @@ defmodule Logflare.ErlSysMon do
{:ok, []}
end

def handle_info(msg, state) do
def handle_info({:monitor, pid, _type, _meta} = msg, state) do
pid_info =
case msg do
{:monitor, pid, _type, _meta} ->
Process.info(pid, [:dictionary])
pid
|> Process.info(:dictionary)
|> case do
{:dictionary, dict} when is_list(dict) ->
Keyword.take(dict, [:"$ancestors", :"$initial_call"])

other ->
other
end

Logger.warning(
"#{__MODULE__} message: " <> inspect(msg) <> " | process info: #{inspect(pid_info)}"
"#{__MODULE__} message: " <> inspect(msg) <> "|\n process info: #{inspect(pid_info)}"
)

{:noreply, state}
Expand Down

0 comments on commit 08ce873

Please sign in to comment.