TimelessMetricsDashboard.DefaultMetrics (timeless_metrics_dashboard v0.4.3)

Copy Markdown View Source

Pre-built Telemetry.Metrics definitions for common BEAM/Phoenix/Ecto/Timeless events.

These return standard Telemetry.Metrics structs — you can mix them with your own custom metrics when configuring the reporter.

Example

metrics =
  TimelessMetricsDashboard.DefaultMetrics.vm_metrics() ++
  TimelessMetricsDashboard.DefaultMetrics.phoenix_metrics() ++
  TimelessMetricsDashboard.DefaultMetrics.ecto_metrics("my_app.repo") ++
  TimelessMetricsDashboard.DefaultMetrics.timeless_metrics()

{TimelessMetricsDashboard, store: :metrics, metrics: metrics}

Summary

Functions

Ecto repo metrics.

Phoenix LiveView and LiveComponent metrics.

All non-repo-specific metrics combined: VM, Phoenix, LiveView, and Timeless internals.

Phoenix endpoint, router, channel, and socket metrics.

Timeless internal metrics.

VM metrics emitted by :telemetry_poller.

Functions

ecto_metrics(repo_prefix)

Ecto repo metrics.

Takes the repo event prefix as a string (e.g., "my_app.repo"). Captures query total_time, queue_time, decode_time, and idle_time, tagged by source table.

live_view_metrics()

Phoenix LiveView and LiveComponent metrics.

Captures mount, handle_event, and handle_params durations for LiveViews, plus handle_event for LiveComponents.

metrics()

All non-repo-specific metrics combined: VM, Phoenix, LiveView, and Timeless internals.

This is the default when no :metrics option is passed to TimelessMetricsDashboard.

phoenix_metrics()

Phoenix endpoint, router, channel, and socket metrics.

Captures request duration and count, tagged by method, route, and status. Channel metrics are tagged by channel module and transport.

timeless_metrics()

Timeless internal metrics.

Captures the TSDB's own performance: buffer flushes, segment compression, query latency, rollup duration, HTTP import throughput, and backpressure events.

These let you monitor Timeless itself — the database tracking its own health.

vm_metrics()

VM metrics emitted by :telemetry_poller.

Requires {:telemetry_poller, "~> 1.0"} in your deps and the default poller running (it starts automatically).

Captures memory (total, processes, binary, atom, ets), run queue lengths, and system counts (processes, atoms, ports).