Skip to main content

Elixir / BEAM runtime

v0.1.15

Diagnostics for Elixir and Erlang/BEAM applications on the runner host or inside Docker containers: toolchain versions, EPMD registrations, BEAM OS process state, Linux /proc memory and process-tree detail, release RPC snapshots, supervisor/process/ETS/allocator/scheduler/port introspection, rates over a sampling window, the wait graph and deadlocks, orphan candidates, stack samples, binary-leak checks, and bounded tracing of calls and of who floods a mailbox. Releases are discovered from running BEAM processes; target one by release name, or by container for a release inside Docker.

27 allowed by default 2 need approval by default
Pack ID
elixir-beam
Vendor
emisar
OS
linux
Actions
29
Required binaries. Install these binaries on the runner host before using the pack.
erl elixir epmd bash

Install

New to emisar? Follow the quickstart to connect your host and AI agent, then install this pack below. Agents can use its actions through the CLI or MCP.

emisar pack install downloads and checks the pack, then compares its content hash with the --hash below before copying it into the runner's packs directory. The hash identifies the exact pack shown on this page. If the download was changed, the command rejects it. It also reloads a running runner, so you do not need to restart it yourself.

on the runner host
sudo emisar pack install elixir-beam --hash sha256:3b71d9312c1dd2775853ecf841383978bed08efc4e9e83d1905899c88ca7a513

Setup

Inspects Elixir/Erlang runtime state on the runner host and inside Docker containers. No node cookies or application credentials are needed: release actions go through the release's own bin/RELEASE_NAME control script, discovered from the running BEAM process (start with beam.release_targets).

Environment

Set these on the runner host, then add each name to execution.inherit_env so the value reaches the action.

  • ELIXIR_RELEASE_CTL

    Optional override pinning the release control script path, for example /opt/my_app/bin/my_app (with a container argument, the path inside the container). Only needed when discovery cannot see the release; add it to the runner's inherit_env . The release argument takes precedence over it; a container argument does not, and only makes the override a path inside that container.

Host access

Copy these setup commands and run them yourself on the runner host.

Inspect protected process state owned by another user.

beam.process_statusbeam.process_limitsbeam.process_memorybeam.process_tree

Grant process-inspection capabilities to the Emisar service

Grant access
sudo install -d -m 0755 /etc/systemd/system/emisar.service.d
sudo rm -f /etc/systemd/system/emisar.service.d/10-elixir-beam-host-access.conf
printf '%s\n' '[Service]' 'AmbientCapabilities=CAP_SYS_PTRACE CAP_DAC_READ_SEARCH' | sudo tee /etc/systemd/system/emisar.service.d/20-elixir-beam-process-inspection.conf >/dev/null
sudo systemctl daemon-reload
sudo systemctl restart emisar
Verify access
systemctl show emisar --property=AmbientCapabilities --value | grep -Fwi cap_sys_ptrace
systemctl show emisar --property=AmbientCapabilities --value | grep -Fwi cap_dac_read_search

Impact: Every Emisar action on this runner can inspect, attach to, and modify processes outside the runner user, and bypass host file read and directory search permissions.

Reach another user's host release control files or the Docker daemon for a containerized release.

beam.release_targetsbeam.release_pidbeam.release_runtimebeam.release_memorybeam.release_applicationsbeam.release_debug_toolsbeam.release_registeredbeam.release_top_processesbeam.release_process_infobeam.release_supervisor_treebeam.release_ets_tablesbeam.release_allocatorsbeam.release_binary_leakbeam.release_scheduler_usagebeam.release_portsbeam.release_wait_graphbeam.release_orphansbeam.release_process_stacksbeam.release_mailbox_sendersbeam.recon_trace_callsbeam.recon_trace_clear

Run the Emisar service as root for host releases

Grant access
sudo install -d -m 0755 /etc/systemd/system/emisar.service.d
sudo rm -f /etc/systemd/system/emisar.service.d/10-elixir-beam-host-access.conf
printf '%s\n' '[Service]' 'User=root' 'Group=root' | sudo tee /etc/systemd/system/emisar.service.d/30-elixir-beam-host-release.conf >/dev/null
sudo systemctl daemon-reload
sudo systemctl restart emisar
Verify access
test "$(systemctl show emisar --property=User --value)" = root

