-
-
+---
+interface Props {
+ eyebrow: string;
+ columns?: boolean;
+}
+
+const { eyebrow, columns = false } = Astro.props;
+---
+
+
+ {eyebrow}
+ {Astro.slots.has("capture") &&
}
diff --git a/site/src/components/landing/CopyButton.astro b/site/src/components/landing/CopyButton.astro
new file mode 100644
index 000000000..a85573b83
--- /dev/null
+++ b/site/src/components/landing/CopyButton.astro
@@ -0,0 +1,104 @@
+---
+import Icon from "../Icon.astro";
+
+interface Props {
+ target: string;
+ event?: string;
+}
+
+const { target, event } = Astro.props;
+---
+
+
+
+
+ Copy
+
+
+
+
+
diff --git a/site/src/components/landing/CtaBar.astro b/site/src/components/landing/CtaBar.astro
index 4f4d3af11..97bf82fbc 100644
--- a/site/src/components/landing/CtaBar.astro
+++ b/site/src/components/landing/CtaBar.astro
@@ -15,14 +15,14 @@
* the Clipboard API — so a button that only wrote to the clipboard would take
* over the common path and stop the metric without anything looking broken.
*/
-import Icon from "../Icon.astro";
+import CopyButton from "./CopyButton.astro";
---
-
Install it and point something at it.
+
Install Fanout. Send OpenTelemetry.
- One binary, one data directory. The installer checks the archive against the
- release checksums before it extracts anything.
+ One binary and one data directory. Add an AI provider key to enable the
+ built-in agent.
curl -fsSL https://raw.githubusercontent.com/labstack/fanout/main/scripts/install.sh | sh
-
-
-
- Copy
-
+
+
+ Deployment requirements {" · "}AI configuration {" · "}Storage and retention
+
-
-
diff --git a/site/src/components/landing/Hero.astro b/site/src/components/landing/Hero.astro
index e634515f8..9b74fa9a9 100644
--- a/site/src/components/landing/Hero.astro
+++ b/site/src/components/landing/Hero.astro
@@ -1,6 +1,4 @@
---
-import ThroughputReplay from "./ThroughputReplay.astro";
-
const { data } = Astro.locals.starlightRoute.entry;
const { title = data.title, tagline, actions = [] } = data.hero ?? {};
---
@@ -28,7 +26,6 @@ const { title = data.title, tagline, actions = [] } = data.hero ?? {};
)
}
-
diff --git a/site/src/components/landing/MediaCaption.astro b/site/src/components/landing/MediaCaption.astro
new file mode 100644
index 000000000..7121bfd3f
--- /dev/null
+++ b/site/src/components/landing/MediaCaption.astro
@@ -0,0 +1,34 @@
+---
+interface Props {
+ id?: string;
+ caption: string;
+ light: string;
+ dark: string;
+}
+
+const { id, caption, light, dark } = Astro.props;
+---
+
+
+ {caption}
+
+ View full size
+ View full size
+
+
+
+
+
diff --git a/site/src/components/landing/ProductCapture.astro b/site/src/components/landing/ProductCapture.astro
deleted file mode 100644
index e6f150052..000000000
--- a/site/src/components/landing/ProductCapture.astro
+++ /dev/null
@@ -1,53 +0,0 @@
----
-import { Picture } from "astro:assets";
-import overviewLight from "../../assets/landing/overview-light.png";
-import overviewDark from "../../assets/landing/overview-dark.png";
-import mapLight from "../../assets/landing/service-map-light.png";
-import mapDark from "../../assets/landing/service-map-dark.png";
-import traceLight from "../../assets/landing/trace-light.png";
-import traceDark from "../../assets/landing/trace-dark.png";
-
-interface Props {
- view: "overview" | "service-map" | "trace";
- alt: string;
- eager?: boolean;
-}
-
-const { view, alt, eager = false } = Astro.props;
-const captures = {
- overview: { light: overviewLight, dark: overviewDark },
- "service-map": { light: mapLight, dark: mapDark },
- trace: { light: traceLight, dark: traceDark },
-};
-const capture = captures[view];
-const sizes = "(min-width: 71.5rem) 67.5rem, (min-width: 40rem) calc(100vw - 4rem), calc(100vw - 2rem)";
----
-
-
- {(["light", "dark"] as const).map(theme => (
-
width <= capture[theme].width && widths.indexOf(width) === index)} sizes={sizes}
- loading={eager ? "eager" : "lazy"} fetchpriority={eager ? "high" : "auto"} />
- ))}
-
-
-
diff --git a/site/src/components/landing/ProductVideo.astro b/site/src/components/landing/ProductVideo.astro
new file mode 100644
index 000000000..98722eb31
--- /dev/null
+++ b/site/src/components/landing/ProductVideo.astro
@@ -0,0 +1,84 @@
+---
+import MediaCaption from "./MediaCaption.astro";
+import { hasProductVideo, type LandingMedia } from "./landing-media";
+import chatLight from "../../assets/landing/chat-light.png";
+import chatDark from "../../assets/landing/chat-dark.png";
+import dashboardLight from "../../assets/landing/dashboard-light.png";
+import dashboardDark from "../../assets/landing/dashboard-dark.png";
+
+interface Props {
+ view: "chat" | "dashboard";
+ alt: string;
+ description: string;
+ eager?: boolean;
+ spedUp?: boolean;
+}
+
+const { view, alt, description, eager = false, spedUp = false } = Astro.props;
+const posters = { chat: { light: chatLight, dark: chatDark }, dashboard: { light: dashboardLight, dark: dashboardDark } };
+// Optional manifest: a checkout without published clips still builds with posters.
+const manifests = import.meta.glob("../../data/landing-media.json", { eager: true, import: "default" });
+const clips = manifests["../../data/landing-media.json"] ?? {};
+const themes = (["light", "dark"] as const).map(theme => ({
+ theme, poster: posters[view][theme],
+ webm: clips[`${view}-${theme}`]?.webm,
+ mp4: clips[`${view}-${theme}`]?.mp4,
+}));
+const id = `product-video-${view}`;
+const available = hasProductVideo(clips, view);
+---
+
+
+
+ {themes.map(({ theme, poster, webm, mp4 }) => (
+
+
+ {available &&
+
+
+
+ {description}
+
+ }
+
+ ))}
+
+ {description}
+
+ Pause
+
+
+
+
+
+
diff --git a/site/src/components/landing/ProofStrip.astro b/site/src/components/landing/ProofStrip.astro
index 19908a64d..a301f90ae 100644
--- a/site/src/components/landing/ProofStrip.astro
+++ b/site/src/components/landing/ProofStrip.astro
@@ -1,16 +1,4 @@
----
-import { benchmark, formatRate } from "../../data/benchmark";
-
-// Keep the Markdown statistic readable in llms.txt and enforce the shared report
-// as its authority: a changed result requires updating the authored text too.
-const content = await Astro.slots.render("default");
-const sustained = `${formatRate(benchmark.sustained.accepted_per_second)} items/s`;
-if (!content.includes(`${sustained} `)) {
- throw new Error(`Landing stat band must use the published sustained rate: ${sustained}`);
-}
----
-
-
+
diff --git a/site/src/components/landing/ThroughputReplay.astro b/site/src/components/landing/ThroughputReplay.astro
index d5ac154e7..1fb1a5eb2 100644
--- a/site/src/components/landing/ThroughputReplay.astro
+++ b/site/src/components/landing/ThroughputReplay.astro
@@ -20,7 +20,6 @@ const paths = layers.map((_, layer) => {
const lower = [...sustainedSeries].reverse().map(point => `${x(point.at_seconds).toFixed(2)},${y(bound(point, layer)).toFixed(2)}`);
return `M${upper.join(" L")} L${lower.join(" L")} Z`;
});
-const averageDuration = sustained.seconds >= 60 ? `${Math.round(sustained.seconds / 60)}-minute` : `${sustained.seconds}-second`;
const clock = (time: number) => `${String(Math.floor(time / 60)).padStart(2, "0")}:${String(Math.floor(time % 60)).padStart(2, "0")}`;
const rateWidth = `· ${formatRate(maximum)} items/s, 5 s rate`.length;
const machine = host.description.split(",")[0].replace("Cloud ", "");
@@ -33,9 +32,9 @@ const description = `${benchmark.release}: ${formatRate(sustained.accepted_per_s
{benchmark.development_preview ? "Development preview · mixed ingest" : "Sustained mixed ingest"}
- {formatRate(sustained.accepted_per_second)} items/s
+ {formatRate(sustained.accepted_per_second)} telemetry items/s
- {averageDuration} {sustained.phase === "mixed-sustained" ? "average" : "preview average"}
+ Five-minute mixed-ingest average
Spans {formatRate(sustained.spans_per_second)}
@@ -74,7 +73,7 @@ const description = `${benchmark.release}: ${formatRate(sustained.accepted_per_s
Full measured run {clock(seconds)} / {clock(seconds)}
- Replay of the measured run · {machine} · {host.logical_cpus} vCPU
+ Replay of the measured run · {machine} · {host.logical_cpus} vCPU How we measured →
{benchmark.development_preview && {benchmark.series_phase} · Partial run · Completion gate failed
}
@@ -87,7 +86,7 @@ const description = `${benchmark.release}: ${formatRate(sustained.accepted_per_s
margin: 0;
padding: 1rem 1.5rem;
border: 1px solid var(--sl-color-gray-5);
- border-radius: 8px;
+ border-radius: var(--fo-frame-radius);
background: var(--sl-color-black);
font-family: var(--fo-font-display);
color: var(--sl-color-white);
@@ -96,7 +95,7 @@ const description = `${benchmark.release}: ${formatRate(sustained.accepted_per_s
figcaption { display: grid; grid-template-columns: minmax(0, 1fr) auto 5rem; align-items: center; gap: 1rem; }
.fo-replay-heading { display: grid; grid-template-columns: max-content auto; align-items: baseline; gap: 0.25rem 1rem; min-width: 0; }
.fo-replay-eyebrow, .fo-replay-setup, .fo-replay-average { color: var(--sl-color-gray-2); font-size: 0.75rem; }
- .fo-replay-setup { margin: 0.5rem 0 0; line-height: 1.7; text-wrap: pretty; }
+ .fo-replay-setup { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.5rem 0 0; line-height: 1.7; text-wrap: pretty; }
.fo-replay-eyebrow { grid-column: 1 / -1; }
.fo-replay-average { white-space: nowrap; }
.fo-replay-headline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.6rem; }
diff --git a/site/src/components/landing/landing-media.ts b/site/src/components/landing/landing-media.ts
new file mode 100644
index 000000000..dddb637b2
--- /dev/null
+++ b/site/src/components/landing/landing-media.ts
@@ -0,0 +1,9 @@
+export type LandingMedia = Record;
+
+/** A slot needs complete sources in both themes before playback is enabled. */
+export function hasProductVideo(manifest: LandingMedia, view: "chat" | "dashboard"): boolean {
+ return ["light", "dark"].every(theme => {
+ const clip = manifest[`${view}-${theme}`];
+ return [clip?.webm, clip?.mp4].every(url => typeof url === "string" && url.length > 0);
+ });
+}
diff --git a/site/src/components/landing/product-video.ts b/site/src/components/landing/product-video.ts
new file mode 100644
index 000000000..3ec0a6e50
--- /dev/null
+++ b/site/src/components/landing/product-video.ts
@@ -0,0 +1,65 @@
+/** Templates keep autoplay and downloads inert until motion and visibility allow them. */
+export function mountProductVideo(root: HTMLElement) {
+ const slots = [...root.querySelectorAll("[data-video-theme]")];
+ const control = root.querySelector("[data-video-control]")!;
+ if (!root.querySelector("template")) return () => {};
+ const motion = matchMedia("(prefers-reduced-motion: reduce)");
+ let visible = false, paused = false, disposed = false;
+ const videos = new Map();
+
+ function update() {
+ const theme = document.documentElement.dataset.theme === "light" ? "light" : "dark";
+ const allowed = !disposed && visible && !document.hidden && !motion.matches;
+ control.hidden = !allowed;
+ control.textContent = paused ? "Play" : "Pause";
+ control.setAttribute("aria-label", paused ? "Play clip" : "Pause clip");
+ for (const slot of slots) {
+ const active = allowed && !paused && slot.dataset.videoTheme === theme;
+ let video = videos.get(slot);
+ if (active && !video) {
+ const template = slot.querySelector("template")!;
+ video = template.content.firstElementChild!.cloneNode(true) as HTMLVideoElement;
+ video.muted = true;
+ const player = video;
+ player.addEventListener("playing", () => {
+ if (!disposed && !motion.matches && !player.paused) slot.dataset.playing = "";
+ });
+ player.addEventListener("error", () => { delete slot.dataset.playing; });
+ slot.append(player);
+ videos.set(slot, player);
+ }
+ if (video) {
+ if (active) void video.play().catch(error => {
+ delete slot.dataset.playing;
+ if (!disposed && error instanceof Error && error.name === "NotAllowedError") {
+ paused = true;
+ update();
+ }
+ });
+ else video.pause();
+ }
+ if (motion.matches || slot.dataset.videoTheme !== theme) delete slot.dataset.playing;
+ }
+ }
+
+ const intersection = new IntersectionObserver(entries => {
+ visible = entries.some(entry => entry.isIntersecting);
+ update();
+ });
+ const theme = new MutationObserver(update);
+ intersection.observe(root);
+ theme.observe(document.documentElement, { attributes: true, attributeFilter: ["data-theme"] });
+ const toggle = () => { paused = !paused; update(); };
+ control.addEventListener("click", toggle);
+ motion.addEventListener("change", update);
+ document.addEventListener("visibilitychange", update);
+ return () => {
+ disposed = true;
+ update();
+ intersection.disconnect();
+ theme.disconnect();
+ control.removeEventListener("click", toggle);
+ motion.removeEventListener("change", update);
+ document.removeEventListener("visibilitychange", update);
+ };
+}
diff --git a/site/src/components/landing/throughput-replay.ts b/site/src/components/landing/throughput-replay.ts
index 003916f12..05dbf205d 100644
--- a/site/src/components/landing/throughput-replay.ts
+++ b/site/src/components/landing/throughput-replay.ts
@@ -123,7 +123,8 @@ export function mountReplay(root: HTMLElement, load: () => Promise
cursor: { drag: { x: false, y: false }, points: { show: false } },
scales: { x: { time: false, auto: false, range: () => [frame.min, frame.max] }, y: { auto: false, range: () => [0, ceiling] } },
axes: [
- { stroke: () => ink, font, size: 36, space: 70, grid: { show: false }, ticks: { show: false },
+ // Keep the first time label below the zero tick, even beside the y-axis.
+ { stroke: () => ink, font, size: 36, gap: 16, space: 70, grid: { show: false }, ticks: { show: false },
values: (_, ticks) => ticks.map(value => value < 0 ? "" : clock(value)) },
{ stroke: () => ink, font, size: 52, grid: { stroke: () => grid, width: 0.5 }, ticks: { show: false },
splits: () => Array.from({ length: 4 }, (_, i) => i * step),
diff --git a/site/src/content/docs/guides/connect-over-mcp.mdx b/site/src/content/docs/guides/connect-over-mcp.mdx
index b102d21d9..3ec74293b 100644
--- a/site/src/content/docs/guides/connect-over-mcp.mdx
+++ b/site/src/content/docs/guides/connect-over-mcp.mdx
@@ -53,6 +53,16 @@ needs only the URL:
You authorize it in the browser as yourself, which ties the agent to your
account without delegating your first-party account role.
+### Claude Code
+
+Add Fanout as a remote MCP server:
+
+```sh
+claude mcp add --transport http fanout https://fanout.example.com/mcp
+```
+
+Use your instance's public URL, then authorize the connection in your browser.
+
## Protocol
Fanout serves MCP protocol version `2026-07-28` over stateless Streamable
diff --git a/site/src/content/docs/index.mdx b/site/src/content/docs/index.mdx
index f2343c74f..2dc2112d4 100644
--- a/site/src/content/docs/index.mdx
+++ b/site/src/content/docs/index.mdx
@@ -1,16 +1,13 @@
---
-title: Fanout
-description: One binary that ingests OpenTelemetry, stores it, and answers questions about it.
-summary: OpenTelemetry observability in one binary, with a system overview, service map and trace waterfall.
+title: Observability your agents can operate.
+description: Send OpenTelemetry to one binary. Investigate with Fanout's built-in agent, or connect yours over MCP.
+summary: Investigate with Fanout's built-in agent, or use the same typed tools from your own agent over MCP.
template: splash
-# The landing page's content title is also the site title, so Starlight's
-# default would be "Fanout · Fanout". A frontmatter title replaces that default
-# instead of adding a second ; the same override gives social cards a
-# useful proposition. The canonical stays at the public root even though the
-# static file produced by Astro is named index.html.
+# Override Starlight's title order consistently for search and social cards.
+# The canonical stays at the public root even though Astro writes index.html.
head:
- tag: title
- content: "Fanout · OpenTelemetry observability in one binary."
+ content: "Fanout · Observability your agents can operate."
- tag: link
attrs:
rel: canonical
@@ -18,14 +15,14 @@ head:
- tag: meta
attrs:
property: og:title
- content: "Fanout · OpenTelemetry observability in one binary."
+ content: "Fanout · Observability your agents can operate."
- tag: meta
attrs:
property: og:url
content: "https://fanout.run/"
hero:
- title: See what broke without operating an observability stack.
- tagline: Send OpenTelemetry traces, logs and metrics to one binary to investigate incidents and run alerts.
+ title: Observability your agents can operate.
+ tagline: Send OpenTelemetry to one binary. Investigate with Fanout's built-in agent, or connect yours over MCP.
actions:
- text: Install Fanout
link: /start/install
@@ -36,54 +33,65 @@ status: shipped
import ProofStrip from "../../components/landing/ProofStrip.astro";
import CaptureRow from "../../components/landing/CaptureRow.astro";
-import ProductCapture from "../../components/landing/ProductCapture.astro";
+import ProductVideo from "../../components/landing/ProductVideo.astro";
import CtaBar from "../../components/landing/CtaBar.astro";
+import McpCommand from "../../components/landing/McpCommand.astro";
+import ThroughputReplay from "../../components/landing/ThroughputReplay.astro";
import ThroughputReplayClient from "../../components/landing/ThroughputReplayClient.astro";
{/* Keep prose as Markdown children: the Markdown and llms.txt routes strip component tags and retain their content. Keep MDX comments on one line. */}
+
+
-- [**415,859 items/s** sustained](/explanation/performance)
-- **One binary**
+- **MCP** for your agents
- **OTLP** traces, logs and metrics
- **Parquet** you own
- **Apache-2.0**
-
+
-## Every service on one screen.
+## Dashboards from a sentence.
-See request rate, errors and latency across your system. Open a dashboard
-or ask a question to investigate the services that need attention.
+Ask for checkout request rate, errors, p95 latency and slowest dependencies. The agent builds and saves the dashboard.
-
+
-
+
-## See how your services connect.
+## Ask what broke.
-Follow calls across services and external dependencies, with health, traffic and
-latency on the map. Open a service to inspect its traces.
+The agent queries traces, logs and metrics, then explains what the evidence shows. Try it on the [live demo](https://demo.fanout.run/chat): sign in with your email, no password needed.
-
+
-
+
+
+## Use the same tools from your agent.
+
+Query telemetry, inspect traces and save dashboards through typed MCP tools.
-## Find where the time went.
+
+ get_telemetry_schema
+ query_telemetry
+ search_logs
+ inspect_trace
+ preview_panels
+ create_dashboard
+
-Open a trace to see each operation in a waterfall, with duration, service and
-error status alongside correlated logs.
+Connect an agent over MCP →
-
+
diff --git a/site/src/data/landing-media.json b/site/src/data/landing-media.json
new file mode 100644
index 000000000..22a89c5de
--- /dev/null
+++ b/site/src/data/landing-media.json
@@ -0,0 +1,18 @@
+{
+ "chat-dark": {
+ "mp4": "https://assets.fanout.run/landing/chat-dark-060356746cef.mp4",
+ "webm": "https://assets.fanout.run/landing/chat-dark-3afac098a9b8.webm"
+ },
+ "chat-light": {
+ "mp4": "https://assets.fanout.run/landing/chat-light-3ff97d86374f.mp4",
+ "webm": "https://assets.fanout.run/landing/chat-light-3947b9e88408.webm"
+ },
+ "dashboard-dark": {
+ "mp4": "https://assets.fanout.run/landing/dashboard-dark-edf139c5a5a1.mp4",
+ "webm": "https://assets.fanout.run/landing/dashboard-dark-288fcd70d685.webm"
+ },
+ "dashboard-light": {
+ "mp4": "https://assets.fanout.run/landing/dashboard-light-b51d120624a4.mp4",
+ "webm": "https://assets.fanout.run/landing/dashboard-light-dc0e9675651a.webm"
+ }
+}
diff --git a/site/src/styles/fanout.css b/site/src/styles/fanout.css
index f2262e681..86118e727 100644
--- a/site/src/styles/fanout.css
+++ b/site/src/styles/fanout.css
@@ -45,6 +45,8 @@
:root {
--fo-font-display: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
--fo-font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
+ --fo-frame-radius: 8px;
+ --fo-frame-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px rgb(0 0 0 / 0.06);
/* Mono owns the brand, navigation, headings and technical artifacts. Sans is
opted into by prose, below. */
@@ -76,6 +78,7 @@
}
:root[data-theme="light"] {
+ --fo-frame-shadow: 0 2px 4px rgb(23 27 36 / 0.04), 0 12px 32px rgb(23 27 36 / 0.08);
--sl-color-accent-low: #ece3fb;
--sl-color-accent: #7c4dcc;
--sl-color-accent-high: #5b32a3;
@@ -109,6 +112,35 @@
background: url("/favicon.svg") center / contain no-repeat;
}
+.fo-link {
+ color: var(--sl-color-accent-high);
+ text-decoration: none;
+ text-underline-offset: 0.25em;
+}
+.fo-link:hover { color: var(--sl-color-accent); text-decoration: underline; }
+.fo-link:focus-visible { outline: 2px solid var(--sl-color-accent); outline-offset: 3px; }
+
+.fo-product-frame {
+ overflow: hidden;
+ border: 1px solid var(--sl-color-gray-5);
+ border-radius: var(--fo-frame-radius);
+ background: var(--sl-color-black);
+ box-shadow: var(--fo-frame-shadow);
+}
+
+@media (max-width: 49.999rem) {
+ header.header .right-group { display: flex; flex-shrink: 0; }
+ header.header .header { gap: 0.5rem; }
+ header.header :is(.right-group, .social-icons) { gap: 0.75rem; }
+ header.header .social-icons::after { display: none; }
+}
+
+@media (max-width: 39.999rem) {
+ header.header .site-title { font-size: 1.125rem; }
+ header.header starlight-theme-select select { width: 2rem; padding-inline: 0; color: transparent; }
+ header.header starlight-theme-select .caret { display: none; }
+}
+
/* The landing page stays mono-led; the proportional face is reserved for the
long-form documentation where it materially improves reading. */
body:has(.fo-hero) site-search {
@@ -151,6 +183,24 @@ body:has(.fo-hero) .sl-markdown-content > * {
margin: 0;
}
+.fo-mcp-tools {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.5rem;
+ list-style: none;
+ padding: 0;
+ margin: 1.25rem 0 0;
+}
+
+.fo-mcp-tools > li {
+ margin: 0;
+ padding: 0.25rem 0.5rem;
+ border: 1px solid var(--sl-color-gray-5);
+ border-radius: 4px;
+ font-size: 0.75rem;
+}
+.fo-mcp-tools code { font-family: var(--fo-font-display); }
+
@media (max-width: 71.999rem) {
body:has(.fo-hero) { --fo-section-gap: 3.5rem; }
}
diff --git a/ui/host/e2e/global-setup.ts b/ui/host/e2e/global-setup.ts
index 872e18b89..35595d933 100644
--- a/ui/host/e2e/global-setup.ts
+++ b/ui/host/e2e/global-setup.ts
@@ -49,7 +49,11 @@ function seed(binary: string | undefined, base: string, tokenFile: string, log:
}
export default async function globalSetup() {
- // External landing captures use an existing instance and an in-memory session.
+ // Recordings require a real AI-enabled instance; never start the seeded server.
+ if (process.env.FANOUT_LANDING_RECORDINGS === "1" && !process.env.FANOUT_LANDING_BASE_URL) {
+ throw new Error("Landing recordings require FANOUT_LANDING_BASE_URL and FANOUT_LANDING_SESSION_COOKIE for an external instance");
+ }
+ // External landing media use an existing instance and an in-memory session.
if (process.env.FANOUT_LANDING_BASE_URL) return;
const dir = await mkdtemp(join(tmpdir(), "fanout-e2e-"));
diff --git a/ui/host/e2e/landing-captures.spec.ts b/ui/host/e2e/landing-captures.spec.ts
index a886dd576..60ab53c9f 100644
--- a/ui/host/e2e/landing-captures.spec.ts
+++ b/ui/host/e2e/landing-captures.spec.ts
@@ -3,8 +3,6 @@ import { mkdir } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import { cardSelector, readyCard, settle, test } from "./accessibility-support";
import type { DashboardSpec } from "../../panels/types";
-import type { Result, TraceDetail } from "../../contracts";
-import { compareTracePages, scoreTracePage } from "./landing-trace-support";
// Use either the real seeded server or an existing instance, without intercepts.
const externalBaseURL = process.env.FANOUT_LANDING_BASE_URL;
@@ -39,7 +37,7 @@ async function readyOverviewViewport(page: Page) {
}).toEqual([]);
}
-test("capture the overview, service map and trace waterfall for the landing page", async ({ page, request }, info) => {
+test("capture the README overview", async ({ page, request }, info) => {
// The normal matrix also includes 1100px. Write each stable asset only once.
test.skip(info.project.use.viewport?.width !== 1440, "landing captures use the 1440px projects");
const theme = info.project.use.colorScheme as "light" | "dark";
@@ -107,107 +105,4 @@ test("capture the overview, service map and trace waterfall for the landing page
expect(clip.height).toBeGreaterThan(0);
return clip;
});
-
- const mapPanel = dashboard.spec.panels.find(panel => panel.viz === "service_map");
- if (!mapPanel) throw new Error("System overview has no service map");
- const map = await readyCard(page, mapPanel);
- await map.getByRole("button", { name: `${mapPanel.title} menu`, exact: true }).click();
- await page.getByRole("menuitem", { name: "View", exact: true }).click();
- const fullView = page.locator("[data-panel-fullscreen]");
- await expect(fullView).toBeVisible();
- const fullMap = fullView.locator(cardSelector(mapPanel.id));
- await expect(fullMap.locator('[aria-label="Loading panel"], [aria-label="Refreshing"]')).toHaveCount(0);
- await expect(fullMap.getByRole("region", { name: /service dependency graph/ }).getByRole("button").first()).toBeVisible();
- await settle(page);
- await page.waitForTimeout(250);
- const wholeGraph = fullMap.getByRole("button", { name: `Show whole ${mapPanel.title} graph`, exact: true });
- if (await wholeGraph.isVisible()) await wholeGraph.click();
- await expect(fullMap.getByRole("region", { name: /service dependency graph/ }).getByRole("button").first()).toBeVisible();
- await expect(fullMap.locator("[data-panel-title]")).toHaveText(mapPanel.title);
- await capture("service-map", fullMap, async () => {
- // Crop the settled graph itself: resizing the card refits and recentres
- // its contents, which can reintroduce the whitespace being removed.
- const clip = await fullMap.getByRole("region", { name: /service dependency graph/ }).evaluate(region => {
- const boxes = [...region.querySelectorAll("button, svg > g > path, span")]
- .map(node => node.getBoundingClientRect()).filter(box => box.width > 0 || box.height > 0);
- if (!boxes.length) throw new Error("The service graph has no rendered bounds");
- const left = Math.min(...boxes.map(box => box.left)), right = Math.max(...boxes.map(box => box.right));
- const top = Math.min(...boxes.map(box => box.top)), bottom = Math.max(...boxes.map(box => box.bottom));
- // Keep 24 CSS pixels (48 source pixels at 2x) beyond every rendered
- // node, connector and label. Let the graph determine the aspect ratio.
- const x = Math.floor(left - 24), y = Math.floor(top - 24);
- return { x, y, width: Math.ceil(right + 24) - x, height: Math.ceil(bottom + 24) - y };
- });
- const viewport = page.viewportSize()!;
- expect(clip.x).toBeGreaterThanOrEqual(0); expect(clip.x + clip.width).toBeLessThanOrEqual(viewport.width);
- expect(clip.y).toBeGreaterThanOrEqual(0); expect(clip.y + clip.height).toBeLessThanOrEqual(viewport.height);
- expect(clip.width).toBeGreaterThanOrEqual(clip.height);
- return clip;
- });
-
- await page.getByRole("button", { name: "Close panel view", exact: true }).click();
- await expect(fullView).toHaveCount(0);
- // The drawer needs enough vertical room for all eight visible waterfall
- // spans, pagination and the first correlated log rows.
- await page.setViewportSize({ width: 1440, height: 1200 });
- // Open a service, then one of its server-returned exemplar traces.
- const inlineMap = page.locator(cardSelector(mapPanel.id));
- const inlineWholeGraph = inlineMap.getByRole("button", { name: `Show whole ${mapPanel.title} graph`, exact: true });
- if (await inlineWholeGraph.isVisible()) await inlineWholeGraph.click();
- const drawer = page.getByRole("dialog");
- const traceRows = drawer.getByRole("button", { name: / · .* · [\d.]+ ms$/ });
- if (externalBaseURL) {
- const services = inlineMap.getByRole("region", { name: /service dependency graph/ }).getByRole("button");
- const labels = await services.evaluateAll(nodes => nodes.map(node => node.getAttribute("aria-label")!));
- // Prefer the demo's checkout path, then its frontend, before other services.
- const priority = (label: string) => /checkout/i.test(label.split(",")[0]) ? 0 : /frontend/i.test(label.split(",")[0]) ? 1 : 2;
- labels.sort((a, b) => priority(a) - priority(b) || a.localeCompare(b));
- if (!labels.length) throw new Error("The live service map has no services");
- const exemplarsReady = page.waitForResponse(response => new URL(response.url()).pathname === "/api/panels/exemplars" && response.request().method() === "POST");
- await inlineMap.getByRole("button", { name: labels[0], exact: true }).click();
- const exemplarsResponse = await exemplarsReady;
- expect(exemplarsResponse.status()).toBe(200);
- const { traces } = await exemplarsResponse.json() as { traces: { trace_id: string; namespace: string }[] };
- const selection = exemplarsResponse.request().postDataJSON() as { time: { from: string; to: string } };
- const candidates = await Promise.all(traces.map(async (trace, index) => {
- const params = new URLSearchParams({ namespace: trace.namespace, from: selection.time.from, to: selection.time.to, limit: "200" });
- const response = await request.get(`/api/traces/${encodeURIComponent(trace.trace_id)}?${params}`);
- expect(response.status()).toBe(200);
- const { data } = await response.json() as Result;
- return { index, data };
- }));
- // Rank the actual first waterfall page of complete, error-free traces.
- const ranked = candidates.flatMap(({ index, data }) => {
- const score = scoreTracePage(data);
- return score ? [{ index, score }] : [];
- }).sort((a, b) => compareTracePages(a.score, b.score));
- if (!ranked.length) throw new Error("No complete, error-free live exemplar has at least 3 services on its first waterfall page and a positive duration; send more workload before capturing");
- await expect(drawer).toBeVisible();
- await expect(traceRows).toHaveCount(traces.length);
- await traceRows.nth(ranked[0].index).click();
- } else {
- await inlineMap.getByRole("button", { name: /^checkout, / }).click();
- await expect(drawer).toBeVisible();
- await traceRows.first().click();
- }
- await expect(drawer.getByRole("button", { name: "Waterfall", exact: true })).toHaveAttribute("aria-pressed", "true");
- // Capture-only width gives the waterfall and logs a landscape frame without
- // changing the product drawer or shrinking its text to fit a portrait crop.
- await drawer.evaluate(dialog => Object.assign(dialog.style, { flex: "0 0 1200px", width: "1200px", maxWidth: "100vw" }));
- await settle(page);
- await expect(drawer.getByRole("columnheader", { name: "Timeline", exact: true })).toBeVisible();
- await expect(drawer.getByRole("img", { name: / took / }).first()).toBeVisible();
- await expect(drawer.getByRole("img", { name: / took / }).last()).toBeInViewport({ ratio: 1 });
- await expect(drawer.getByText("Correlated logs", { exact: true })).toBeVisible();
- const logs = drawer.locator("tbody tr").filter({ has: page.locator("[data-field=body]") });
- await expect(logs.first()).toBeVisible();
- const lastLog = logs.nth(Math.min(2, await logs.count() - 1));
- await expect(lastLog).toBeInViewport({ ratio: 1 });
- await expect(drawer.getByRole("alert")).toHaveCount(0);
- await capture("trace", drawer, async () => {
- const dialog = (await drawer.boundingBox())!, last = (await lastLog.boundingBox())!;
- const clip = { x: dialog.x, y: dialog.y, width: dialog.width, height: Math.ceil(last.y + last.height - dialog.y) };
- expect(clip.width).toBeGreaterThanOrEqual(clip.height);
- return clip;
- });
});
diff --git a/ui/host/e2e/landing-recording-support.ts b/ui/host/e2e/landing-recording-support.ts
new file mode 100644
index 000000000..43d61081f
--- /dev/null
+++ b/ui/host/e2e/landing-recording-support.ts
@@ -0,0 +1,59 @@
+export type AgentEvent = {
+ type: string;
+ timestamp: number;
+ toolCallId?: string;
+ toolCallName?: string;
+ content?: string;
+};
+export type WaitInterval = { kind: "model_thinking" | "tool_call"; start: number; end: number; tool?: string };
+
+/** Observe the completed, unmodified SSE response; never route or replace requests. */
+export function recordingTimeline(stream: string, responseAt: number) {
+ const events = stream.split(/\r?\n\r?\n/).flatMap(frame => {
+ const data = frame.split(/\r?\n/).filter(line => line.startsWith("data:")).map(line => line.slice(5).trimStart()).join("\n");
+ return data ? [JSON.parse(data) as AgentEvent] : [];
+ });
+ const first = events.find(event => event.type === "RUN_STARTED");
+ if (!first || !Number.isFinite(first.timestamp)) throw new Error("Agent stream has no timestamped RUN_STARTED event");
+ if (events.some(event => event.type === "RUN_ERROR")) throw new Error("Agent run failed; inspect the instance before recording again");
+ if (!events.some(event => event.type === "RUN_FINISHED")) throw new Error("Agent stream ended without RUN_FINISHED");
+ const waits: WaitInterval[] = [];
+ const tools = new Map();
+ const names = new Map();
+ let thinking: number | undefined, dashboardId: string | undefined;
+ const endThinking = (end: number) => {
+ if (thinking !== undefined && end > thinking) waits.push({ kind: "model_thinking", start: thinking, end });
+ thinking = undefined;
+ };
+ for (const event of events) {
+ if (!Number.isFinite(event.timestamp)) throw new Error(`Agent event ${event.type} has no timestamp`);
+ // Anchor server timestamps to receipt of the response headers to avoid clock skew.
+ const at = responseAt + (event.timestamp - first.timestamp) / 1000;
+ switch (event.type) {
+ case "RUN_STARTED": thinking = at; break;
+ case "REASONING_MESSAGE_START": case "TEXT_MESSAGE_START": endThinking(at); break;
+ case "REASONING_MESSAGE_END": if (thinking === undefined && tools.size === 0) thinking = at; break;
+ case "TOOL_CALL_START":
+ endThinking(at);
+ if (!event.toolCallId || !event.toolCallName) throw new Error("Tool call has no id or name");
+ tools.set(event.toolCallId, { start: at, tool: event.toolCallName });
+ names.set(event.toolCallId, event.toolCallName);
+ break;
+ case "TOOL_CALL_RESULT": {
+ const call = tools.get(event.toolCallId!);
+ if (!call) throw new Error("Tool result has no matching start event");
+ if (at > call.start) waits.push({ kind: "tool_call", ...call, end: at });
+ tools.delete(event.toolCallId!);
+ if (tools.size === 0) thinking = at;
+ if (names.get(event.toolCallId!) === "create_dashboard" && event.content) {
+ const result = JSON.parse(event.content) as { isError?: boolean; error?: unknown; dashboard?: { id?: string }; receipt?: unknown };
+ if (!result.isError && !result.error && result.receipt && typeof result.dashboard?.id === "string") dashboardId = result.dashboard.id;
+ }
+ break;
+ }
+ case "RUN_FINISHED": endThinking(at); break;
+ }
+ }
+ if (tools.size) throw new Error("Agent finished with unresolved tool calls");
+ return { waits: waits.sort((a, b) => a.start - b.start), dashboardId };
+}
diff --git a/ui/host/e2e/landing-recordings.spec.ts b/ui/host/e2e/landing-recordings.spec.ts
new file mode 100644
index 000000000..170286f5b
--- /dev/null
+++ b/ui/host/e2e/landing-recordings.spec.ts
@@ -0,0 +1,147 @@
+import { expect, test } from "@playwright/test";
+import { mkdir, writeFile } from "node:fs/promises";
+import { fileURLToPath } from "node:url";
+import { cardSelector, readyCard, settle } from "./accessibility-support";
+import { recordingTimeline } from "./landing-recording-support";
+import type { DashboardSpec } from "../../panels/types";
+
+const baseURL = process.env.FANOUT_LANDING_BASE_URL;
+const directory = fileURLToPath(new URL("../test-results/landing-recordings/", import.meta.url));
+test.skip(process.env.FANOUT_LANDING_RECORDINGS !== "1", "set FANOUT_LANDING_RECORDINGS=1 to record real landing clips");
+test.setTimeout(8 * 60_000);
+test.use({
+ storageState: async ({}, use) => {
+ if (!baseURL) throw new Error("Landing recordings require FANOUT_LANDING_BASE_URL for an external instance");
+ const match = /^([!#$%&'*+.^_`|~\w-]+)=([^;\s]+)$/.exec(process.env.FANOUT_LANDING_SESSION_COOKIE ?? "");
+ if (!match) throw new Error("FANOUT_LANDING_SESSION_COOKIE must be a nonempty name=value session cookie");
+ const url = new URL(baseURL);
+ await use({ cookies: [{ name: match[1], value: match[2], domain: url.hostname, path: "/", expires: -1,
+ httpOnly: true, secure: url.protocol === "https:", sameSite: "Lax" }], origins: [] });
+ },
+});
+
+const prompts = {
+ chat: "Why is checkout slower in the last hour?",
+ dashboard: "Build a dashboard for checkout: request rate, error rate, p95 latency, and its slowest dependencies",
+};
+
+for (const view of ["chat", "dashboard"] as const) {
+ test(`record ${view} on the OpenTelemetry Demo`, async ({ browser, storageState }, info) => {
+ test.skip(info.project.use.viewport?.width !== 1440, "use the 1440px projects to record each theme once at 1280 × 800 CSS pixels");
+ const theme = info.project.use.colorScheme as "light" | "dark";
+ await mkdir(directory, { recursive: true });
+ const context = await browser.newContext({ baseURL, storageState, colorScheme: theme,
+ viewport: { width: 1280, height: 800 },
+ recordVideo: { dir: directory, size: { width: 1280, height: 800 } } });
+ try {
+ const status = await context.request.get("/api/auth/status");
+ expect(status.ok(), "Cannot read runtime status from the external instance").toBe(true);
+ if (!(await status.json() as { agent_available: boolean }).agent_available) {
+ throw new Error("Chat is disabled on the external instance; configure an AI provider before recording landing clips");
+ }
+ await context.addInitScript(value => localStorage.setItem("mantine-color-scheme-value", value), theme);
+ const startedAt = Date.now();
+ const page = await context.newPage();
+ const video = page.video()!;
+ await page.goto("/chat");
+ // Use this page's session and the owner-scoped APIs to clear earlier takes.
+ await page.evaluate(async () => {
+ const request = async (path: string, method = "GET", headers: Record = {}) => {
+ const response = await fetch(path, { method, credentials: "same-origin", redirect: "error",
+ headers: { "Fanout-Request": "1", ...headers } }).catch(() => {
+ throw new Error(`Landing recording cleanup failed: ${method} ${path} (request could not complete)`);
+ });
+ if (!response.ok) throw new Error(`Landing recording cleanup failed: ${method} ${path} (HTTP ${response.status})`);
+ return response;
+ };
+ // Finish pagination before deleting so removals cannot affect the scan.
+ const threadIds: string[] = [];
+ let cursor: string | null = null;
+ do {
+ const params = new URLSearchParams({ page_size: "100" });
+ if (cursor) params.set("cursor", cursor);
+ const response = await request(`/api/agent/threads?${params}`);
+ const page = await response.json() as { items: { id: string }[]; next_cursor: string | null };
+ threadIds.push(...page.items.map(thread => thread.id));
+ cursor = page.next_cursor;
+ } while (cursor);
+ for (const id of threadIds) await request(`/api/agent/threads/${encodeURIComponent(id)}`, "DELETE");
+
+ const response = await request("/api/dashboards");
+ const { dashboards } = await response.json() as { dashboards: { id: string; is_default: boolean }[] };
+ for (const dashboard of dashboards) {
+ // Only an explicit non-default flag permits deletion; never touch the default.
+ if (dashboard.is_default !== false) continue;
+ await request(`/api/dashboards/${encodeURIComponent(dashboard.id)}`, "DELETE",
+ { "Fanout-Confirm-Delete": dashboard.id });
+ }
+ });
+ await page.reload();
+ const navigation = page.getByRole("navigation", { name: "Navigation", exact: true });
+ await expect(navigation.getByText("No chats yet", { exact: true })).toBeVisible();
+ await expect(navigation.locator('a[href^="/dashboards/"]')).toHaveCount(1);
+ await expect(navigation.locator('a[href^="/dashboards/"]').getByText("System overview", { exact: true })).toBeVisible();
+ await expect(page.locator("html")).toHaveAttribute("data-mantine-color-scheme", theme);
+ const input = page.getByRole("textbox", { name: "Message Fanout", exact: true });
+ await expect(input, "Chat must be enabled and the session must allow agent runs").toBeEnabled();
+ // The clip starts on the settled empty chat, not on page load and cleanup.
+ const start = (Date.now() - startedAt) / 1000;
+ await input.click();
+ // A steady human typing cadence, including a short pause at punctuation.
+ for (const character of prompts[view]) {
+ await input.pressSequentially(character, { delay: /[,:?]/.test(character) ? 180 : 55 });
+ }
+ const responseReady = page.waitForResponse(response => new URL(response.url()).pathname === "/api/agent/runs"
+ && response.request().method() === "POST", { timeout: 30_000 });
+ await page.getByRole("button", { name: "Send message", exact: true }).click();
+ const response = await responseReady;
+ const responseAt = (Date.now() - startedAt) / 1000;
+ expect(response.ok(), "Agent request failed; check chat configuration and the session's agent:run capability").toBe(true);
+ const timeline = recordingTimeline(await response.text(), responseAt);
+ // RUN_FINISHED in the real stream plus the UI's idle state gates the dwell.
+ await expect(page.getByRole("button", { name: "Stop", exact: true })).toHaveCount(0);
+ await expect(page.locator(".chat-pane .mantine-Loader-root")).toHaveCount(0);
+ await expect(page.locator(".chat-pane").getByRole("alert")).toHaveCount(0);
+ await expect(page.locator('[data-answer-position] [data-role="assistant"]')).toBeVisible();
+ const views = page.locator('iframe[title="Fanout analysis view"]');
+ for (let index = 0; index < await views.count(); index++) {
+ const frame = views.nth(index).contentFrame();
+ await expect(frame.locator("[data-panel-body]").first()).toBeAttached();
+ await expect(frame.locator(".mantine-Loader-root, [data-panel-error]")).toHaveCount(0);
+ }
+
+ if (view === "dashboard") {
+ if (!timeline.dashboardId) throw new Error("No successful create_dashboard result with a committed save receipt; the recording requires a newly saved dashboard");
+ const receipt = page.locator(`[data-dashboard-result="${timeline.dashboardId}"]`);
+ await receipt.getByRole("link", { name: "Open dashboard", exact: true }).click();
+ await expect(page).toHaveURL(new RegExp(`/dashboards/${timeline.dashboardId}(?:\\?|$)`));
+ const saved = await context.request.get(`/api/dashboards/${encodeURIComponent(timeline.dashboardId)}`);
+ expect(saved.ok()).toBe(true);
+ const { spec } = await saved.json() as { spec: DashboardSpec };
+ expect(spec.panels.length, "The created dashboard must contain panels").toBeGreaterThan(0);
+ for (const panel of spec.panels) await readyCard(page, panel);
+ await page.evaluate(() => window.scrollTo(0, 0));
+ // Lazy panels returning to the first fold must be settled too.
+ for (const panel of spec.panels) {
+ const card = page.locator(cardSelector(panel.id));
+ await expect(card.locator('[aria-label="Loading panel"], [aria-label="Refreshing"], [data-panel-error]')).toHaveCount(0);
+ }
+ }
+ await settle(page);
+ await page.mouse.move(0, 0);
+ await page.waitForTimeout(view === "dashboard" ? 5_000 : 4_000);
+ const duration = (Date.now() - startedAt) / 1000;
+ await context.close();
+ const rawFile = `${view}-${theme}.webm`;
+ await video.saveAs(`${directory}${rawFile}`);
+ await video.delete();
+ // No cookies, request bodies, tool results or telemetry are persisted here.
+ await writeFile(`${directory}${view}-${theme}.json`, JSON.stringify({ version: 1, raw_file: rawFile,
+ viewport: { width: 1280, height: 800 }, theme, prompt: prompts[view], start, duration,
+ clock: "seconds from page creation; server event deltas anchored to response headers",
+ waits: timeline.waits }, null, 2) + "\n");
+ } finally {
+ await context.close();
+ }
+ });
+}
diff --git a/ui/host/e2e/landing-trace-support.test.ts b/ui/host/e2e/landing-trace-support.test.ts
deleted file mode 100644
index 0ac3255f9..000000000
--- a/ui/host/e2e/landing-trace-support.test.ts
+++ /dev/null
@@ -1,80 +0,0 @@
-import { expect, it } from "vitest";
-import type { TraceDetail, TraceSpan } from "../../contracts";
-import { pageItems, TRACE_PAGE_SIZE } from "../src/dashboards/trace/pagination";
-import { compareTracePages, scoreTracePage } from "./landing-trace-support";
-
-function span(id: string, start: number, duration: number, service = id): TraceSpan {
- return {
- span_id: id, service, operation: id, kind: "SERVER", status: "OK",
- start: new Date(Date.UTC(2026, 9, 1) + start).toISOString(), duration_ms: duration,
- };
-}
-
-function trace(spans: TraceSpan[], overrides: Partial = {}): TraceDetail {
- const services = [...new Set(spans.map(span => span.service))];
- return {
- trace_id: "trace", duration_ms: 100, has_error: false, services, spans, logs: [],
- span_count: spans.length, service_count: services.length, truncated: false, ...overrides,
- };
-}
-
-it("scores the union of overlapping intervals without counting gaps or nesting twice", () => {
- const data = trace([span("a", 10, 30), span("b", 0, 20), span("c", 70, 10), span("d", 12, 3)]);
- const original = [...data.spans];
- expect(scoreTracePage(data)).toEqual({
- traceID: "trace", coverage: 0.5, startSpread: 0.7, serviceCount: 4, fitsOnePage: true,
- });
- expect(data.spans).toEqual(original);
-});
-
-it("uses the UI's first page in server order, even when later spans start earlier", () => {
- const spans = Array.from({ length: TRACE_PAGE_SIZE }, (_, i) => span(`first-${i}`, 40 + i, 10, `service-${i % 3}`));
- spans.push(span("later", 0, 100));
- expect(pageItems(spans)).toEqual(spans.slice(0, TRACE_PAGE_SIZE));
- expect(pageItems(spans, 2)).toEqual([spans.at(-1)]);
- expect(scoreTracePage(trace(spans))).toEqual({
- traceID: "trace", coverage: 0.17, startSpread: 0.07, serviceCount: 3, fitsOnePage: false,
- });
- const tooFewServices = spans.map((item, i) => i < TRACE_PAGE_SIZE ? { ...item, service: "only" } : item);
- expect(scoreTracePage(trace(tooFewServices))).toBeNull();
-});
-
-it("normalizes coverage and start spread by trace duration", () => {
- const data = trace([span("a", 0, 20), span("b", 40, 10), span("c", 90, 10)]);
- const scaled = trace([span("a", 0, 200), span("b", 400, 100), span("c", 900, 100)], { duration_ms: 1000 });
- expect(scoreTracePage(data)).toEqual(scoreTracePage(scaled));
-});
-
-it("prefers a distributed single-page trace over a long root and seven early slivers", () => {
- const clustered = [span("root", 0, 834), ...Array.from({ length: 7 }, (_, i) => span(`early-${i}`, i + 1, 1))];
- clustered.push(...Array.from({ length: 186 }, (_, i) => span(`later-${i}`, 100 + i, 1)));
- const busy = scoreTracePage(trace(clustered, { trace_id: "large", duration_ms: 834 }))!;
- const distributed = scoreTracePage(trace([span("a", 0, 100), span("b", 30, 30), span("c", 70, 30)]))!;
- expect(busy.coverage).toBe(1);
- expect(distributed.coverage).toBe(1);
- expect(compareTracePages(distributed, busy)).toBeLessThan(0);
-});
-
-it("rejects truncated, incomplete and erroneous traces, including errors beyond page one", () => {
- const spans = [span("a", 0, 100), span("b", 30, 30), span("c", 70, 30)];
- for (const overrides of [{ truncated: true }, { span_count: 4 }, { has_error: true }, { duration_ms: 0 }]) {
- expect(scoreTracePage(trace(spans, overrides))).toBeNull();
- }
- const withError = [...spans, ...Array.from({ length: TRACE_PAGE_SIZE }, (_, i) => span(`extra-${i}`, 1, 1))];
- withError[withError.length - 1].status = "STATUS_CODE_ERROR";
- expect(scoreTracePage(trace(withError))).toBeNull();
-});
-
-it("prefers one page on equal visual scores, then page services and trace ID", () => {
- const spans = [span("a", 0, 100), span("b", 30, 30), span("c", 70, 30)];
- const single = scoreTracePage(trace(spans))!;
- const multiple = scoreTracePage(trace([...spans, ...Array.from({ length: TRACE_PAGE_SIZE }, (_, i) => span(`extra-${i}`, 30, 1))]))!;
- expect(single.coverage + single.startSpread).toBe(multiple.coverage + multiple.startSpread);
- expect(compareTracePages(single, multiple)).toBeLessThan(0);
- const moreServices = scoreTracePage(trace([...spans, span("d", 40, 1)]))!;
- expect(compareTracePages(moreServices, single)).toBeLessThan(0);
- const earlierID = scoreTracePage(trace(spans, { trace_id: "aaa" }))!;
- const laterID = scoreTracePage(trace(spans, { trace_id: "zzz" }))!;
- expect([laterID, earlierID].sort(compareTracePages)).toEqual([earlierID, laterID]);
- expect(compareTracePages(single, single)).toBe(0);
-});
diff --git a/ui/host/e2e/landing-trace-support.ts b/ui/host/e2e/landing-trace-support.ts
deleted file mode 100644
index 4196d2115..000000000
--- a/ui/host/e2e/landing-trace-support.ts
+++ /dev/null
@@ -1,47 +0,0 @@
-import type { TraceDetail } from "../../contracts";
-import { pageItems } from "../src/dashboards/trace/pagination";
-
-interface TracePageScore {
- traceID: string;
- coverage: number;
- startSpread: number;
- serviceCount: number;
- fitsOnePage: boolean;
-}
-
-export function scoreTracePage(trace: TraceDetail): TracePageScore | null {
- if (trace.truncated || trace.spans.length !== trace.span_count || trace.has_error
- || trace.spans.some(span => span.status.toUpperCase().includes("ERROR"))
- || !Number.isFinite(trace.duration_ms) || trace.duration_ms <= 0) return null;
-
- const firstPage = pageItems(trace.spans);
- const serviceCount = new Set(firstPage.map(span => span.service)).size;
- if (serviceCount < 3) return null;
-
- const traceStart = Math.min(...trace.spans.map(span => new Date(span.start).valueOf()));
- const intervals = firstPage.map(span => {
- const start = new Date(span.start).valueOf() - traceStart;
- return { start, end: start + span.duration_ms };
- }).sort((a, b) => a.start - b.start);
- let covered = 0, coveredUntil = 0;
- for (const { start, end } of intervals) {
- covered += Math.max(0, end - Math.max(start, coveredUntil));
- coveredUntil = Math.max(coveredUntil, end);
- }
- return {
- traceID: trace.trace_id,
- coverage: covered / trace.duration_ms,
- startSpread: (intervals.at(-1)!.start - intervals[0].start) / trace.duration_ms,
- serviceCount,
- fitsOnePage: firstPage.length === trace.spans.length,
- };
-}
-
-export function compareTracePages(a: TracePageScore, b: TracePageScore): number {
- // Equal weight for occupied time and distributed starts: a long root alone
- // can fill the timeline while the other seven bars cluster at its left edge.
- return (b.coverage + b.startSpread) - (a.coverage + a.startSpread)
- || Number(b.fitsOnePage) - Number(a.fitsOnePage)
- || b.serviceCount - a.serviceCount
- || a.traceID.localeCompare(b.traceID);
-}
diff --git a/ui/host/playwright.config.ts b/ui/host/playwright.config.ts
index b39df7a85..eb8e5f22a 100644
--- a/ui/host/playwright.config.ts
+++ b/ui/host/playwright.config.ts
@@ -10,7 +10,7 @@ export default defineConfig({
retries: 0,
forbidOnly: Boolean(process.env.CI),
timeout: 120_000,
- globalTimeout: 12 * 60_000,
+ globalTimeout: (process.env.FANOUT_LANDING_RECORDINGS === "1" ? 40 : 12) * 60_000,
expect: { timeout: 30_000 },
reporter: [["list"], ["./e2e/failure-report.ts", { outputFolder: "playwright-report" }]],
outputDir: "test-results",