Host-router macros for mounting Cairnloop's operator surfaces.
Cairnloop is host-owned: you mount its operations endpoints and operator dashboard into
your router, under your pipelines, so auth, session, layout, and route placement stay
yours. See cairnloop_operations/1 and cairnloop_dashboard/2.
Summary
Functions
Mounts the Cairnloop operator dashboard (inbox, conversations, knowledge base, settings, and
the audit-log timeline) under path as a single Phoenix.LiveView live_session.
Mounts the operations endpoints a host needs for monitoring (OPS-01, OPS-02)
Functions
Mounts the Cairnloop operator dashboard (inbox, conversations, knowledge base, settings, and
the audit-log timeline) under path as a single Phoenix.LiveView live_session.
Wrap it in your own scope so auth/session/layout stay host-owned — Cairnloop does not embed
auth:
scope "/support" do
pipe_through [:browser, :require_admin]
cairnloop_dashboard "/",
session: %{"host_user_id" => "demo_operator"},
on_mount: [{MyAppWeb.UserAuth, :ensure_admin}]
endAny option other than the Cairnloop-specific ones below is forwarded verbatim to
Phoenix.LiveView.Router.live_session/3 (e.g. :session, :on_mount, :root_layout,
:layout).
Options
:live_session_name(atom/0) - Name of the generatedlive_session. Override when mounting the dashboard more than once in a single host router, so the twolive_sessionnames do not collide. The default value is:cairnloop_dashboard.
Mounts the operations endpoints a host needs for monitoring (OPS-01, OPS-02):
GET /health→Cairnloop.Web.HealthPlug(liveness/readiness probe, 200 JSON).GET /metrics→Cairnloop.Web.MetricsPlug(Prometheus text; 501 until:telemetry_metrics_prometheus_coreis added).
Call it from your host router, typically outside any authentication pipeline so infrastructure can reach the probes:
scope "/" do
cairnloop_operations()
endOptions
:health_path(String.t/0) - Path the/healthliveness probe is mounted at. The default value is"/health".:metrics_path(String.t/0) - Path the/metricsPrometheus scrape endpoint is mounted at. The default value is"/metrics".