Impact: Every Emisar action on this runner executes as root and can read or change any host file, process, secret, and kernel or service state. Release RPC can inspect and change the selected application's runtime state.

Add the Emisar service user to the docker group for containerized releases

Grant access
sudo rm -f /etc/systemd/system/emisar.service.d/10-elixir-beam-host-access.conf
sudo rm -f /etc/systemd/system/emisar.service.d/30-elixir-beam-host-release.conf
sudo systemctl daemon-reload
sudo usermod -aG docker emisar
sudo systemctl restart emisar
Verify access
test "$(systemctl show emisar --property=User --value)" = emisar
id -nG emisar | tr ' ' '\n' | grep -Fx docker
sudo -u emisar docker info >/dev/null

Impact: Every process running as emisar can control Docker. Docker socket access is effectively root-equivalent because containers can mount and write the host.

Notes

  • Release actions discover running releases from BEAM process command lines and only ever execute <release_root>/bin/<release_name> of a release that is already running — callers select among live releases but cannot point actions at arbitrary binaries.
  • When several releases run on one target, pass the release argument (names come from beam.release_targets). For a release inside Docker, pass the container argument.
  • For a host release, or a runner that diagnoses both host and rootful-Docker releases, apply only the root host-release recipe. For a container-only runner, apply only the Docker-socket recipe; it removes this pack's root override and restores the service's configured emisar user.
  • Release RPC actions execute fixed, pack-authored expressions only; callers cannot supply arbitrary Elixir code.
  • Each release read runs on the node in a low-priority worker with a deadline and a 256 MiB heap limit, because stopping the rpc client does not stop work on the node. A read that passes either limit fails and says so.
  • Each release action starts a short-lived client node, and the target keeps one atom per client name for the life of the node. The default atom limit is about a million, so avoid polling these actions in a tight loop.
  • If the release control script evaluates runtime config during rpc, the runner service must inherit the same runtime env the release script needs, or those actions will fail before connecting. With the container argument this usually just works: docker exec runs with the container's configured environment.
  • beam.release_pid reports the PID inside the container's namespace when container is set, not the host PID (find the host PID with beam.processes).
  • The recon-powered actions (allocators, binary_leak, scheduler_usage, recon_trace) need recon compiled into the release and fail with a clear message otherwise; check with beam.release_debug_tools. The recon_trace action is high-risk because tracing adds runtime overhead and can expose function arguments or return values when explicitly enabled.
  • beam.release_mailbox_senders needs OTP 27 or newer and no recon. It is high-risk because send tracing adds work to every message sent on the node while it runs.
  • There is deliberately no action launching the interactive observer_cli TUI; its dashboards are covered by the release_* snapshot actions (top_processes, ets_tables, allocators, scheduler_usage, ports, memory).

Verify it works

Runs beam.release_targets, a low-risk read that confirms the pack can reach its target. Run it on the host once the pack is installed; pack install runs it for you.

on the runner host
sudo emisar pack verify elixir-beam

Install and configure a pack walks through the whole sequence on a host.

Actions 29 total

