Skip to content

Commit 23ee82a

Browse files
committed
Add helper function for Datadog pids
1 parent 18e2edf commit 23ee82a

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/sequin/databases_runtime/slot_message_store.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ defmodule Sequin.DatabasesRuntime.SlotMessageStore do
685685
end
686686

687687
defp exit_to_sequin_error({:noproc, _}) do
688-
Error.invariant(message: "[SlotMessageStore] exited with :noproc")
688+
Error.invariant(message: "Call to SlotMessageStore failed with :noproc")
689689
end
690690

691691
defp exit_to_sequin_error(e) when is_exception(e) do

lib/sequin/iex_helpers.ex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,17 @@ defmodule Sequin.IexHelpers do
9292
whereis(:sink, id)
9393
end
9494
end
95+
96+
# pids in datadog look like this:
97+
# #PID<0.30653.0>
98+
def dd_pid(pid) do
99+
[p1, p2, p3] =
100+
pid
101+
|> String.trim_leading("#PID<")
102+
|> String.trim_trailing(">")
103+
|> String.split(".")
104+
|> Enum.map(&String.to_integer/1)
105+
106+
:c.pid(p1, p2, p3)
107+
end
95108
end

0 commit comments

Comments
 (0)