LiveDashboard v0.2.1 Phoenix.LiveDashboard.Router View Source

Provides LiveView routing for LiveDashboard.

Link to this section Summary

Functions

Defines a LiveDashboard route.

Link to this section Functions

Link to this macro

live_dashboard(path, opts \\ [])

View Source (macro)

Defines a LiveDashboard route.

It expects the path the dashboard will be mounted at and a set of options.

Options

  • :metrics - Configures the module to retrieve metrics from. It can be a module or a {module, function}. If nothing is given, the metrics functionality will be disabled.

Examples

defmodule MyAppWeb.Router do
  use Phoenix.Router
  import Phoenix.LiveDashboard.Router

  scope "/", MyAppWeb do
    pipe_through [:browser]
    live_dashboard "/dashboard", metrics: {MyAppWeb.Telemetry, :metrics}
  end
end