TimelessPhoenix (timeless_phoenix v1.5.9)

Copy Markdown View Source

Unified observability for Phoenix: persistent metrics, logs, and traces in LiveDashboard.

One dep, one child_spec, one router macro.

Quick Start

# 1. Supervision tree (one line)
{TimelessPhoenix, data_dir: "/var/lib/obs"}

# 2. Router (one macro)
import TimelessPhoenix.Router
timeless_phoenix_dashboard("/dashboard")

Child Spec Options

  • :data_dir (required) — base directory; creates metrics/, logs/, spans/ subdirs
  • :name — instance name for process naming (default: :default)
  • :metricsTelemetry.Metrics list for reporter (default: TimelessPhoenix.DefaultMetrics.all())
  • :timeless — extra opts forwarded to TimelessMetrics
  • :timeless_logs — application env overrides for TimelessLogs
  • :timeless_traces — application env overrides for TimelessTraces
  • :reporter — extra opts for Reporter (:flush_interval, :prefix)

Summary

Functions

Returns a child spec that starts all three observability engines + reporter.

Returns additional_pages config for LiveDashboard with all three dashboard pages.

Callback for LiveDashboard's metrics_history option.

Functions

child_spec(opts)

Returns a child spec that starts all three observability engines + reporter.

dashboard_pages(opts \\ [])

Returns additional_pages config for LiveDashboard with all three dashboard pages.

Options

  • :name — instance name (default: :default)
  • :download_path — path to DownloadPlug (default: "/timeless/downloads")

metrics_history(metric, name \\ :default, opts \\ [])

Callback for LiveDashboard's metrics_history option.

Delegates to TimelessMetricsDashboard.metrics_history/3 using the Timeless store name for this instance.

Router Configuration

live_dashboard "/dashboard",
  metrics: MyApp.Telemetry,
  metrics_history: {TimelessPhoenix, :metrics_history, []}

Or with a named instance:

metrics_history: {TimelessPhoenix, :metrics_history, [:my_instance]}