ObserverWeb.Ets (Observer Web v0.2.8)

View Source

Lists a node's ETS tables and (optionally) previews their contents - the web equivalent of the observer GUI's Table Viewer and observer_cli's Ets pane.

Table listing delegates to :observer_backend.get_table_list (runtime_tools, already required on every node for :dbg tracing): one RPC round trip returns every table's metadata, regardless of the observer_web version on the observed node.

Content inspection

Table contents are live production data, so previewing them is disabled by default and gated behind an explicit opt-in:

config :observer_web, table_content_inspection: true

Even when enabled, previews are read-only and bounded: at most 50 objects per request, each rendered with inspect limits. Note that the objects are copied from the observed node before truncation - previewing a table whose single objects are huge moves that data over the distribution. Private tables can never be read from another process; their metadata still shows, and the preview reports them as not accessible.

Summary

Functions

Whether table content previews are enabled (see the moduledoc - off by default).

Lists every ETS table on node (including system and private tables - this is an observability tool, hiding them helps nobody).

Reads the first objects of a table (bounded, read-only), rendered as inspected strings.

Types

table()

@type table() :: %{
  name: atom(),
  handle: atom() | reference(),
  protection: :public | :protected | :private,
  owner: pid(),
  owner_label: String.t(),
  size: non_neg_integer(),
  type: atom(),
  memory: non_neg_integer(),
  compressed: boolean()
}

Functions

content_inspection_enabled?()

@spec content_inspection_enabled?() :: boolean()

Whether table content previews are enabled (see the moduledoc - off by default).

list_tables(node)

@spec list_tables(node()) :: {:ok, [table()]} | {:error, term()}

Lists every ETS table on node (including system and private tables - this is an observability tool, hiding them helps nobody).

table_content(node, table_handle)

@spec table_content(node(), atom() | reference()) ::
  {:ok, [String.t()]} | {:error, :content_inspection_disabled | :not_accessible}

Reads the first objects of a table (bounded, read-only), rendered as inspected strings.

Returns {:error, :content_inspection_disabled} unless content inspection is enabled, and {:error, :not_accessible} for private tables (or tables that vanished since listing).