<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>As I understand it, the problem at hand is about identifying
processes in observer or while debugging and not so much an Erlang
/ OTP issue. In my opinion, one should add functionality to the
observer to display a particular process attribute (your
non-unique process label) instead of or alongside the pid. Making
changes to the observer is not very hard and may be a nice
addition to its functionality. The process status tab in the
observer's interface is a logical place but adding or replacing
pids in the application view probably is what tou really want and
which isn't very difficult either. It may look something like if
attribute is defined then display attribute else display pid. The
attribute also can be used while tracing or what ever. <br>
</p>
<p>In logging, adding this non-unique process label isn't very hard
either (see <a moz-do-not-send="true"
href="https://erlang.org/doc/apps/kernel/logger_chapter.html#metadata">logger
metadata</a>)<br>
</p>
<p>BR</p>
<p>Frans<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 5/7/21 9:49 AM, Stanislav Ledenev
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOkK=A+w0fh1hVPYFQjBAaAWQTXLLgZb4B5MgoOQ-0mLpnsj6A@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">Sorry I've misread your message. My first question
is irrelevant. <br>
Could you explain in more details why you need that?<br>
In my experience I try to give names to every *long-living*
process I start (except for "simple_one_for_one" for obvious
reasons).
<div>For the short-living processes, when needed for debugging,
I give internal Ids (like UUID) to be printed to logs.<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">чт, 6 мая 2021 г. в 19:55,
Nathan Long <<a href="mailto:him@nathanmlong.com"
moz-do-not-send="true">him@nathanmlong.com</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>Is there a way to add a non-unique label to a process?
If not, I would like to propose that it be added.<br>
<br>
The label could be shown with or instead of a PID. I think
this would be useful in at least two areas.<br>
<br>
First, when observing a running system, the PID is not
descriptive. I have Observer open right now looking at
part of my system, and I can see one globally registered
process name displayed, but everything else is a PID. What
are those processes? I might be able to figure it out by
clicking the process and seeing what its initial call was,
but often I can tell is "it's a GenServer." The structure
of the system would be much more apparent if I saw labels
like "db_connection" or "request_queue_worker".<br>
<br>
Second, when reading error messages in logs or an
exception tracker, the PID is not useful. For example, I'm
looking at an error in Sentry right now that says
"Sentry.CrashError error ** (exit) 'stopping because
dependent process <0.2255.0> died: killed'". I have
no idea what `<0.2555.0>` was, so I don't know what
to debug.<br>
<br>
Does this exist or would others support it being added to
the BEAM?<br>
<br>
</div>
-- Nathan<br>
</div>
</blockquote>
</div>
</blockquote>
</body>
</html>