The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { defineScene } from "../capture/scene.ts"; |
| 2 | |
| 3 | export default defineScene({ |
| 4 | title: "OpenTelemetry to Axiom", |
| 5 | chapter: "07-telemetry", |
| 6 | notes: |
| 7 | "Axiom datasets for traces and logs and an ingest token that can write to those two datasets and nothing else, all named after the stage. Axiom.Telemetry is a Layer: providing it is the whole wiring. Spans come from code that is already Effect: links.create, links.get, clicks.record, plus the HTTP server and SQL spans.", |
| 8 | async run(s) { |
| 9 | await s.sync({ |
| 10 | except: ["src/Observability.ts", "src/Api.ts", "src/Links.ts", "alchemy.run.ts"], |
| 11 | }); |
| 12 | await s.editor.show("src/Observability.ts"); |
| 13 | s.pause(1); |
| 14 | await s.editor.show("src/Api.ts"); |
| 15 | s.pause(0.5); |
| 16 | await s.editor.show("src/Links.ts"); |
| 17 | s.pause(0.5); |
| 18 | await s.editor.show("alchemy.run.ts"); |
| 19 | s.pause(1); |
| 20 | |
| 21 | await s.terminal(async (t) => { |
| 22 | await t.waitDev({ timeout: 240_000 }); |
| 23 | await t.sleep(800); |
| 24 | await t.run( |
| 25 | "deploy", |
| 26 | `for i in $(seq 5); do curl -s -o /dev/null localhost:1337/$CODE; done`, |
| 27 | ); |
| 28 | }); |
| 29 | |
| 30 | await s.diagram({ |
| 31 | stage: `dev_${process.env.USER}`, |
| 32 | nodes: ["Traces", "Logs", "Ingest"], |
| 33 | }); |
| 34 | s.pause(1); |
| 35 | |
| 36 | await s.terminal(async (t) => { |
| 37 | await t.run("test", "pnpm test", { |
| 38 | until: /Ran \d+ tests? across[\s\S]*❯\s*$/, |
| 39 | timeout: 300_000, |
| 40 | }); |
| 41 | await t.sleep(1500); |
| 42 | }); |
| 43 | }, |
| 44 | }); |