ScoutApm.Instruments.LiveViewTelemetry (scout_apm v2.0.0)

Copy Markdown

Telemetry handler for Phoenix LiveView instrumentation.

Attaches to LiveView telemetry events to track:

  • LiveView mounts (as "LiveView" type transactions)
  • handle_event callbacks (as timed layers within transactions)
  • handle_params callbacks (as timed layers within transactions)

Usage

In your application's start/2 function:

def start(_type, _args) do
  ScoutApm.Instruments.LiveViewTelemetry.attach()
  # ... rest of supervision tree
end

This will automatically instrument all LiveView modules in your application.

Summary

Functions

Attaches telemetry handlers for LiveView events.

Detaches the telemetry handlers. Useful for testing.

Functions

attach()

Attaches telemetry handlers for LiveView events.

Call this once during application startup.

detach()

Detaches the telemetry handlers. Useful for testing.

handle_event(arg1, measurements, metadata, config)