Skip to content

View

Source: src/Axiom/View.ts

An Axiom saved view — a named, shareable APL query. Useful for building starter dashboards, providing canned “open in Axiom” links from your app, or pinning common investigations the team revisits.

The path identifier is name. Renaming a view triggers a replacement (the old one is deleted, a new one is created).

Recent errors across one dataset

yield* Axiom.View("recent-errors", {
name: "recent-errors",
description: "Last 100 5xx responses",
datasets: ["my-app-traces"],
aplQuery: `
['my-app-traces']
| where status >= 500
| order by _time desc
| take 100
`,
});

Cross-dataset join (logs + traces by trace_id)

yield* Axiom.View("trace-with-logs", {
name: "trace-with-logs",
datasets: ["my-app-traces", "my-app-logs"],
aplQuery: `
['my-app-traces']
| where duration_ms > 1000
| join kind=leftouter (['my-app-logs']) on trace_id
`,
});