View on GitHub
  • beam.elixir_version exec low Low: read-only or trivially reversible

    elixir --version

    Show the installed Elixir and Erlang/OTP versions.

    Link to this action View source on GitHub
  • beam.epmd_names exec low Low: read-only or trivially reversible

    epmd -names

    List Erlang nodes registered with the local EPMD daemon.

    Link to this action View source on GitHub
  • beam.erl_system_version exec low Low: read-only or trivially reversible

    Erlang/OTP system version

    Show the installed Erlang/OTP system version.

    Link to this action View source on GitHub
  • beam.process_limits exec low Low: read-only or trivially reversible

    BEAM process limits

    Show Linux resource limits for a BEAM process.

    Arguments
    Name Type Required
    pid integer Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.process_memory script low Low: read-only or trivially reversible

    BEAM process memory summary

    Show Linux /proc memory, fd, thread, and mapping counts for a BEAM process.

    Arguments
    Name Type Required
    pid integer Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.process_status exec low Low: read-only or trivially reversible

    BEAM /proc status summary

    Show selected /proc/PID/status fields for a BEAM process.

    Arguments
    Name Type Required
    pid integer Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.process_tree script low Low: read-only or trivially reversible

    BEAM process tree

    Show ancestors and descendants for a BEAM OS process without command-line arguments.

    Arguments
    Name Type Required
    pid integer Yes

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.processes exec low Low: read-only or trivially reversible

    BEAM process list

    List BEAM and Elixir OS processes on the runner host.

    Link to this action View source on GitHub
  • beam.recon_trace_calls script high High: can disrupt service

    Bounded recon_trace call capture

    Trace calls to one existing module/function in the running Elixir release for a bounded time window; tracing adds load while active, and the include_args / include_return flags copy raw arguments and returns — routinely secret-bearing — into the recorded output. Sees calls made through the module name, such as GenServer callbacks, and not a function calling another in its own module.

    Arguments
    Name Type Required
    module string Yes
    function string Yes
    arity integer Yes
    max_traces integer No
    duration_ms integer No
    pid_scope string No
    include_args boolean No
    include_return boolean No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.recon_trace_clear script medium Medium: changes state, easily reversible

    Clear recon_trace tracing

    Stop all recon_trace tracing in the running Elixir release.

    Arguments
    Name Type Required
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_allocators script low Low: read-only or trivially reversible

    Elixir release memory allocators

    Show BEAM memory allocator utilization for the running Elixir release with recon_alloc — allocated vs used bytes, the usage ratio, and a per-allocator breakdown for fragmentation analysis. Requires recon in the release (check with beam.release_debug_tools).

    Arguments
    Name Type Required
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_applications script low Low: read-only or trivially reversible

    Elixir release applications

    List started OTP applications in the running Elixir release.

    Arguments
    Name Type Required
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_binary_leak script medium Medium: changes state, easily reversible

    Elixir release binary leak check

    Check the running Elixir release for refc binary leaks with recon bin_leak — garbage-collects every process and reports which freed the most binary references. Requires recon in the release (check with beam.release_debug_tools).

    Arguments
    Name Type Required
    limit integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_debug_tools script low Low: read-only or trivially reversible

    Elixir release debug tools

    Check whether recon, recon_trace, and observer_cli modules are available in the running release.

    Arguments
    Name Type Required
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_ets_tables script low Low: read-only or trivially reversible

    Elixir release ETS tables

    List ETS tables in the running Elixir release sorted by memory or row count, with the name of each owner, type, and a total-usage summary.

    Arguments
    Name Type Required
    limit integer No
    sort_by string No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_mailbox_senders script high High: can disrupt service

    Elixir release mailbox senders

    Trace who sends messages to one BEAM process for a bounded window and show the senders with their message counts, to find what floods a mailbox. Needs OTP 27 or newer, which traces in an isolated session that cannot disturb other tracing. High risk because send tracing adds work to every message sent on the node while it runs. Sees processes on this node that address the target by pid or registered name, and the ports it owns when the trace starts. Messages from other nodes, from timers, or through an alias do not appear.

    Arguments
    Name Type Required
    erlang_pid string Yes
    duration_ms integer No
    max_events integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_memory script low Low: read-only or trivially reversible

    Elixir release memory snapshot

    Show BEAM memory categories and core counts from the running Elixir release.

    Arguments
    Name Type Required
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_orphans script low Low: read-only or trivially reversible

    Elixir release orphan processes

    List candidate orphan processes in the running Elixir release, largest first: processes nothing links to, monitors, or is monitored by, so nothing notices if one dies and nothing restarts it. Legitimate processes can match, so each is a candidate to look at rather than a fault. The runtime system's own processes are left out.

    Arguments
    Name Type Required
    limit integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_pid script low Low: read-only or trivially reversible

    Elixir release OS PID

    Show the OS PID of the running Elixir release (the PID inside the container's namespace when container is set).

    Arguments
    Name Type Required
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_ports script low Low: read-only or trivially reversible

    Elixir release BEAM ports

    Count open BEAM ports in the running Elixir release by driver and by owning process, with bytes read, written, and queued, and list the sockets with bytes waiting to be written with their local and peer addresses. Spot socket or port leaks and writes that cannot keep up. A spawned program is counted under its executable's base name. Sockets from the NIF-based :socket module are not ports and do not appear.

    Arguments
    Name Type Required
    limit integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_process_info script low Low: read-only or trivially reversible

    Elixir release process info

    Show selected process_info fields for one BEAM PID in the running release, with what it runs, what started it, its current stack as function names, and the binary memory it holds.

    Arguments
    Name Type Required
    erlang_pid string Yes
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_process_stacks script low Low: read-only or trivially reversible

    Elixir release process stack samples

    Sample where one BEAM process is, repeatedly, and show the stacks it was seen in most often with how many samples were running or waiting. Find which call a busy or stuck GenServer is in, without tracing. A sample counts a blocked process the same as a running one, so this shows where time passes, not CPU use.

    Arguments
    Name Type Required
    erlang_pid string Yes
    samples integer No
    interval_ms integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_registered script low Low: read-only or trivially reversible

    Elixir release registered processes

    List registered processes in the running Elixir release with lightweight process info, in name order, and say how many exist beyond the limit.

    Arguments
    Name Type Required
    limit integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_runtime script low Low: read-only or trivially reversible

    Elixir release runtime snapshot

    Show a BEAM runtime snapshot from the running Elixir release.

    Arguments
    Name Type Required
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_scheduler_usage script low Low: read-only or trivially reversible

    Elixir release scheduler usage

    Show per-scheduler utilization of the running Elixir release sampled over a bounded window with recon scheduler_usage — the accurate BEAM CPU picture, unlike OS-level CPU of busy-waiting schedulers. Requires recon in the release (check with beam.release_debug_tools).

    Arguments
    Name Type Required
    sample_ms integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_supervisor_tree script low Low: read-only or trivially reversible

    Elixir release supervisor tree

    Show a bounded supervisor subtree from the running Elixir release: each child's id, type, and pid, with a count of how many children each supervisor has. A supervisor that does not answer within a second shows as unreachable, with the kind of failure, and one with more children than limit shows only its count. A child pid that changes between two reads is a child that is restarting.

    Arguments
    Name Type Required
    registered_name string Yes
    depth integer No
    limit integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_targets script low Low: read-only or trivially reversible

    Debuggable Elixir releases

    List running Elixir releases on the runner host and inside running Docker containers, with the release and container values to pass to the other beam.release_* actions.

    Arguments
    Name Type Required
    container string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_top_processes script low Low: read-only or trivially reversible

    Elixir release top BEAM processes

    List top BEAM processes in the running release by memory, mailbox length, binary memory, heap size, or the work done over a sampling window, and show what each unnamed process runs. A single read shows how much, not how fast, so reductions are always sampled, and window_ms ranks any other metric by how much it changed. Sorting by memory or binary_memory costs the most on a node with many processes; reductions and message_queue_len are the cheap scans.

    Arguments
    Name Type Required
    limit integer No
    sort_by string No
    window_ms integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub
  • beam.release_wait_graph script low Low: read-only or trivially reversible

    Elixir release wait graph

    Show which BEAM processes are blocked in a GenServer call and what they wait on: the targets with the most waiters, what each target is doing, and any deadlock cycles, with no limit on their length. A caller holding exactly one monitor gives an edge. A caller holding several, or a process in Task.await, is listed with its candidates and counts toward no target or cycle, because monitors do not say which one it waits for, so a cycle through such a process does not appear.

    Arguments
    Name Type Required
    limit integer No
    container string No
    release string No

    See the action source for defaults, validation, and limits.

    Link to this action View source on GitHub