Beamlens.Skill.Tracer (beamlens v0.3.1)

View Source

Production-safe function call tracing powered by Recon.

Provides heavily rate-limited tracing of function calls for debugging without risk of overwhelming the node. Uses the battle-tested Recon library with additional safety layers.

Safety Guarantees

  • Rate limiting: 5 traces per second max (configurable)
  • Message limit: 50 traces before auto-stop (configurable)
  • Time limit: 60 seconds max before auto-stop
  • Blocked hot paths: High-frequency stdlib functions rejected
  • Arity required: Must specify function arity (no wildcards)
  • Process isolation: Tracer runs in separate process

Blocked Functions

The following high-frequency functions are blocked to prevent accidental node overload:

Requirements

Requires the recon package:

{:recon, "~> 2.3"}

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns collected trace events from the current or last session.

Starts a trace session for the given module, function, and arity.

Stops the active trace session.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_traces()

Returns collected trace events from the current or last session.

start_link(opts \\ [])

start_trace(arg)

Starts a trace session for the given module, function, and arity.

Returns {:ok, %{status: :started, matches: count}} on success, or {:error, reason} if validation fails or a trace is already active.

stop_trace()

Stops the active trace session.

Returns {:ok, %{status: :stopped, trace_count: count}}.