[{"data":1,"prerenderedAt":4595},["ShallowReactive",2],{"navigation_docs":3,"-use-cases-eve":538,"-use-cases-eve-surround":4590},[4,30,80,128,308,440,499],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Start","\u002Fstart","1.start",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Why start with evlog","\u002Fstart\u002Fwhy-evlog","1.start\u002F2.why-evlog","i-lucide-rocket",{"title":20,"path":21,"stem":22,"icon":23},"Installation","\u002Fstart\u002Finstallation","1.start\u002F3.installation","i-lucide-download",{"title":25,"path":26,"stem":27,"icon":28},"Quick Start","\u002Fstart\u002Fquick-start","1.start\u002F4.quick-start","i-lucide-zap",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Learn","\u002Flearn","2.learn",[35,40,45,50,55,60,65,70,75],{"title":36,"path":37,"stem":38,"icon":39},"Overview","\u002Flearn\u002Foverview","2.learn\u002F0.overview","i-lucide-list",{"title":41,"path":42,"stem":43,"icon":44},"Simple Logging","\u002Flearn\u002Fsimple-logging","2.learn\u002F1.simple-logging","i-lucide-terminal",{"title":46,"path":47,"stem":48,"icon":49},"Wide Events","\u002Flearn\u002Fwide-events","2.learn\u002F2.wide-events","i-lucide-layers",{"title":51,"path":52,"stem":53,"icon":54},"Structured Errors","\u002Flearn\u002Fstructured-errors","2.learn\u002F3.structured-errors","i-lucide-shield-alert",{"title":56,"path":57,"stem":58,"icon":59},"Lifecycle","\u002Flearn\u002Flifecycle","2.learn\u002F4.lifecycle","i-lucide-arrow-right-left",{"title":61,"path":62,"stem":63,"icon":64},"Sampling","\u002Flearn\u002Fsampling","2.learn\u002F5.sampling","i-lucide-filter",{"title":66,"path":67,"stem":68,"icon":69},"Auto-Redaction","\u002Flearn\u002Fredaction","2.learn\u002F6.redaction","i-lucide-eye-off",{"title":71,"path":72,"stem":73,"icon":74},"Typed Fields","\u002Flearn\u002Ftyped-fields","2.learn\u002F7.typed-fields","i-simple-icons-typescript",{"title":76,"path":77,"stem":78,"icon":79},"Catalogs","\u002Flearn\u002Fcatalogs","2.learn\u002F8.catalogs","i-lucide-book-open",{"title":81,"path":82,"stem":83,"children":84,"page":29},"CLI","\u002Fcli","3.cli",[85,88,93,98,103,108,113,118,123],{"title":36,"path":86,"stem":87,"icon":44},"\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":89,"path":90,"stem":91,"icon":92},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":94,"path":95,"stem":96,"icon":97},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":99,"path":100,"stem":101,"icon":102},"Rules","\u002Fcli\u002Frules","3.cli\u002F3.rules","i-lucide-list-checks",{"title":104,"path":105,"stem":106,"icon":107},"Scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring","i-lucide-gauge",{"title":109,"path":110,"stem":111,"icon":112},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":114,"path":115,"stem":116,"icon":117},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":119,"path":120,"stem":121,"icon":122},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":124,"path":125,"stem":126,"icon":127},"agents","\u002Fcli\u002Fagents","3.cli\u002F8.agents","i-lucide-bot",{"title":129,"path":130,"stem":131,"children":132,"page":29},"Integrate","\u002Fintegrate","4.integrate",[133,137,220],{"title":36,"path":134,"stem":135,"icon":136},"\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":138,"path":139,"stem":140,"children":141,"page":29},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[142,145,175,200],{"title":36,"path":143,"stem":144,"icon":39},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview",{"title":146,"path":147,"stem":148,"children":149,"page":29},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[150,155,160,165,170],{"title":151,"path":152,"stem":153,"icon":154},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":156,"path":157,"stem":158,"icon":159},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog","i-simple-icons-posthog",{"title":161,"path":162,"stem":163,"icon":164},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F03.sentry","i-simple-icons-sentry",{"title":166,"path":167,"stem":168,"icon":169},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F04.better-stack","i-simple-icons-betterstack",{"title":171,"path":172,"stem":173,"icon":174},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F05.datadog","i-simple-icons-datadog",{"title":176,"path":177,"stem":178,"children":179,"page":29},"Cloud or Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fhybrid","4.integrate\u002Fadapters\u002Fhybrid",[180,185,190,195],{"title":181,"path":182,"stem":183,"icon":184},"Grafana Loki","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki","4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki","i-simple-icons-grafana",{"title":186,"path":187,"stem":188,"icon":189},"ClickHouse","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fclickhouse","4.integrate\u002Fadapters\u002Fhybrid\u002F02.clickhouse","i-simple-icons-clickhouse",{"title":191,"path":192,"stem":193,"icon":194},"OTLP","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fotlp","4.integrate\u002Fadapters\u002Fhybrid\u002F03.otlp","i-simple-icons-opentelemetry",{"title":196,"path":197,"stem":198,"icon":199},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fhyperdx","4.integrate\u002Fadapters\u002Fhybrid\u002F04.hyperdx","i-custom-hyperdx",{"title":201,"path":202,"stem":203,"children":204,"page":29},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[205,210,215],{"title":206,"path":207,"stem":208,"icon":209},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":211,"path":212,"stem":213,"icon":214},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":216,"path":217,"stem":218,"icon":219},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":221,"path":222,"stem":223,"children":224,"page":29},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[225,229,234,239,244,249,254,259,264,269,274,279,284,289,293,298,303],{"title":36,"path":226,"stem":227,"icon":228},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":230,"path":231,"stem":232,"icon":233},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":235,"path":236,"stem":237,"icon":238},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":240,"path":241,"stem":242,"icon":243},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":245,"path":246,"stem":247,"icon":248},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":250,"path":251,"stem":252,"icon":253},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":255,"path":256,"stem":257,"icon":258},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":260,"path":261,"stem":262,"icon":263},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":265,"path":266,"stem":267,"icon":268},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":270,"path":271,"stem":272,"icon":273},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":275,"path":276,"stem":277,"icon":278},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":280,"path":281,"stem":282,"icon":283},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":285,"path":286,"stem":287,"icon":288},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":290,"path":291,"stem":292,"icon":74},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":294,"path":295,"stem":296,"icon":297},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":299,"path":300,"stem":301,"icon":302},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":304,"path":305,"stem":306,"icon":307},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":309,"path":310,"stem":311,"children":312,"page":29},"Use Cases","\u002Fuse-cases","5.use-cases",[313,316,321,350,377,409,430,435],{"title":36,"path":314,"stem":315,"icon":102},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":317,"path":318,"stem":319,"icon":320},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":322,"icon":323,"path":324,"stem":325,"children":326,"page":29},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[327,330,335,340,345],{"title":36,"path":328,"stem":329,"icon":39},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":331,"path":332,"stem":333,"icon":334},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":336,"path":337,"stem":338,"icon":339},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":341,"path":342,"stem":343,"icon":344},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":346,"path":347,"stem":348,"icon":349},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":351,"icon":352,"path":353,"stem":354,"children":355,"page":29},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[356,359,364,369,373],{"title":36,"path":357,"stem":358,"icon":39},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":360,"path":361,"stem":362,"icon":363},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":365,"path":366,"stem":367,"icon":368},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":370,"path":371,"stem":372,"icon":320},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":374,"path":375,"stem":376,"icon":107},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance",{"title":378,"icon":379,"path":380,"stem":381,"children":382,"page":29},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[383,386,391,396,401,405],{"title":36,"path":384,"stem":385,"icon":39},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":387,"path":388,"stem":389,"icon":390},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":392,"path":393,"stem":394,"icon":395},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":397,"path":398,"stem":399,"icon":400},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":402,"path":403,"stem":404,"icon":379},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":406,"path":407,"stem":408,"icon":79},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes",{"title":346,"icon":107,"path":410,"stem":411,"children":412,"page":29},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[413,416,421,426],{"title":36,"path":414,"stem":415,"icon":39},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":417,"path":418,"stem":419,"icon":420},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":422,"path":423,"stem":424,"icon":425},"Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest","i-lucide-server",{"title":427,"path":428,"stem":429,"icon":79},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":431,"path":432,"stem":433,"icon":434},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":436,"path":437,"stem":438,"icon":439},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve","i-custom-eve",{"title":441,"path":442,"stem":443,"children":444,"page":29},"Extend","\u002Fextend","6.extend",[445,449,454,459,463,468,472,476,480,484,489,494],{"title":36,"path":446,"stem":447,"icon":448},"\u002Fextend\u002Foverview","6.extend\u002F0.overview","i-lucide-blocks",{"title":450,"path":451,"stem":452,"icon":453},"Stream","\u002Fextend\u002Fstream","6.extend\u002F1.stream","i-lucide-radio-tower",{"title":455,"path":456,"stem":457,"icon":458},"Custom framework","\u002Fextend\u002Fcustom-framework","6.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":460,"path":461,"stem":462,"icon":453},"Diagnostics channel","\u002Fextend\u002Fdiagnostics-channel","6.extend\u002F11.diagnostics-channel",{"title":464,"path":465,"stem":466,"icon":467},"FS reader","\u002Fextend\u002Ffs-reader","6.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":406,"path":469,"stem":470,"icon":471},"\u002Fextend\u002Fconsumer-recipes","6.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":473,"path":474,"stem":475,"icon":448},"Plugins","\u002Fextend\u002Fplugins","6.extend\u002F4.plugins",{"title":477,"path":478,"stem":479,"icon":434},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","6.extend\u002F5.custom-enrichers",{"title":481,"path":482,"stem":483,"icon":64},"Tail sampling","\u002Fextend\u002Ftail-sampling","6.extend\u002F6.tail-sampling",{"title":485,"path":486,"stem":487,"icon":488},"Identity headers","\u002Fextend\u002Fidentity-headers","6.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":490,"path":491,"stem":492,"icon":493},"Custom drains","\u002Fextend\u002Fcustom-drains","6.extend\u002F8.custom-drains","i-lucide-share-2",{"title":495,"path":496,"stem":497,"icon":498},"Drain pipeline","\u002Fextend\u002Fdrain-pipeline","6.extend\u002F9.drain-pipeline","i-lucide-workflow",{"title":427,"path":500,"stem":501,"children":502,"page":29},"\u002Freference","7.reference",[503,507,512,515,520,524,529,533],{"title":36,"path":504,"stem":505,"icon":506},"\u002Freference\u002Foverview","7.reference\u002F0.overview","i-lucide-book-marked",{"title":508,"path":509,"stem":510,"icon":511},"Configuration","\u002Freference\u002Fconfiguration","7.reference\u002F1.configuration","i-lucide-settings",{"title":374,"path":513,"stem":514,"icon":107},"\u002Freference\u002Fperformance","7.reference\u002F2.performance",{"title":516,"path":517,"stem":518,"icon":519},"Vite Plugin","\u002Freference\u002Fvite-plugin","7.reference\u002F3.vite-plugin","i-custom-vite",{"title":521,"path":522,"stem":523,"icon":379},"Best Practices","\u002Freference\u002Fbest-practices","7.reference\u002F4.best-practices",{"title":525,"path":526,"stem":527,"icon":528},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","7.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":530,"path":531,"stem":532,"icon":434},"Agent Skills","\u002Freference\u002Fagent-skills","7.reference\u002F6.agent-skills",{"title":534,"path":535,"stem":536,"icon":537},"Cost","\u002Freference\u002Fcost","7.reference\u002F7.cost","i-lucide-receipt",{"id":539,"title":436,"body":540,"description":4579,"extension":4580,"links":4581,"meta":4586,"navigation":4587,"path":437,"seo":4588,"stem":438,"__hash__":4589},"docs\u002F5.use-cases\u002F5.eve.md",{"type":541,"value":542,"toc":4558},"minimark",[543,575,593,638,643,714,717,722,802,806,813,1019,1030,1034,1060,1069,1350,1373,1377,1414,1418,1421,2104,2107,2490,2533,2537,2540,2770,2774,2780,2818,2834,2845,2947,2965,2969,2985,2995,3520,3533,3543,3576,3583,3586,3681,3688,3692,3695,3949,4015,4018,4163,4166,4172,4427,4431,4454,4458,4498,4520,4524,4554],[544,545,546,552,553,557,558,561,562,566,567,570,571,574],"p",{},[547,548,436],"a",{"href":549,"rel":550},"https:\u002F\u002Feve.dev\u002Fdocs\u002Fintroduction",[551],"nofollow"," ships built-in observability: ",[554,555,556],"strong",{},"Agent Runs"," on Vercel and optional ",[554,559,560],{},"OpenTelemetry"," spans via ",[563,564,565],"code",{},"agent\u002Finstrumentation.ts",". ",[563,568,569],{},"evlog\u002Feve"," adds a third layer: ",[554,572,573],{},"exportable wide events"," per turn with your full evlog pipeline (drains, enrichers, tail sampling, audit).",[576,577,579,581,582,585,586,588,589,592],"callout",{"color":578,"icon":13},"info",[563,580,569],{}," requires ",[554,583,584],{},"eve 0.30 or later",". eve is still in beta and stream event shapes may change before GA, so pin ",[563,587,436],{}," and ",[563,590,591],{},"evlog"," versions in production agents.",[594,595,598,601,626],"prompt",{":actions":596,"description":597,"icon":439},"[\"copy\",\"cursor\",\"claude\"]","Add evlog wide events to my eve agent",[544,599,600],{},"Add evlog wide events to my eve agent.",[602,603,604,608,611,614,617,620,623],"ul",{},[605,606,607],"li",{},"Install evlog: pnpm add evlog",[605,609,610],{},"Create agent\u002Fhooks\u002Fevlog.ts with defineEvlogHook from 'evlog\u002Feve'",[605,612,613],{},"Pass drain, enrich, and keep options (same as HTTP middleware integrations)",[605,615,616],{},"In tools, import useLogger from 'evlog\u002Feve' and call useLogger() inside execute(). The turn logger is bound via AsyncLocalStorage when defineEvlogHook() is registered; pass ctx only if ALS is unavailable in your runtime",[605,618,619],{},"User message content is omitted by default (message: 'omit'); use 'preview' or 'full' only after reviewing PII policy",[605,621,622],{},"Optionally add agent\u002Finstrumentation.ts with defineEvlogInstrumentation from 'evlog\u002Feve' to join OTel spans to the wide events",[605,624,625],{},"Keep eve Agent Runs. evlog\u002Feve is additive",[544,627,628,629,633,634],{},"Docs: ",[547,630,631],{"href":631,"rel":632},"https:\u002F\u002Fwww.evlog.dev\u002Fuse-cases\u002Feve",[551],"\nAdapters: ",[547,635,636],{"href":636,"rel":637},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fadapters\u002Foverview",[551],[639,640,642],"h2",{"id":641},"when-to-use-what","When to use what",[644,645,646,659],"table",{},[647,648,649],"thead",{},[650,651,652,656],"tr",{},[653,654,655],"th",{},"Need",[653,657,658],{},"Use",[660,661,662,674,686,697],"tbody",{},[650,663,664,668],{},[665,666,667],"td",{},"Debug a session in Vercel",[665,669,670,671,673],{},"eve ",[554,672,556],{}," (automatic)",[650,675,676,679],{},[665,677,678],{},"Span-level traces in Datadog \u002F Honeycomb",[665,680,670,681,685],{},[554,682,683],{},[563,684,565],{}," + OTel exporter",[650,687,688,691],{},[665,689,690],{},"Wide events to Axiom \u002F Better Stack \u002F FS, billing, audit, tail sampling",[665,692,693],{},[554,694,695],{},[563,696,569],{},[650,698,699,702],{},[665,700,701],{},"Jumping from a span to its wide event, and back",[665,703,704,709,710],{},[554,705,706],{},[563,707,708],{},"defineEvlogInstrumentation()"," — ",[547,711,713],{"href":712},"#correlate-traces-with-wide-events","below",[639,715,25],{"id":716},"quick-start",[718,719,721],"h3",{"id":720},"_1-install","1. Install",[723,724,725,753,769,785],"code-group",{},[726,727,733],"pre",{"className":728,"code":729,"filename":730,"language":731,"meta":732,"style":732},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm add evlog eve\n","pnpm","bash","",[563,734,735],{"__ignoreMap":732},[736,737,740,743,747,750],"span",{"class":738,"line":739},"line",1,[736,741,730],{"class":742},"sBMFI",[736,744,746],{"class":745},"sfazB"," add",[736,748,749],{"class":745}," evlog",[736,751,752],{"class":745}," eve\n",[726,754,757],{"className":728,"code":755,"filename":756,"language":731,"meta":732,"style":732},"bun add evlog eve\n","bun",[563,758,759],{"__ignoreMap":732},[736,760,761,763,765,767],{"class":738,"line":739},[736,762,756],{"class":742},[736,764,746],{"class":745},[736,766,749],{"class":745},[736,768,752],{"class":745},[726,770,773],{"className":728,"code":771,"filename":772,"language":731,"meta":732,"style":732},"yarn add evlog eve\n","yarn",[563,774,775],{"__ignoreMap":732},[736,776,777,779,781,783],{"class":738,"line":739},[736,778,772],{"class":742},[736,780,746],{"class":745},[736,782,749],{"class":745},[736,784,752],{"class":745},[726,786,789],{"className":728,"code":787,"filename":788,"language":731,"meta":732,"style":732},"npm install evlog eve\n","npm",[563,790,791],{"__ignoreMap":732},[736,792,793,795,798,800],{"class":738,"line":739},[736,794,788],{"class":742},[736,796,797],{"class":745}," install",[736,799,749],{"class":745},[736,801,752],{"class":745},[718,803,805],{"id":804},"_2-add-the-hook","2. Add the hook",[544,807,808,809,812],{},"Create ",[563,810,811],{},"agent\u002Fhooks\u002Fevlog.ts",":",[726,814,818],{"className":815,"code":816,"filename":811,"language":817,"meta":732,"style":732},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { defineEvlogHook } from 'evlog\u002Feve'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\n\nexport default defineEvlogHook({\n  init: { env: { service: 'my-agent' } },\n  drain: createAxiomDrain(),\n  enrich: (ctx) => {\n    ctx.event.region = process.env.VERCEL_REGION\n  },\n})\n","typescript",[563,819,820,848,869,876,894,930,946,971,1004,1010],{"__ignoreMap":732},[736,821,822,826,830,834,837,840,843,845],{"class":738,"line":739},[736,823,825],{"class":824},"s7zQu","import",[736,827,829],{"class":828},"sMK4o"," {",[736,831,833],{"class":832},"sTEyZ"," defineEvlogHook",[736,835,836],{"class":828}," }",[736,838,839],{"class":824}," from",[736,841,842],{"class":828}," '",[736,844,569],{"class":745},[736,846,847],{"class":828},"'\n",[736,849,851,853,855,858,860,862,864,867],{"class":738,"line":850},2,[736,852,825],{"class":824},[736,854,829],{"class":828},[736,856,857],{"class":832}," createAxiomDrain",[736,859,836],{"class":828},[736,861,839],{"class":824},[736,863,842],{"class":828},[736,865,866],{"class":745},"evlog\u002Faxiom",[736,868,847],{"class":828},[736,870,872],{"class":738,"line":871},3,[736,873,875],{"emptyLinePlaceholder":874},true,"\n",[736,877,879,882,885,888,891],{"class":738,"line":878},4,[736,880,881],{"class":824},"export",[736,883,884],{"class":824}," default",[736,886,833],{"class":887},"s2Zo4",[736,889,890],{"class":832},"(",[736,892,893],{"class":828},"{\n",[736,895,897,901,903,905,908,910,912,915,917,919,922,925,927],{"class":738,"line":896},5,[736,898,900],{"class":899},"swJcz","  init",[736,902,812],{"class":828},[736,904,829],{"class":828},[736,906,907],{"class":899}," env",[736,909,812],{"class":828},[736,911,829],{"class":828},[736,913,914],{"class":899}," service",[736,916,812],{"class":828},[736,918,842],{"class":828},[736,920,921],{"class":745},"my-agent",[736,923,924],{"class":828},"'",[736,926,836],{"class":828},[736,928,929],{"class":828}," },\n",[736,931,933,936,938,940,943],{"class":738,"line":932},6,[736,934,935],{"class":899},"  drain",[736,937,812],{"class":828},[736,939,857],{"class":887},[736,941,942],{"class":832},"()",[736,944,945],{"class":828},",\n",[736,947,949,952,954,957,961,964,968],{"class":738,"line":948},7,[736,950,951],{"class":887},"  enrich",[736,953,812],{"class":828},[736,955,956],{"class":828}," (",[736,958,960],{"class":959},"sHdIc","ctx",[736,962,963],{"class":828},")",[736,965,967],{"class":966},"spNyl"," =>",[736,969,970],{"class":828}," {\n",[736,972,974,977,980,983,985,988,991,994,996,999,1001],{"class":738,"line":973},8,[736,975,976],{"class":832},"    ctx",[736,978,979],{"class":828},".",[736,981,982],{"class":832},"event",[736,984,979],{"class":828},[736,986,987],{"class":832},"region",[736,989,990],{"class":828}," =",[736,992,993],{"class":832}," process",[736,995,979],{"class":828},[736,997,998],{"class":832},"env",[736,1000,979],{"class":828},[736,1002,1003],{"class":832},"VERCEL_REGION\n",[736,1005,1007],{"class":738,"line":1006},9,[736,1008,1009],{"class":828},"  },\n",[736,1011,1013,1016],{"class":738,"line":1012},10,[736,1014,1015],{"class":828},"}",[736,1017,1018],{"class":832},")\n",[544,1020,1021,1022,1025,1026,1029],{},"eve auto-discovers hook files under ",[563,1023,1024],{},"agent\u002Fhooks\u002F",". No HTTP middleware, because the unit of work is an agent ",[554,1027,1028],{},"turn",", not a request.",[718,1031,1033],{"id":1032},"_3-log-business-context-from-tools","3. Log business context from tools",[544,1035,1036,1039,1040,1043,1044,1047,1048,1051,1052,1055,1056,1059],{},[563,1037,1038],{},"defineEvlogHook()"," binds the turn logger via ",[554,1041,1042],{},"AsyncLocalStorage"," on ",[563,1045,1046],{},"turn.started",". Inside tool ",[563,1049,1050],{},"execute()"," handlers, call ",[563,1053,1054],{},"useLogger()"," with no arguments, the same ergonomics as ",[563,1057,1058],{},"useLogger(event)"," in Nuxt or Hono.",[544,1061,1062,1063,1068],{},"In the ",[547,1064,1067],{"href":1065,"rel":1066},"https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog\u002Ftree\u002Fmain\u002Fexamples\u002Feve",[551],"example agent",", support tools attach customer and order context as the agent works a refund:",[726,1070,1073],{"className":815,"code":1071,"filename":1072,"language":817,"meta":732,"style":732},"import { defineTool } from 'eve\u002Ftools'\nimport { useLogger } from 'evlog\u002Feve'\nimport { z } from 'zod'\n\nexport default defineTool({\n  description: 'Look up an order by id.',\n  inputSchema: z.object({ orderId: z.string() }),\n  async execute({ orderId }) {\n    const order = await fetchOrder(orderId)\n    const log = useLogger()\n    log.set({ order: { id: order.id, amount: order.amount, status: order.status } })\n    return order\n  },\n})\n","agent\u002Ftools\u002Flookup_order.ts",[563,1074,1075,1095,1114,1134,1138,1150,1166,1206,1224,1247,1261,1329,1338,1343],{"__ignoreMap":732},[736,1076,1077,1079,1081,1084,1086,1088,1090,1093],{"class":738,"line":739},[736,1078,825],{"class":824},[736,1080,829],{"class":828},[736,1082,1083],{"class":832}," defineTool",[736,1085,836],{"class":828},[736,1087,839],{"class":824},[736,1089,842],{"class":828},[736,1091,1092],{"class":745},"eve\u002Ftools",[736,1094,847],{"class":828},[736,1096,1097,1099,1101,1104,1106,1108,1110,1112],{"class":738,"line":850},[736,1098,825],{"class":824},[736,1100,829],{"class":828},[736,1102,1103],{"class":832}," useLogger",[736,1105,836],{"class":828},[736,1107,839],{"class":824},[736,1109,842],{"class":828},[736,1111,569],{"class":745},[736,1113,847],{"class":828},[736,1115,1116,1118,1120,1123,1125,1127,1129,1132],{"class":738,"line":871},[736,1117,825],{"class":824},[736,1119,829],{"class":828},[736,1121,1122],{"class":832}," z",[736,1124,836],{"class":828},[736,1126,839],{"class":824},[736,1128,842],{"class":828},[736,1130,1131],{"class":745},"zod",[736,1133,847],{"class":828},[736,1135,1136],{"class":738,"line":878},[736,1137,875],{"emptyLinePlaceholder":874},[736,1139,1140,1142,1144,1146,1148],{"class":738,"line":896},[736,1141,881],{"class":824},[736,1143,884],{"class":824},[736,1145,1083],{"class":887},[736,1147,890],{"class":832},[736,1149,893],{"class":828},[736,1151,1152,1155,1157,1159,1162,1164],{"class":738,"line":932},[736,1153,1154],{"class":899},"  description",[736,1156,812],{"class":828},[736,1158,842],{"class":828},[736,1160,1161],{"class":745},"Look up an order by id.",[736,1163,924],{"class":828},[736,1165,945],{"class":828},[736,1167,1168,1171,1173,1175,1177,1180,1182,1185,1188,1190,1192,1194,1197,1200,1202,1204],{"class":738,"line":948},[736,1169,1170],{"class":899},"  inputSchema",[736,1172,812],{"class":828},[736,1174,1122],{"class":832},[736,1176,979],{"class":828},[736,1178,1179],{"class":887},"object",[736,1181,890],{"class":832},[736,1183,1184],{"class":828},"{",[736,1186,1187],{"class":899}," orderId",[736,1189,812],{"class":828},[736,1191,1122],{"class":832},[736,1193,979],{"class":828},[736,1195,1196],{"class":887},"string",[736,1198,1199],{"class":832},"() ",[736,1201,1015],{"class":828},[736,1203,963],{"class":832},[736,1205,945],{"class":828},[736,1207,1208,1211,1214,1217,1219,1222],{"class":738,"line":973},[736,1209,1210],{"class":966},"  async",[736,1212,1213],{"class":899}," execute",[736,1215,1216],{"class":828},"({",[736,1218,1187],{"class":959},[736,1220,1221],{"class":828}," })",[736,1223,970],{"class":828},[736,1225,1226,1229,1232,1234,1237,1240,1242,1245],{"class":738,"line":1006},[736,1227,1228],{"class":966},"    const",[736,1230,1231],{"class":832}," order",[736,1233,990],{"class":828},[736,1235,1236],{"class":824}," await",[736,1238,1239],{"class":887}," fetchOrder",[736,1241,890],{"class":899},[736,1243,1244],{"class":832},"orderId",[736,1246,1018],{"class":899},[736,1248,1249,1251,1254,1256,1258],{"class":738,"line":1012},[736,1250,1228],{"class":966},[736,1252,1253],{"class":832}," log",[736,1255,990],{"class":828},[736,1257,1103],{"class":887},[736,1259,1260],{"class":899},"()\n",[736,1262,1264,1267,1269,1272,1274,1276,1278,1280,1282,1285,1287,1289,1291,1294,1297,1300,1302,1304,1306,1309,1311,1314,1316,1318,1320,1323,1325,1327],{"class":738,"line":1263},11,[736,1265,1266],{"class":832},"    log",[736,1268,979],{"class":828},[736,1270,1271],{"class":887},"set",[736,1273,890],{"class":899},[736,1275,1184],{"class":828},[736,1277,1231],{"class":899},[736,1279,812],{"class":828},[736,1281,829],{"class":828},[736,1283,1284],{"class":899}," id",[736,1286,812],{"class":828},[736,1288,1231],{"class":832},[736,1290,979],{"class":828},[736,1292,1293],{"class":832},"id",[736,1295,1296],{"class":828},",",[736,1298,1299],{"class":899}," amount",[736,1301,812],{"class":828},[736,1303,1231],{"class":832},[736,1305,979],{"class":828},[736,1307,1308],{"class":832},"amount",[736,1310,1296],{"class":828},[736,1312,1313],{"class":899}," status",[736,1315,812],{"class":828},[736,1317,1231],{"class":832},[736,1319,979],{"class":828},[736,1321,1322],{"class":832},"status",[736,1324,836],{"class":828},[736,1326,836],{"class":828},[736,1328,1018],{"class":899},[736,1330,1332,1335],{"class":738,"line":1331},12,[736,1333,1334],{"class":824},"    return",[736,1336,1337],{"class":832}," order\n",[736,1339,1341],{"class":738,"line":1340},13,[736,1342,1009],{"class":828},[736,1344,1346,1348],{"class":738,"line":1345},14,[736,1347,1015],{"class":828},[736,1349,1018],{"class":832},[576,1351,1353,1368],{"color":1352,"icon":136},"neutral",[544,1354,1355,1358,1359,709,1361,1364,1365,1367],{},[554,1356,1357],{},"Resolution:"," pass the eve tool ",[563,1360,960],{},[563,1362,1363],{},"useLogger(ctx)"," — when AsyncLocalStorage does not propagate, such as separate hook and tool bundles. With a standard eve agent layout and ",[563,1366,811],{}," registered, you should not need it.",[544,1369,1370,1372],{},[563,1371,1054],{}," never throws: when it cannot reach the turn's logger it warns once and returns a logger that accepts every call and emits nothing. A turn resumed in another process after a step boundary is the common case, and losing enrichment must never fail the tool that was being enriched. The turn keeps running; only its extra fields are dropped.",[718,1374,1376],{"id":1375},"_4-nextjs-web-chat-optional","4. Next.js web chat (optional)",[544,1378,1379,1380,1383,1384,1387,1388,1391,1392,1387,1395,1398,1399,1402,1403,1406,1407,1410,1411,979],{},"Wrap ",[563,1381,1382],{},"next.config.ts"," with ",[563,1385,1386],{},"withEve()"," from ",[563,1389,1390],{},"eve\u002Fnext"," and use ",[563,1393,1394],{},"useEveAgent()",[563,1396,1397],{},"eve\u002Freact"," in your app. eve starts alongside ",[563,1400,1401],{},"next dev"," and proxies ",[563,1404,1405],{},"\u002Feve\u002Fv1\u002F*"," on the same origin, so tool calls, approvals, and ",[563,1408,1409],{},"ask_question"," work out of the box. See the ",[547,1412,1067],{"href":1065,"rel":1413},[551],[639,1415,1417],{"id":1416},"wide-event-shape","Wide event shape",[544,1419,1420],{},"Each completed turn emits one event:",[726,1422,1427],{"className":1423,"code":1424,"filename":1425,"language":1426,"meta":732,"style":732},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"method\": \"EVE\",\n  \"path\": \"\u002Fsessions\u002Fsess_abc\u002Fturns\u002Fturn_0\",\n  \"status\": 200,\n  \"duration\": \"7.9s\",\n  \"durationMs\": 7903,\n  \"service\": \"clearbill-support-agent\",\n  \"eve\": {\n    \"sessionId\": \"sess_abc\",\n    \"turnId\": \"turn_0\",\n    \"turnSequence\": 0,\n    \"phase\": \"awaiting-approval\",\n    \"sessionTurns\": 1\n  },\n  \"customer\": { \"slug\": \"acme-corp\", \"plan\": \"enterprise\" },\n  \"order\": { \"id\": \"4821\", \"amount\": 890, \"currency\": \"USD\" },\n  \"approval\": { \"status\": \"pending\", \"tool\": \"issue_refund\" },\n  \"ai\": {\n    \"model\": \"deepseek\u002Fdeepseek-v4-flash\",\n    \"provider\": \"deepseek\",\n    \"calls\": 2,\n    \"steps\": 2,\n    \"inputTokens\": 11724,\n    \"outputTokens\": 282,\n    \"finishReason\": \"tool-calls\",\n    \"tools\": [\n      { \"name\": \"lookup_customer\", \"durationMs\": 26, \"success\": true, \"inputTokens\": 8900 },\n      { \"name\": \"lookup_order\", \"durationMs\": 13, \"success\": true }\n    ]\n  }\n}\n","Wide Event — turn awaiting approval","json",[563,1428,1429,1433,1456,1476,1492,1512,1528,1548,1560,1581,1601,1617,1637,1651,1655,1705,1767,1816,1830,1851,1872,1889,1905,1922,1939,1960,1975,2037,2086,2092,2098],{"__ignoreMap":732},[736,1430,1431],{"class":738,"line":739},[736,1432,893],{"class":828},[736,1434,1435,1438,1441,1444,1446,1449,1452,1454],{"class":738,"line":850},[736,1436,1437],{"class":828},"  \"",[736,1439,1440],{"class":966},"method",[736,1442,1443],{"class":828},"\"",[736,1445,812],{"class":828},[736,1447,1448],{"class":828}," \"",[736,1450,1451],{"class":745},"EVE",[736,1453,1443],{"class":828},[736,1455,945],{"class":828},[736,1457,1458,1460,1463,1465,1467,1469,1472,1474],{"class":738,"line":871},[736,1459,1437],{"class":828},[736,1461,1462],{"class":966},"path",[736,1464,1443],{"class":828},[736,1466,812],{"class":828},[736,1468,1448],{"class":828},[736,1470,1471],{"class":745},"\u002Fsessions\u002Fsess_abc\u002Fturns\u002Fturn_0",[736,1473,1443],{"class":828},[736,1475,945],{"class":828},[736,1477,1478,1480,1482,1484,1486,1490],{"class":738,"line":878},[736,1479,1437],{"class":828},[736,1481,1322],{"class":966},[736,1483,1443],{"class":828},[736,1485,812],{"class":828},[736,1487,1489],{"class":1488},"sbssI"," 200",[736,1491,945],{"class":828},[736,1493,1494,1496,1499,1501,1503,1505,1508,1510],{"class":738,"line":896},[736,1495,1437],{"class":828},[736,1497,1498],{"class":966},"duration",[736,1500,1443],{"class":828},[736,1502,812],{"class":828},[736,1504,1448],{"class":828},[736,1506,1507],{"class":745},"7.9s",[736,1509,1443],{"class":828},[736,1511,945],{"class":828},[736,1513,1514,1516,1519,1521,1523,1526],{"class":738,"line":932},[736,1515,1437],{"class":828},[736,1517,1518],{"class":966},"durationMs",[736,1520,1443],{"class":828},[736,1522,812],{"class":828},[736,1524,1525],{"class":1488}," 7903",[736,1527,945],{"class":828},[736,1529,1530,1532,1535,1537,1539,1541,1544,1546],{"class":738,"line":948},[736,1531,1437],{"class":828},[736,1533,1534],{"class":966},"service",[736,1536,1443],{"class":828},[736,1538,812],{"class":828},[736,1540,1448],{"class":828},[736,1542,1543],{"class":745},"clearbill-support-agent",[736,1545,1443],{"class":828},[736,1547,945],{"class":828},[736,1549,1550,1552,1554,1556,1558],{"class":738,"line":973},[736,1551,1437],{"class":828},[736,1553,436],{"class":966},[736,1555,1443],{"class":828},[736,1557,812],{"class":828},[736,1559,970],{"class":828},[736,1561,1562,1565,1568,1570,1572,1574,1577,1579],{"class":738,"line":1006},[736,1563,1564],{"class":828},"    \"",[736,1566,1567],{"class":742},"sessionId",[736,1569,1443],{"class":828},[736,1571,812],{"class":828},[736,1573,1448],{"class":828},[736,1575,1576],{"class":745},"sess_abc",[736,1578,1443],{"class":828},[736,1580,945],{"class":828},[736,1582,1583,1585,1588,1590,1592,1594,1597,1599],{"class":738,"line":1012},[736,1584,1564],{"class":828},[736,1586,1587],{"class":742},"turnId",[736,1589,1443],{"class":828},[736,1591,812],{"class":828},[736,1593,1448],{"class":828},[736,1595,1596],{"class":745},"turn_0",[736,1598,1443],{"class":828},[736,1600,945],{"class":828},[736,1602,1603,1605,1608,1610,1612,1615],{"class":738,"line":1263},[736,1604,1564],{"class":828},[736,1606,1607],{"class":742},"turnSequence",[736,1609,1443],{"class":828},[736,1611,812],{"class":828},[736,1613,1614],{"class":1488}," 0",[736,1616,945],{"class":828},[736,1618,1619,1621,1624,1626,1628,1630,1633,1635],{"class":738,"line":1331},[736,1620,1564],{"class":828},[736,1622,1623],{"class":742},"phase",[736,1625,1443],{"class":828},[736,1627,812],{"class":828},[736,1629,1448],{"class":828},[736,1631,1632],{"class":745},"awaiting-approval",[736,1634,1443],{"class":828},[736,1636,945],{"class":828},[736,1638,1639,1641,1644,1646,1648],{"class":738,"line":1340},[736,1640,1564],{"class":828},[736,1642,1643],{"class":742},"sessionTurns",[736,1645,1443],{"class":828},[736,1647,812],{"class":828},[736,1649,1650],{"class":1488}," 1\n",[736,1652,1653],{"class":738,"line":1345},[736,1654,1009],{"class":828},[736,1656,1658,1660,1663,1665,1667,1669,1671,1674,1676,1678,1680,1683,1685,1687,1689,1692,1694,1696,1698,1701,1703],{"class":738,"line":1657},15,[736,1659,1437],{"class":828},[736,1661,1662],{"class":966},"customer",[736,1664,1443],{"class":828},[736,1666,812],{"class":828},[736,1668,829],{"class":828},[736,1670,1448],{"class":828},[736,1672,1673],{"class":742},"slug",[736,1675,1443],{"class":828},[736,1677,812],{"class":828},[736,1679,1448],{"class":828},[736,1681,1682],{"class":745},"acme-corp",[736,1684,1443],{"class":828},[736,1686,1296],{"class":828},[736,1688,1448],{"class":828},[736,1690,1691],{"class":742},"plan",[736,1693,1443],{"class":828},[736,1695,812],{"class":828},[736,1697,1448],{"class":828},[736,1699,1700],{"class":745},"enterprise",[736,1702,1443],{"class":828},[736,1704,929],{"class":828},[736,1706,1708,1710,1713,1715,1717,1719,1721,1723,1725,1727,1729,1732,1734,1736,1738,1740,1742,1744,1747,1749,1751,1754,1756,1758,1760,1763,1765],{"class":738,"line":1707},16,[736,1709,1437],{"class":828},[736,1711,1712],{"class":966},"order",[736,1714,1443],{"class":828},[736,1716,812],{"class":828},[736,1718,829],{"class":828},[736,1720,1448],{"class":828},[736,1722,1293],{"class":742},[736,1724,1443],{"class":828},[736,1726,812],{"class":828},[736,1728,1448],{"class":828},[736,1730,1731],{"class":745},"4821",[736,1733,1443],{"class":828},[736,1735,1296],{"class":828},[736,1737,1448],{"class":828},[736,1739,1308],{"class":742},[736,1741,1443],{"class":828},[736,1743,812],{"class":828},[736,1745,1746],{"class":1488}," 890",[736,1748,1296],{"class":828},[736,1750,1448],{"class":828},[736,1752,1753],{"class":742},"currency",[736,1755,1443],{"class":828},[736,1757,812],{"class":828},[736,1759,1448],{"class":828},[736,1761,1762],{"class":745},"USD",[736,1764,1443],{"class":828},[736,1766,929],{"class":828},[736,1768,1770,1772,1775,1777,1779,1781,1783,1785,1787,1789,1791,1794,1796,1798,1800,1803,1805,1807,1809,1812,1814],{"class":738,"line":1769},17,[736,1771,1437],{"class":828},[736,1773,1774],{"class":966},"approval",[736,1776,1443],{"class":828},[736,1778,812],{"class":828},[736,1780,829],{"class":828},[736,1782,1448],{"class":828},[736,1784,1322],{"class":742},[736,1786,1443],{"class":828},[736,1788,812],{"class":828},[736,1790,1448],{"class":828},[736,1792,1793],{"class":745},"pending",[736,1795,1443],{"class":828},[736,1797,1296],{"class":828},[736,1799,1448],{"class":828},[736,1801,1802],{"class":742},"tool",[736,1804,1443],{"class":828},[736,1806,812],{"class":828},[736,1808,1448],{"class":828},[736,1810,1811],{"class":745},"issue_refund",[736,1813,1443],{"class":828},[736,1815,929],{"class":828},[736,1817,1819,1821,1824,1826,1828],{"class":738,"line":1818},18,[736,1820,1437],{"class":828},[736,1822,1823],{"class":966},"ai",[736,1825,1443],{"class":828},[736,1827,812],{"class":828},[736,1829,970],{"class":828},[736,1831,1833,1835,1838,1840,1842,1844,1847,1849],{"class":738,"line":1832},19,[736,1834,1564],{"class":828},[736,1836,1837],{"class":742},"model",[736,1839,1443],{"class":828},[736,1841,812],{"class":828},[736,1843,1448],{"class":828},[736,1845,1846],{"class":745},"deepseek\u002Fdeepseek-v4-flash",[736,1848,1443],{"class":828},[736,1850,945],{"class":828},[736,1852,1854,1856,1859,1861,1863,1865,1868,1870],{"class":738,"line":1853},20,[736,1855,1564],{"class":828},[736,1857,1858],{"class":742},"provider",[736,1860,1443],{"class":828},[736,1862,812],{"class":828},[736,1864,1448],{"class":828},[736,1866,1867],{"class":745},"deepseek",[736,1869,1443],{"class":828},[736,1871,945],{"class":828},[736,1873,1875,1877,1880,1882,1884,1887],{"class":738,"line":1874},21,[736,1876,1564],{"class":828},[736,1878,1879],{"class":742},"calls",[736,1881,1443],{"class":828},[736,1883,812],{"class":828},[736,1885,1886],{"class":1488}," 2",[736,1888,945],{"class":828},[736,1890,1892,1894,1897,1899,1901,1903],{"class":738,"line":1891},22,[736,1893,1564],{"class":828},[736,1895,1896],{"class":742},"steps",[736,1898,1443],{"class":828},[736,1900,812],{"class":828},[736,1902,1886],{"class":1488},[736,1904,945],{"class":828},[736,1906,1908,1910,1913,1915,1917,1920],{"class":738,"line":1907},23,[736,1909,1564],{"class":828},[736,1911,1912],{"class":742},"inputTokens",[736,1914,1443],{"class":828},[736,1916,812],{"class":828},[736,1918,1919],{"class":1488}," 11724",[736,1921,945],{"class":828},[736,1923,1925,1927,1930,1932,1934,1937],{"class":738,"line":1924},24,[736,1926,1564],{"class":828},[736,1928,1929],{"class":742},"outputTokens",[736,1931,1443],{"class":828},[736,1933,812],{"class":828},[736,1935,1936],{"class":1488}," 282",[736,1938,945],{"class":828},[736,1940,1942,1944,1947,1949,1951,1953,1956,1958],{"class":738,"line":1941},25,[736,1943,1564],{"class":828},[736,1945,1946],{"class":742},"finishReason",[736,1948,1443],{"class":828},[736,1950,812],{"class":828},[736,1952,1448],{"class":828},[736,1954,1955],{"class":745},"tool-calls",[736,1957,1443],{"class":828},[736,1959,945],{"class":828},[736,1961,1963,1965,1968,1970,1972],{"class":738,"line":1962},26,[736,1964,1564],{"class":828},[736,1966,1967],{"class":742},"tools",[736,1969,1443],{"class":828},[736,1971,812],{"class":828},[736,1973,1974],{"class":828}," [\n",[736,1976,1978,1981,1983,1986,1988,1990,1992,1995,1997,1999,2001,2003,2005,2007,2010,2012,2014,2017,2019,2021,2024,2026,2028,2030,2032,2035],{"class":738,"line":1977},27,[736,1979,1980],{"class":828},"      {",[736,1982,1448],{"class":828},[736,1984,1985],{"class":1488},"name",[736,1987,1443],{"class":828},[736,1989,812],{"class":828},[736,1991,1448],{"class":828},[736,1993,1994],{"class":745},"lookup_customer",[736,1996,1443],{"class":828},[736,1998,1296],{"class":828},[736,2000,1448],{"class":828},[736,2002,1518],{"class":1488},[736,2004,1443],{"class":828},[736,2006,812],{"class":828},[736,2008,2009],{"class":1488}," 26",[736,2011,1296],{"class":828},[736,2013,1448],{"class":828},[736,2015,2016],{"class":1488},"success",[736,2018,1443],{"class":828},[736,2020,812],{"class":828},[736,2022,2023],{"class":828}," true,",[736,2025,1448],{"class":828},[736,2027,1912],{"class":1488},[736,2029,1443],{"class":828},[736,2031,812],{"class":828},[736,2033,2034],{"class":1488}," 8900",[736,2036,929],{"class":828},[736,2038,2040,2042,2044,2046,2048,2050,2052,2055,2057,2059,2061,2063,2065,2067,2070,2072,2074,2076,2078,2080,2083],{"class":738,"line":2039},28,[736,2041,1980],{"class":828},[736,2043,1448],{"class":828},[736,2045,1985],{"class":1488},[736,2047,1443],{"class":828},[736,2049,812],{"class":828},[736,2051,1448],{"class":828},[736,2053,2054],{"class":745},"lookup_order",[736,2056,1443],{"class":828},[736,2058,1296],{"class":828},[736,2060,1448],{"class":828},[736,2062,1518],{"class":1488},[736,2064,1443],{"class":828},[736,2066,812],{"class":828},[736,2068,2069],{"class":1488}," 13",[736,2071,1296],{"class":828},[736,2073,1448],{"class":828},[736,2075,2016],{"class":1488},[736,2077,1443],{"class":828},[736,2079,812],{"class":828},[736,2081,2082],{"class":828}," true",[736,2084,2085],{"class":828}," }\n",[736,2087,2089],{"class":738,"line":2088},29,[736,2090,2091],{"class":828},"    ]\n",[736,2093,2095],{"class":738,"line":2094},30,[736,2096,2097],{"class":828},"  }\n",[736,2099,2101],{"class":738,"line":2100},31,[736,2102,2103],{"class":828},"}\n",[544,2105,2106],{},"After approval, the next turn carries the outcome:",[726,2108,2111],{"className":1423,"code":2109,"filename":2110,"language":1426,"meta":732,"style":732},"{\n  \"path\": \"\u002Fsessions\u002Fsess_abc\u002Fturns\u002Fturn_1\",\n  \"eve\": {\n    \"sessionId\": \"sess_abc\",\n    \"turnId\": \"turn_1\",\n    \"turnSequence\": 1,\n    \"sessionTurns\": 2\n  },\n  \"refund\": { \"orderId\": \"4821\", \"amount\": 890, \"status\": \"refunded\" },\n  \"audit\": { \"action\": \"refund.issued\", \"target\": { \"type\": \"order\", \"id\": \"4821\" } },\n  \"approval\": { \"status\": \"approved\", \"tool\": \"issue_refund\" },\n  \"ai\": {\n    \"tools\": [{ \"name\": \"issue_refund\", \"durationMs\": 993, \"success\": true }],\n    \"finishReason\": \"stop\"\n  }\n}\n","Wide Event — refund completed",[563,2112,2113,2117,2136,2148,2166,2185,2200,2213,2217,2275,2352,2397,2409,2464,2482,2486],{"__ignoreMap":732},[736,2114,2115],{"class":738,"line":739},[736,2116,893],{"class":828},[736,2118,2119,2121,2123,2125,2127,2129,2132,2134],{"class":738,"line":850},[736,2120,1437],{"class":828},[736,2122,1462],{"class":966},[736,2124,1443],{"class":828},[736,2126,812],{"class":828},[736,2128,1448],{"class":828},[736,2130,2131],{"class":745},"\u002Fsessions\u002Fsess_abc\u002Fturns\u002Fturn_1",[736,2133,1443],{"class":828},[736,2135,945],{"class":828},[736,2137,2138,2140,2142,2144,2146],{"class":738,"line":871},[736,2139,1437],{"class":828},[736,2141,436],{"class":966},[736,2143,1443],{"class":828},[736,2145,812],{"class":828},[736,2147,970],{"class":828},[736,2149,2150,2152,2154,2156,2158,2160,2162,2164],{"class":738,"line":878},[736,2151,1564],{"class":828},[736,2153,1567],{"class":742},[736,2155,1443],{"class":828},[736,2157,812],{"class":828},[736,2159,1448],{"class":828},[736,2161,1576],{"class":745},[736,2163,1443],{"class":828},[736,2165,945],{"class":828},[736,2167,2168,2170,2172,2174,2176,2178,2181,2183],{"class":738,"line":896},[736,2169,1564],{"class":828},[736,2171,1587],{"class":742},[736,2173,1443],{"class":828},[736,2175,812],{"class":828},[736,2177,1448],{"class":828},[736,2179,2180],{"class":745},"turn_1",[736,2182,1443],{"class":828},[736,2184,945],{"class":828},[736,2186,2187,2189,2191,2193,2195,2198],{"class":738,"line":932},[736,2188,1564],{"class":828},[736,2190,1607],{"class":742},[736,2192,1443],{"class":828},[736,2194,812],{"class":828},[736,2196,2197],{"class":1488}," 1",[736,2199,945],{"class":828},[736,2201,2202,2204,2206,2208,2210],{"class":738,"line":948},[736,2203,1564],{"class":828},[736,2205,1643],{"class":742},[736,2207,1443],{"class":828},[736,2209,812],{"class":828},[736,2211,2212],{"class":1488}," 2\n",[736,2214,2215],{"class":738,"line":973},[736,2216,1009],{"class":828},[736,2218,2219,2221,2224,2226,2228,2230,2232,2234,2236,2238,2240,2242,2244,2246,2248,2250,2252,2254,2256,2258,2260,2262,2264,2266,2268,2271,2273],{"class":738,"line":1006},[736,2220,1437],{"class":828},[736,2222,2223],{"class":966},"refund",[736,2225,1443],{"class":828},[736,2227,812],{"class":828},[736,2229,829],{"class":828},[736,2231,1448],{"class":828},[736,2233,1244],{"class":742},[736,2235,1443],{"class":828},[736,2237,812],{"class":828},[736,2239,1448],{"class":828},[736,2241,1731],{"class":745},[736,2243,1443],{"class":828},[736,2245,1296],{"class":828},[736,2247,1448],{"class":828},[736,2249,1308],{"class":742},[736,2251,1443],{"class":828},[736,2253,812],{"class":828},[736,2255,1746],{"class":1488},[736,2257,1296],{"class":828},[736,2259,1448],{"class":828},[736,2261,1322],{"class":742},[736,2263,1443],{"class":828},[736,2265,812],{"class":828},[736,2267,1448],{"class":828},[736,2269,2270],{"class":745},"refunded",[736,2272,1443],{"class":828},[736,2274,929],{"class":828},[736,2276,2277,2279,2282,2284,2286,2288,2290,2293,2295,2297,2299,2302,2304,2306,2308,2311,2313,2315,2317,2319,2322,2324,2326,2328,2330,2332,2334,2336,2338,2340,2342,2344,2346,2348,2350],{"class":738,"line":1012},[736,2278,1437],{"class":828},[736,2280,2281],{"class":966},"audit",[736,2283,1443],{"class":828},[736,2285,812],{"class":828},[736,2287,829],{"class":828},[736,2289,1448],{"class":828},[736,2291,2292],{"class":742},"action",[736,2294,1443],{"class":828},[736,2296,812],{"class":828},[736,2298,1448],{"class":828},[736,2300,2301],{"class":745},"refund.issued",[736,2303,1443],{"class":828},[736,2305,1296],{"class":828},[736,2307,1448],{"class":828},[736,2309,2310],{"class":742},"target",[736,2312,1443],{"class":828},[736,2314,812],{"class":828},[736,2316,829],{"class":828},[736,2318,1448],{"class":828},[736,2320,2321],{"class":1488},"type",[736,2323,1443],{"class":828},[736,2325,812],{"class":828},[736,2327,1448],{"class":828},[736,2329,1712],{"class":745},[736,2331,1443],{"class":828},[736,2333,1296],{"class":828},[736,2335,1448],{"class":828},[736,2337,1293],{"class":1488},[736,2339,1443],{"class":828},[736,2341,812],{"class":828},[736,2343,1448],{"class":828},[736,2345,1731],{"class":745},[736,2347,1443],{"class":828},[736,2349,836],{"class":828},[736,2351,929],{"class":828},[736,2353,2354,2356,2358,2360,2362,2364,2366,2368,2370,2372,2374,2377,2379,2381,2383,2385,2387,2389,2391,2393,2395],{"class":738,"line":1263},[736,2355,1437],{"class":828},[736,2357,1774],{"class":966},[736,2359,1443],{"class":828},[736,2361,812],{"class":828},[736,2363,829],{"class":828},[736,2365,1448],{"class":828},[736,2367,1322],{"class":742},[736,2369,1443],{"class":828},[736,2371,812],{"class":828},[736,2373,1448],{"class":828},[736,2375,2376],{"class":745},"approved",[736,2378,1443],{"class":828},[736,2380,1296],{"class":828},[736,2382,1448],{"class":828},[736,2384,1802],{"class":742},[736,2386,1443],{"class":828},[736,2388,812],{"class":828},[736,2390,1448],{"class":828},[736,2392,1811],{"class":745},[736,2394,1443],{"class":828},[736,2396,929],{"class":828},[736,2398,2399,2401,2403,2405,2407],{"class":738,"line":1331},[736,2400,1437],{"class":828},[736,2402,1823],{"class":966},[736,2404,1443],{"class":828},[736,2406,812],{"class":828},[736,2408,970],{"class":828},[736,2410,2411,2413,2415,2417,2419,2422,2424,2426,2428,2430,2432,2434,2436,2438,2440,2442,2444,2446,2449,2451,2453,2455,2457,2459,2461],{"class":738,"line":1340},[736,2412,1564],{"class":828},[736,2414,1967],{"class":742},[736,2416,1443],{"class":828},[736,2418,812],{"class":828},[736,2420,2421],{"class":828}," [{",[736,2423,1448],{"class":828},[736,2425,1985],{"class":1488},[736,2427,1443],{"class":828},[736,2429,812],{"class":828},[736,2431,1448],{"class":828},[736,2433,1811],{"class":745},[736,2435,1443],{"class":828},[736,2437,1296],{"class":828},[736,2439,1448],{"class":828},[736,2441,1518],{"class":1488},[736,2443,1443],{"class":828},[736,2445,812],{"class":828},[736,2447,2448],{"class":1488}," 993",[736,2450,1296],{"class":828},[736,2452,1448],{"class":828},[736,2454,2016],{"class":1488},[736,2456,1443],{"class":828},[736,2458,812],{"class":828},[736,2460,2082],{"class":828},[736,2462,2463],{"class":828}," }],\n",[736,2465,2466,2468,2470,2472,2474,2476,2479],{"class":738,"line":1345},[736,2467,1564],{"class":828},[736,2469,1946],{"class":742},[736,2471,1443],{"class":828},[736,2473,812],{"class":828},[736,2475,1448],{"class":828},[736,2477,2478],{"class":745},"stop",[736,2480,2481],{"class":828},"\"\n",[736,2483,2484],{"class":738,"line":1657},[736,2485,2097],{"class":828},[736,2487,2488],{"class":738,"line":1707},[736,2489,2103],{"class":828},[544,2491,2492,2493,2496,2497,2496,2500,2503,2504,2506,2507,2510,2511,2514,2515,2518,2519,2496,2521,2496,2524,2496,2527,2496,2530,979],{},"Token usage and tool executions are accumulated from eve stream events (",[563,2494,2495],{},"step.completed",", ",[563,2498,2499],{},"actions.requested",[563,2501,2502],{},"action.result","). Business fields set via ",[563,2505,1054],{}," carry across turns in the same session. Link turns in analytics with ",[563,2508,2509],{},"eve.sessionId"," + ",[563,2512,2513],{},"eve.turnSequence",", and each event stays self-contained. ",[563,2516,2517],{},"eve.phase"," is only set for non-routine endings: ",[563,2520,1632],{},[563,2522,2523],{},"awaiting-authorization",[563,2525,2526],{},"rejected",[563,2528,2529],{},"cancelled",[563,2531,2532],{},"failed",[718,2534,2536],{"id":2535},"everything-the-turn-can-report","Everything the turn can report",[544,2538,2539],{},"Beyond the identifiers above, a turn records what eve reports about it. Every field is optional and appears only when the turn produced it.",[644,2541,2542,2552],{},[647,2543,2544],{},[650,2545,2546,2549],{},[653,2547,2548],{},"Field",[653,2550,2551],{},"What it tells you",[660,2553,2554,2574,2601,2614,2631,2645,2658,2668,2684,2694,2704,2718,2735,2760],{},[650,2555,2556,2561],{},[665,2557,2558],{},[563,2559,2560],{},"eve.runtime",[665,2562,2563,2564,2567,2568,2567,2571],{},"eve version, agent id, model, and the deployed ",[563,2565,2566],{},"gitSha"," \u002F ",[563,2569,2570],{},"gitBranch",[563,2572,2573],{},"deployedAt",[650,2575,2576,2581],{},[665,2577,2578],{},[563,2579,2580],{},"eve.caller",[665,2582,2583,2584,2496,2587,588,2590,2593,2594,588,2597,2600],{},"Who triggered the turn: ",[563,2585,2586],{},"principalId",[563,2588,2589],{},"principalType",[563,2591,2592],{},"authenticator",". On a multi-user channel this is what you group cost and volume by. ",[563,2595,2596],{},"subject",[563,2598,2599],{},"attributes"," are never recorded — a channel may put a name or an email in them",[650,2602,2603,2608],{},[665,2604,2605],{},[563,2606,2607],{},"eve.parent",[665,2609,2610,2611],{},"Parent and root session ids for a subagent run — rebuild the delegation tree with ",[563,2612,2613],{},"rootSessionId",[650,2615,2616,2621],{},[665,2617,2618],{},[563,2619,2620],{},"eve.authorizations",[665,2622,2623,2624,2496,2627,2630],{},"Connection sign-ins with their ",[563,2625,2626],{},"outcome",[563,2628,2629],{},"reason"," and duration",[650,2632,2633,2638],{},[665,2634,2635],{},[563,2636,2637],{},"eve.compaction",[665,2639,2640,2641,2644],{},"How many compactions ran, on which model, and ",[563,2642,2643],{},"inputTokensAtTrigger"," — how full the context was when the first one fired",[650,2646,2647,2655],{},[665,2648,2649,2567,2652],{},[563,2650,2651],{},"eve.stepFailures",[563,2653,2654],{},"eve.failedSteps",[665,2656,2657],{},"Model calls that failed, including on a turn that then succeeded on retry",[650,2659,2660,2665],{},[665,2661,2662],{},[563,2663,2664],{},"eve.subagents",[665,2666,2667],{},"Delegations with their status and duration",[650,2669,2670,2675],{},[665,2671,2672],{},[563,2673,2674],{},"eve.reasoning",[665,2676,2677,588,2680,2683],{},[563,2678,2679],{},"blocks",[563,2681,2682],{},"chars"," — the size of the model's thinking, never its content",[650,2685,2686,2691],{},[665,2687,2688],{},[563,2689,2690],{},"eve.result",[665,2692,2693],{},"The structured result, for an agent with an output schema",[650,2695,2696,2701],{},[665,2697,2698],{},[563,2699,2700],{},"eve.contextCleared",[665,2702,2703],{},"The durable history was wiped during this turn",[650,2705,2706,2711],{},[665,2707,2708],{},[563,2709,2710],{},"message.responseChars",[665,2712,2713,2714,2717],{},"Length of the agent's response, recorded whatever the ",[563,2715,2716],{},"message"," mode",[650,2719,2720,2725],{},[665,2721,2722],{},[563,2723,2724],{},"ai.costUsd",[665,2726,2727,2728,2731,2732],{},"Cost as reported by eve. ",[563,2729,2730],{},"ai.estimatedCost"," is the fallback computed from ",[563,2733,2734],{},"cost",[650,2736,2737,2745],{},[665,2738,2739,2567,2742],{},[563,2740,2741],{},"ai.model",[563,2743,2744],{},"ai.provider",[665,2746,2747,2748,2750,2751,2753,2754,2756,2757],{},"The gateway slug (",[563,2749,1846],{},") and the resolved provider (",[563,2752,1867],{},") that served the turn. ",[563,2755,2744],{}," is split from the model id eve reports on ",[563,2758,2759],{},"session.started",[650,2761,2762,2767],{},[665,2763,2764],{},[563,2765,2766],{},"ai.tools[].inputTokens",[665,2768,2769],{},"The input tokens a tool result added to the next model call: the delta between the step that called the tool and the step that consumed its result. Parallel results in one step share the delta evenly; left unset when the turn ended before the result was consumed, or when a compaction reset the context",[639,2771,2773],{"id":2772},"correlate-traces-with-wide-events","Correlate traces with wide events",[544,2775,2776,2777,2779],{},"A wide event and an Agent Runs span describe the same turn, but nothing joins them on its own. ",[563,2778,708],{}," stamps evlog's turn identity onto eve's AI SDK spans:",[726,2781,2783],{"className":815,"code":2782,"filename":565,"language":817,"meta":732,"style":732},"import { defineEvlogInstrumentation } from 'evlog\u002Feve'\n\nexport default defineEvlogInstrumentation()\n",[563,2784,2785,2804,2808],{"__ignoreMap":732},[736,2786,2787,2789,2791,2794,2796,2798,2800,2802],{"class":738,"line":739},[736,2788,825],{"class":824},[736,2790,829],{"class":828},[736,2792,2793],{"class":832}," defineEvlogInstrumentation",[736,2795,836],{"class":828},[736,2797,839],{"class":824},[736,2799,842],{"class":828},[736,2801,569],{"class":745},[736,2803,847],{"class":828},[736,2805,2806],{"class":738,"line":850},[736,2807,875],{"emptyLinePlaceholder":874},[736,2809,2810,2812,2814,2816],{"class":738,"line":871},[736,2811,881],{"class":824},[736,2813,884],{"class":824},[736,2815,2793],{"class":887},[736,2817,1260],{"class":832},[544,2819,2820,2821,588,2824,2827,2828,588,2831,2833],{},"Every model-call span, and its children, then carries ",[563,2822,2823],{},"evlog.request_id",[563,2825,2826],{},"evlog.session_id",", the same values the wide event reports as ",[563,2829,2830],{},"requestId",[563,2832,2509],{},". Jump from a trace in Braintrust, Datadog or Agent Runs straight to the event in your drain, and back.",[544,2835,2836,2837,2840,2841,2844],{},"Without ",[563,2838,2839],{},"setup",", OpenTelemetry export is untouched: eve keeps writing its local traces, readable with ",[563,2842,2843],{},"eve traces",". Pass one to export elsewhere:",[726,2846,2848],{"className":815,"code":2847,"filename":565,"language":817,"meta":732,"style":732},"import { defineEvlogInstrumentation } from 'evlog\u002Feve'\nimport { registerOTel } from '@vercel\u002Fotel'\n\nexport default defineEvlogInstrumentation({\n  setup: ({ agentName }) => registerOTel({ serviceName: agentName }),\n})\n",[563,2849,2850,2868,2888,2892,2904,2941],{"__ignoreMap":732},[736,2851,2852,2854,2856,2858,2860,2862,2864,2866],{"class":738,"line":739},[736,2853,825],{"class":824},[736,2855,829],{"class":828},[736,2857,2793],{"class":832},[736,2859,836],{"class":828},[736,2861,839],{"class":824},[736,2863,842],{"class":828},[736,2865,569],{"class":745},[736,2867,847],{"class":828},[736,2869,2870,2872,2874,2877,2879,2881,2883,2886],{"class":738,"line":850},[736,2871,825],{"class":824},[736,2873,829],{"class":828},[736,2875,2876],{"class":832}," registerOTel",[736,2878,836],{"class":828},[736,2880,839],{"class":824},[736,2882,842],{"class":828},[736,2884,2885],{"class":745},"@vercel\u002Fotel",[736,2887,847],{"class":828},[736,2889,2890],{"class":738,"line":871},[736,2891,875],{"emptyLinePlaceholder":874},[736,2893,2894,2896,2898,2900,2902],{"class":738,"line":878},[736,2895,881],{"class":824},[736,2897,884],{"class":824},[736,2899,2793],{"class":887},[736,2901,890],{"class":832},[736,2903,893],{"class":828},[736,2905,2906,2909,2911,2914,2917,2919,2921,2923,2925,2927,2930,2932,2935,2937,2939],{"class":738,"line":896},[736,2907,2908],{"class":887},"  setup",[736,2910,812],{"class":828},[736,2912,2913],{"class":828}," ({",[736,2915,2916],{"class":959}," agentName",[736,2918,1221],{"class":828},[736,2920,967],{"class":966},[736,2922,2876],{"class":887},[736,2924,890],{"class":832},[736,2926,1184],{"class":828},[736,2928,2929],{"class":899}," serviceName",[736,2931,812],{"class":828},[736,2933,2934],{"class":832}," agentName ",[736,2936,1015],{"class":828},[736,2938,963],{"class":832},[736,2940,945],{"class":828},[736,2942,2943,2945],{"class":738,"line":932},[736,2944,1015],{"class":828},[736,2946,1018],{"class":832},[544,2948,2949,2496,2952,2496,2955,588,2958,2961,2962,979],{},[563,2950,2951],{},"functionId",[563,2953,2954],{},"recordInputs",[563,2956,2957],{},"recordOutputs",[563,2959,2960],{},"traceChannelRequests"," pass straight through to eve's ",[563,2963,2964],{},"defineInstrumentation",[718,2966,2968],{"id":2967},"alongside-another-observability-backend","Alongside another observability backend",[544,2970,2971,2973,2974,2976,2977,2980,2981,2984],{},[563,2972,708],{}," is the shortcut for an agent whose instrumentation is evlog's alone. It owns the file, and an agent has exactly one ",[563,2975,565],{},", so every observability item in eve's registry writes that same path, which is why ",[563,2978,2979],{},"eve add instrumentation\u002Fsentry"," after ",[563,2982,2983],{},"eve add instrumentation\u002Fposthog"," refuses rather than clobbering the first.",[544,2986,2987,2988,2990,2991,2994],{},"Once another backend is in play, write the file yourself with eve's own ",[563,2989,2964],{}," and spread ",[563,2992,2993],{},"evlogRuntimeContext"," into your runtime context. evlog contributes attributes to your instrumentation instead of wrapping it:",[726,2996,2998],{"className":815,"code":2997,"filename":565,"language":817,"meta":732,"style":732},"import { BatchSpanProcessor, SimpleSpanProcessor } from '@opentelemetry\u002Fsdk-trace-base'\nimport { PostHogTraceExporter } from '@posthog\u002Fai\u002Fotel'\nimport { OTLPHttpProtoTraceExporter, registerOTel } from '@vercel\u002Fotel'\nimport { defineInstrumentation } from 'eve\u002Finstrumentation'\nimport { evlogRuntimeContext } from 'evlog\u002Feve'\n\nexport default defineInstrumentation({\n  \u002F\u002F One provider, one span processor per backend. Items that generate\n  \u002F\u002F `traceExporter` (Sentry, Datadog, Arize, Jaeger, Braintrust, Honeycomb)\n  \u002F\u002F become an entry in this array. Call registerOTel once, not once per backend.\n  setup: ({ agentName }) => registerOTel({\n    serviceName: agentName,\n    spanProcessors: [\n      new SimpleSpanProcessor(new PostHogTraceExporter({\n        projectToken: process.env.POSTHOG_PROJECT_TOKEN!,\n      })),\n      new BatchSpanProcessor(new OTLPHttpProtoTraceExporter({\n        url: process.env.SENTRY_OTLP_TRACES_ENDPOINT!,\n        headers: { 'x-sentry-auth': `sentry sentry_key=${process.env.SENTRY_PUBLIC_KEY}` },\n      })),\n    ],\n  }),\n  events: {\n    'step.started': (input) => {\n      const principalId = input.session.auth.initiator?.principalId\n        ?? input.session.auth.current?.principalId\n      return {\n        runtimeContext: {\n          ...evlogRuntimeContext(input),\n          \u002F\u002F Omitted rather than blank: an empty attribute reads as an empty id.\n          ...(principalId ? { posthog_distinct_id: principalId } : {}),\n        },\n      }\n    },\n  },\n})\n",[563,2999,3000,3025,3045,3068,3088,3107,3111,3123,3129,3134,3139,3159,3170,3179,3197,3218,3228,3244,3264,3308,3316,3323,3332,3341,3364,3398,3422,3429,3438,3453,3458,3490,3496,3502,3508,3513],{"__ignoreMap":732},[736,3001,3002,3004,3006,3009,3011,3014,3016,3018,3020,3023],{"class":738,"line":739},[736,3003,825],{"class":824},[736,3005,829],{"class":828},[736,3007,3008],{"class":832}," BatchSpanProcessor",[736,3010,1296],{"class":828},[736,3012,3013],{"class":832}," SimpleSpanProcessor",[736,3015,836],{"class":828},[736,3017,839],{"class":824},[736,3019,842],{"class":828},[736,3021,3022],{"class":745},"@opentelemetry\u002Fsdk-trace-base",[736,3024,847],{"class":828},[736,3026,3027,3029,3031,3034,3036,3038,3040,3043],{"class":738,"line":850},[736,3028,825],{"class":824},[736,3030,829],{"class":828},[736,3032,3033],{"class":832}," PostHogTraceExporter",[736,3035,836],{"class":828},[736,3037,839],{"class":824},[736,3039,842],{"class":828},[736,3041,3042],{"class":745},"@posthog\u002Fai\u002Fotel",[736,3044,847],{"class":828},[736,3046,3047,3049,3051,3054,3056,3058,3060,3062,3064,3066],{"class":738,"line":871},[736,3048,825],{"class":824},[736,3050,829],{"class":828},[736,3052,3053],{"class":832}," OTLPHttpProtoTraceExporter",[736,3055,1296],{"class":828},[736,3057,2876],{"class":832},[736,3059,836],{"class":828},[736,3061,839],{"class":824},[736,3063,842],{"class":828},[736,3065,2885],{"class":745},[736,3067,847],{"class":828},[736,3069,3070,3072,3074,3077,3079,3081,3083,3086],{"class":738,"line":878},[736,3071,825],{"class":824},[736,3073,829],{"class":828},[736,3075,3076],{"class":832}," defineInstrumentation",[736,3078,836],{"class":828},[736,3080,839],{"class":824},[736,3082,842],{"class":828},[736,3084,3085],{"class":745},"eve\u002Finstrumentation",[736,3087,847],{"class":828},[736,3089,3090,3092,3094,3097,3099,3101,3103,3105],{"class":738,"line":896},[736,3091,825],{"class":824},[736,3093,829],{"class":828},[736,3095,3096],{"class":832}," evlogRuntimeContext",[736,3098,836],{"class":828},[736,3100,839],{"class":824},[736,3102,842],{"class":828},[736,3104,569],{"class":745},[736,3106,847],{"class":828},[736,3108,3109],{"class":738,"line":932},[736,3110,875],{"emptyLinePlaceholder":874},[736,3112,3113,3115,3117,3119,3121],{"class":738,"line":948},[736,3114,881],{"class":824},[736,3116,884],{"class":824},[736,3118,3076],{"class":887},[736,3120,890],{"class":832},[736,3122,893],{"class":828},[736,3124,3125],{"class":738,"line":973},[736,3126,3128],{"class":3127},"sHwdD","  \u002F\u002F One provider, one span processor per backend. Items that generate\n",[736,3130,3131],{"class":738,"line":1006},[736,3132,3133],{"class":3127},"  \u002F\u002F `traceExporter` (Sentry, Datadog, Arize, Jaeger, Braintrust, Honeycomb)\n",[736,3135,3136],{"class":738,"line":1012},[736,3137,3138],{"class":3127},"  \u002F\u002F become an entry in this array. Call registerOTel once, not once per backend.\n",[736,3140,3141,3143,3145,3147,3149,3151,3153,3155,3157],{"class":738,"line":1263},[736,3142,2908],{"class":887},[736,3144,812],{"class":828},[736,3146,2913],{"class":828},[736,3148,2916],{"class":959},[736,3150,1221],{"class":828},[736,3152,967],{"class":966},[736,3154,2876],{"class":887},[736,3156,890],{"class":832},[736,3158,893],{"class":828},[736,3160,3161,3164,3166,3168],{"class":738,"line":1331},[736,3162,3163],{"class":899},"    serviceName",[736,3165,812],{"class":828},[736,3167,2916],{"class":832},[736,3169,945],{"class":828},[736,3171,3172,3175,3177],{"class":738,"line":1340},[736,3173,3174],{"class":899},"    spanProcessors",[736,3176,812],{"class":828},[736,3178,1974],{"class":832},[736,3180,3181,3184,3186,3188,3191,3193,3195],{"class":738,"line":1345},[736,3182,3183],{"class":828},"      new",[736,3185,3013],{"class":887},[736,3187,890],{"class":832},[736,3189,3190],{"class":828},"new",[736,3192,3033],{"class":887},[736,3194,890],{"class":832},[736,3196,893],{"class":828},[736,3198,3199,3202,3204,3206,3208,3210,3212,3215],{"class":738,"line":1657},[736,3200,3201],{"class":899},"        projectToken",[736,3203,812],{"class":828},[736,3205,993],{"class":832},[736,3207,979],{"class":828},[736,3209,998],{"class":832},[736,3211,979],{"class":828},[736,3213,3214],{"class":832},"POSTHOG_PROJECT_TOKEN",[736,3216,3217],{"class":828},"!,\n",[736,3219,3220,3223,3226],{"class":738,"line":1707},[736,3221,3222],{"class":828},"      }",[736,3224,3225],{"class":832},"))",[736,3227,945],{"class":828},[736,3229,3230,3232,3234,3236,3238,3240,3242],{"class":738,"line":1769},[736,3231,3183],{"class":828},[736,3233,3008],{"class":887},[736,3235,890],{"class":832},[736,3237,3190],{"class":828},[736,3239,3053],{"class":887},[736,3241,890],{"class":832},[736,3243,893],{"class":828},[736,3245,3246,3249,3251,3253,3255,3257,3259,3262],{"class":738,"line":1818},[736,3247,3248],{"class":899},"        url",[736,3250,812],{"class":828},[736,3252,993],{"class":832},[736,3254,979],{"class":828},[736,3256,998],{"class":832},[736,3258,979],{"class":828},[736,3260,3261],{"class":832},"SENTRY_OTLP_TRACES_ENDPOINT",[736,3263,3217],{"class":828},[736,3265,3266,3269,3271,3273,3275,3278,3280,3282,3285,3288,3291,3294,3296,3298,3300,3303,3306],{"class":738,"line":1832},[736,3267,3268],{"class":899},"        headers",[736,3270,812],{"class":828},[736,3272,829],{"class":828},[736,3274,842],{"class":828},[736,3276,3277],{"class":899},"x-sentry-auth",[736,3279,924],{"class":828},[736,3281,812],{"class":828},[736,3283,3284],{"class":828}," `",[736,3286,3287],{"class":745},"sentry sentry_key=",[736,3289,3290],{"class":828},"${",[736,3292,3293],{"class":832},"process",[736,3295,979],{"class":828},[736,3297,998],{"class":832},[736,3299,979],{"class":828},[736,3301,3302],{"class":832},"SENTRY_PUBLIC_KEY",[736,3304,3305],{"class":828},"}`",[736,3307,929],{"class":828},[736,3309,3310,3312,3314],{"class":738,"line":1853},[736,3311,3222],{"class":828},[736,3313,3225],{"class":832},[736,3315,945],{"class":828},[736,3317,3318,3321],{"class":738,"line":1874},[736,3319,3320],{"class":832},"    ]",[736,3322,945],{"class":828},[736,3324,3325,3328,3330],{"class":738,"line":1891},[736,3326,3327],{"class":828},"  }",[736,3329,963],{"class":832},[736,3331,945],{"class":828},[736,3333,3334,3337,3339],{"class":738,"line":1907},[736,3335,3336],{"class":899},"  events",[736,3338,812],{"class":828},[736,3340,970],{"class":828},[736,3342,3343,3346,3349,3351,3353,3355,3358,3360,3362],{"class":738,"line":1924},[736,3344,3345],{"class":828},"    '",[736,3347,3348],{"class":899},"step.started",[736,3350,924],{"class":828},[736,3352,812],{"class":828},[736,3354,956],{"class":828},[736,3356,3357],{"class":959},"input",[736,3359,963],{"class":828},[736,3361,967],{"class":966},[736,3363,970],{"class":828},[736,3365,3366,3369,3372,3374,3377,3379,3382,3384,3387,3389,3392,3395],{"class":738,"line":1941},[736,3367,3368],{"class":966},"      const",[736,3370,3371],{"class":832}," principalId",[736,3373,990],{"class":828},[736,3375,3376],{"class":832}," input",[736,3378,979],{"class":828},[736,3380,3381],{"class":832},"session",[736,3383,979],{"class":828},[736,3385,3386],{"class":832},"auth",[736,3388,979],{"class":828},[736,3390,3391],{"class":832},"initiator",[736,3393,3394],{"class":828},"?.",[736,3396,3397],{"class":832},"principalId\n",[736,3399,3400,3403,3405,3407,3409,3411,3413,3415,3418,3420],{"class":738,"line":1962},[736,3401,3402],{"class":828},"        ??",[736,3404,3376],{"class":832},[736,3406,979],{"class":828},[736,3408,3381],{"class":832},[736,3410,979],{"class":828},[736,3412,3386],{"class":832},[736,3414,979],{"class":828},[736,3416,3417],{"class":832},"current",[736,3419,3394],{"class":828},[736,3421,3397],{"class":832},[736,3423,3424,3427],{"class":738,"line":1977},[736,3425,3426],{"class":824},"      return",[736,3428,970],{"class":828},[736,3430,3431,3434,3436],{"class":738,"line":2039},[736,3432,3433],{"class":899},"        runtimeContext",[736,3435,812],{"class":828},[736,3437,970],{"class":828},[736,3439,3440,3443,3445,3447,3449,3451],{"class":738,"line":2088},[736,3441,3442],{"class":828},"          ...",[736,3444,2993],{"class":887},[736,3446,890],{"class":899},[736,3448,3357],{"class":832},[736,3450,963],{"class":899},[736,3452,945],{"class":828},[736,3454,3455],{"class":738,"line":2094},[736,3456,3457],{"class":3127},"          \u002F\u002F Omitted rather than blank: an empty attribute reads as an empty id.\n",[736,3459,3460,3462,3464,3466,3469,3471,3474,3476,3478,3480,3483,3486,3488],{"class":738,"line":2100},[736,3461,3442],{"class":828},[736,3463,890],{"class":899},[736,3465,2586],{"class":832},[736,3467,3468],{"class":828}," ?",[736,3470,829],{"class":828},[736,3472,3473],{"class":899}," posthog_distinct_id",[736,3475,812],{"class":828},[736,3477,3371],{"class":832},[736,3479,836],{"class":828},[736,3481,3482],{"class":828}," :",[736,3484,3485],{"class":828}," {}",[736,3487,963],{"class":899},[736,3489,945],{"class":828},[736,3491,3493],{"class":738,"line":3492},32,[736,3494,3495],{"class":828},"        },\n",[736,3497,3499],{"class":738,"line":3498},33,[736,3500,3501],{"class":828},"      }\n",[736,3503,3505],{"class":738,"line":3504},34,[736,3506,3507],{"class":828},"    },\n",[736,3509,3511],{"class":738,"line":3510},35,[736,3512,1009],{"class":828},[736,3514,3516,3518],{"class":738,"line":3515},36,[736,3517,1015],{"class":828},[736,3519,1018],{"class":832},[544,3521,3522,3524,3525,3528,3529,3532],{},[563,3523,2993],{}," returns ",[563,3526,3527],{},"undefined"," outside a tracked turn, and spreading that adds nothing. PostHog is the only registry item that also uses ",[563,3530,3531],{},"events","; the rest only need their span processor. Keep each generated file open while you merge: the env vars and exporter options are the parts worth copying exactly.",[544,3534,3535,3536,3539,3540,3542],{},"Spans and wide events stay joined by attribute, not by trace id: an agent turn has no inbound ",[563,3537,3538],{},"traceparent"," to inherit, so ",[563,3541,2823],{}," is what carries across.",[576,3544,3547,3553,3554,2567,3557,3560,3561,3564,3565,3568,3569,3572,3573,3575],{"color":3545,"icon":3546},"warning","i-lucide-triangle-alert",[554,3548,3549,3550,979],{},"PostHog drops ",[563,3551,3552],{},"evlog.*"," Its exporter forwards the whole span, but the server-side conversion into ",[563,3555,3556],{},"$ai_generation",[563,3558,3559],{},"$ai_span"," events keeps only attributes prefixed ",[563,3562,3563],{},"posthog_",", and strips that prefix. To join on PostHog, repeat the ids under names that survive, since ",[563,3566,3567],{},"posthog_evlog_request_id"," arrives as ",[563,3570,3571],{},"evlog_request_id",". Other OTLP backends receive ",[563,3574,3552],{}," unchanged.",[544,3577,3578,3579,3582],{},"eve applies the runtime context to the step span only, so the generation spans beneath it inherit nothing. On PostHog that means cost lands on events with no identity and no environment. A span processor that copies the turn's ",[563,3580,3581],{},"posthog_*"," attributes onto every child span is what closes the gap.",[544,3584,3585],{},"To close the loop the other way, send the agent's own wide events to PostHog Logs and point the drain at the same principal:",[726,3587,3589],{"className":815,"code":3588,"filename":811,"language":817,"meta":732,"style":732},"import { createPostHogDrain } from 'evlog\u002Fposthog'\nimport { defineEvlogHook } from 'evlog\u002Feve'\n\nexport default defineEvlogHook({\n  drain: createPostHogDrain({ distinctIdField: 'eve.caller.principalId' }),\n})\n",[563,3590,3591,3611,3629,3633,3645,3675],{"__ignoreMap":732},[736,3592,3593,3595,3597,3600,3602,3604,3606,3609],{"class":738,"line":739},[736,3594,825],{"class":824},[736,3596,829],{"class":828},[736,3598,3599],{"class":832}," createPostHogDrain",[736,3601,836],{"class":828},[736,3603,839],{"class":824},[736,3605,842],{"class":828},[736,3607,3608],{"class":745},"evlog\u002Fposthog",[736,3610,847],{"class":828},[736,3612,3613,3615,3617,3619,3621,3623,3625,3627],{"class":738,"line":850},[736,3614,825],{"class":824},[736,3616,829],{"class":828},[736,3618,833],{"class":832},[736,3620,836],{"class":828},[736,3622,839],{"class":824},[736,3624,842],{"class":828},[736,3626,569],{"class":745},[736,3628,847],{"class":828},[736,3630,3631],{"class":738,"line":871},[736,3632,875],{"emptyLinePlaceholder":874},[736,3634,3635,3637,3639,3641,3643],{"class":738,"line":878},[736,3636,881],{"class":824},[736,3638,884],{"class":824},[736,3640,833],{"class":887},[736,3642,890],{"class":832},[736,3644,893],{"class":828},[736,3646,3647,3649,3651,3653,3655,3657,3660,3662,3664,3667,3669,3671,3673],{"class":738,"line":896},[736,3648,935],{"class":899},[736,3650,812],{"class":828},[736,3652,3599],{"class":887},[736,3654,890],{"class":832},[736,3656,1184],{"class":828},[736,3658,3659],{"class":899}," distinctIdField",[736,3661,812],{"class":828},[736,3663,842],{"class":828},[736,3665,3666],{"class":745},"eve.caller.principalId",[736,3668,924],{"class":828},[736,3670,836],{"class":828},[736,3672,963],{"class":832},[736,3674,945],{"class":828},[736,3676,3677,3679],{"class":738,"line":932},[736,3678,1015],{"class":828},[736,3680,1018],{"class":832},[544,3682,3683,3684,979],{},"Turns then land on the same PostHog person as the LLM traces they produced. See the ",[547,3685,3687],{"href":3686},"\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog#link-a-log-to-a-person-and-a-session-replay","PostHog adapter",[639,3689,3691],{"id":3690},"production","Production",[544,3693,3694],{},"Long-running eve agents should disable terminal pretty-printing and use a non-blocking drain:",[726,3696,3698],{"className":815,"code":3697,"filename":811,"language":817,"meta":732,"style":732},"import { defineEvlogHook } from 'evlog\u002Feve'\nimport { createAxiomDrain } from 'evlog\u002Faxiom'\nimport { createDrainPipeline } from 'evlog\u002Fpipeline'\n\nconst drain = createDrainPipeline({ batch: { size: 50, intervalMs: 5000 } })(\n  createAxiomDrain(),\n)\n\nexport default defineEvlogHook({\n  init: {\n    env: { service: 'my-agent', environment: 'production' },\n    pretty: false,\n    sampling: { rates: { info: 10 } },\n  },\n  drain,\n  maxSessions: 256,\n})\n",[563,3699,3700,3718,3736,3756,3760,3809,3818,3822,3826,3838,3846,3880,3893,3921,3925,3931,3943],{"__ignoreMap":732},[736,3701,3702,3704,3706,3708,3710,3712,3714,3716],{"class":738,"line":739},[736,3703,825],{"class":824},[736,3705,829],{"class":828},[736,3707,833],{"class":832},[736,3709,836],{"class":828},[736,3711,839],{"class":824},[736,3713,842],{"class":828},[736,3715,569],{"class":745},[736,3717,847],{"class":828},[736,3719,3720,3722,3724,3726,3728,3730,3732,3734],{"class":738,"line":850},[736,3721,825],{"class":824},[736,3723,829],{"class":828},[736,3725,857],{"class":832},[736,3727,836],{"class":828},[736,3729,839],{"class":824},[736,3731,842],{"class":828},[736,3733,866],{"class":745},[736,3735,847],{"class":828},[736,3737,3738,3740,3742,3745,3747,3749,3751,3754],{"class":738,"line":871},[736,3739,825],{"class":824},[736,3741,829],{"class":828},[736,3743,3744],{"class":832}," createDrainPipeline",[736,3746,836],{"class":828},[736,3748,839],{"class":824},[736,3750,842],{"class":828},[736,3752,3753],{"class":745},"evlog\u002Fpipeline",[736,3755,847],{"class":828},[736,3757,3758],{"class":738,"line":878},[736,3759,875],{"emptyLinePlaceholder":874},[736,3761,3762,3765,3768,3771,3773,3775,3777,3780,3782,3784,3787,3789,3792,3794,3797,3799,3802,3804,3806],{"class":738,"line":896},[736,3763,3764],{"class":966},"const",[736,3766,3767],{"class":832}," drain ",[736,3769,3770],{"class":828},"=",[736,3772,3744],{"class":887},[736,3774,890],{"class":832},[736,3776,1184],{"class":828},[736,3778,3779],{"class":899}," batch",[736,3781,812],{"class":828},[736,3783,829],{"class":828},[736,3785,3786],{"class":899}," size",[736,3788,812],{"class":828},[736,3790,3791],{"class":1488}," 50",[736,3793,1296],{"class":828},[736,3795,3796],{"class":899}," intervalMs",[736,3798,812],{"class":828},[736,3800,3801],{"class":1488}," 5000",[736,3803,836],{"class":828},[736,3805,836],{"class":828},[736,3807,3808],{"class":832},")(\n",[736,3810,3811,3814,3816],{"class":738,"line":932},[736,3812,3813],{"class":887},"  createAxiomDrain",[736,3815,942],{"class":832},[736,3817,945],{"class":828},[736,3819,3820],{"class":738,"line":948},[736,3821,1018],{"class":832},[736,3823,3824],{"class":738,"line":973},[736,3825,875],{"emptyLinePlaceholder":874},[736,3827,3828,3830,3832,3834,3836],{"class":738,"line":1006},[736,3829,881],{"class":824},[736,3831,884],{"class":824},[736,3833,833],{"class":887},[736,3835,890],{"class":832},[736,3837,893],{"class":828},[736,3839,3840,3842,3844],{"class":738,"line":1012},[736,3841,900],{"class":899},[736,3843,812],{"class":828},[736,3845,970],{"class":828},[736,3847,3848,3851,3853,3855,3857,3859,3861,3863,3865,3867,3870,3872,3874,3876,3878],{"class":738,"line":1263},[736,3849,3850],{"class":899},"    env",[736,3852,812],{"class":828},[736,3854,829],{"class":828},[736,3856,914],{"class":899},[736,3858,812],{"class":828},[736,3860,842],{"class":828},[736,3862,921],{"class":745},[736,3864,924],{"class":828},[736,3866,1296],{"class":828},[736,3868,3869],{"class":899}," environment",[736,3871,812],{"class":828},[736,3873,842],{"class":828},[736,3875,3690],{"class":745},[736,3877,924],{"class":828},[736,3879,929],{"class":828},[736,3881,3882,3885,3887,3891],{"class":738,"line":1331},[736,3883,3884],{"class":899},"    pretty",[736,3886,812],{"class":828},[736,3888,3890],{"class":3889},"sfNiH"," false",[736,3892,945],{"class":828},[736,3894,3895,3898,3900,3902,3905,3907,3909,3912,3914,3917,3919],{"class":738,"line":1340},[736,3896,3897],{"class":899},"    sampling",[736,3899,812],{"class":828},[736,3901,829],{"class":828},[736,3903,3904],{"class":899}," rates",[736,3906,812],{"class":828},[736,3908,829],{"class":828},[736,3910,3911],{"class":899}," info",[736,3913,812],{"class":828},[736,3915,3916],{"class":1488}," 10",[736,3918,836],{"class":828},[736,3920,929],{"class":828},[736,3922,3923],{"class":738,"line":1345},[736,3924,1009],{"class":828},[736,3926,3927,3929],{"class":738,"line":1657},[736,3928,935],{"class":832},[736,3930,945],{"class":828},[736,3932,3933,3936,3938,3941],{"class":738,"line":1707},[736,3934,3935],{"class":899},"  maxSessions",[736,3937,812],{"class":828},[736,3939,3940],{"class":1488}," 256",[736,3942,945],{"class":828},[736,3944,3945,3947],{"class":738,"line":1769},[736,3946,1015],{"class":828},[736,3948,1018],{"class":832},[644,3950,3951,3961],{},[647,3952,3953],{},[650,3954,3955,3958],{},[653,3956,3957],{},"Concern",[653,3959,3960],{},"Recommendation",[660,3962,3963,3974,3982,3993,4007],{},[650,3964,3965,3968],{},[665,3966,3967],{},"Terminal output",[665,3969,3970,3973],{},[563,3971,3972],{},"init.pretty: false"," — pretty-print is for local dev only",[650,3975,3976,3979],{},[665,3977,3978],{},"Drain latency",[665,3980,3981],{},"Batch or async HTTP drains; never block the turn on I\u002FO",[650,3983,3984,3987],{},[665,3985,3986],{},"Head sampling",[665,3988,3989,3992],{},[563,3990,3991],{},"init.sampling.rates"," — eve emits one event per turn, not per token",[650,3994,3995,3997],{},[665,3996,216],{},[665,3998,3999,4002,4003,4006],{},[563,4000,4001],{},"maxSessions"," (default ",[563,4004,4005],{},"256",") evicts oldest idle session state",[650,4008,4009,4012],{},[665,4010,4011],{},"Load",[665,4013,4014],{},"Hook handlers are O(1) per stream event; cost is dominated by your drain",[639,4016,336],{"id":4017},"options",[644,4019,4020,4030],{},[647,4021,4022],{},[650,4023,4024,4027],{},[653,4025,4026],{},"Option",[653,4028,4029],{},"Description",[660,4031,4032,4045,4066,4086,4102,4115,4136,4147],{},[650,4033,4034,4038],{},[665,4035,4036],{},[563,4037,89],{},[665,4039,4040,4041,4044],{},"Passed to ",[563,4042,4043],{},"initLogger()"," on first hook invocation",[650,4046,4047,4061],{},[665,4048,4049,2567,4052,2567,4055,2567,4058],{},[563,4050,4051],{},"drain",[563,4053,4054],{},"enrich",[563,4056,4057],{},"keep",[563,4059,4060],{},"plugins",[665,4062,4063,4064,963],{},"Same as HTTP integrations (",[547,4065,4060],{"href":474},[650,4067,4068,4072],{},[665,4069,4070],{},[563,4071,2716],{},[665,4073,4074,4077,4078,4081,4082,4085],{},[563,4075,4076],{},"'omit'"," (default), ",[563,4079,4080],{},"'preview'"," or ",[563,4083,4084],{},"'full'"," — how much of the user message and the agent response to record",[650,4087,4088,4093],{},[665,4089,4090],{},[563,4091,4092],{},"messagePreviewLength",[665,4094,4095,4096,4098,4099,963],{},"Characters kept in ",[563,4097,4080],{}," mode (default ",[563,4100,4101],{},"500",[650,4103,4104,4109],{},[665,4105,4106],{},[563,4107,4108],{},"sessionEvent",[665,4110,4111,4114],{},[563,4112,4113],{},"true"," emits one extra event per session, rolling up its turns",[650,4116,4117,4123],{},[665,4118,4119,2567,4121],{},[563,4120,2734],{},[563,4122,1837],{},[665,4124,4125,4126,1387,4129,4132,4133,4135],{},"Fallback token pricing (",[563,4127,4128],{},"ModelCost",[563,4130,4131],{},"evlog\u002Fai",") → ",[563,4134,2730],{},", used only when eve reports no cost",[650,4137,4138,4142],{},[665,4139,4140],{},[563,4141,4001],{},[665,4143,4144,4145,963],{},"In-memory session cap for context carry-over (default ",[563,4146,4005],{},[650,4148,4149,4157],{},[665,4150,4151,2567,4154],{},[563,4152,4153],{},"include",[563,4155,4156],{},"exclude",[665,4158,4159,4160,963],{},"Route-style filters on turn paths (",[563,4161,4162],{},"\u002Fsessions\u002F*\u002Fturns\u002F*",[639,4164,481],{"id":4165},"tail-sampling",[544,4167,4168,4169,4171],{},"Use ",[563,4170,4057],{}," to force-keep turns with failed tools or high token usage:",[726,4173,4175],{"className":815,"code":4174,"filename":811,"language":817,"meta":732,"style":732},"export default defineEvlogHook({\n  drain: createAxiomDrain(),\n  keep: (ctx) => {\n    const ai = ctx.context.ai as {\n      inputTokens?: number\n      outputTokens?: number\n      tools?: Array\u003C{ success: boolean }>\n    } | undefined\n    const totalTokens = (ai?.inputTokens ?? 0) + (ai?.outputTokens ?? 0)\n    if (totalTokens > 10_000) ctx.shouldKeep = true\n    if (ai?.tools?.some(t => !t.success)) ctx.shouldKeep = true\n  },\n})\n",[563,4176,4177,4189,4201,4218,4244,4255,4264,4288,4299,4341,4371,4417,4421],{"__ignoreMap":732},[736,4178,4179,4181,4183,4185,4187],{"class":738,"line":739},[736,4180,881],{"class":824},[736,4182,884],{"class":824},[736,4184,833],{"class":887},[736,4186,890],{"class":832},[736,4188,893],{"class":828},[736,4190,4191,4193,4195,4197,4199],{"class":738,"line":850},[736,4192,935],{"class":899},[736,4194,812],{"class":828},[736,4196,857],{"class":887},[736,4198,942],{"class":832},[736,4200,945],{"class":828},[736,4202,4203,4206,4208,4210,4212,4214,4216],{"class":738,"line":871},[736,4204,4205],{"class":887},"  keep",[736,4207,812],{"class":828},[736,4209,956],{"class":828},[736,4211,960],{"class":959},[736,4213,963],{"class":828},[736,4215,967],{"class":966},[736,4217,970],{"class":828},[736,4219,4220,4222,4225,4227,4230,4232,4235,4237,4239,4242],{"class":738,"line":878},[736,4221,1228],{"class":966},[736,4223,4224],{"class":832}," ai",[736,4226,990],{"class":828},[736,4228,4229],{"class":832}," ctx",[736,4231,979],{"class":828},[736,4233,4234],{"class":832},"context",[736,4236,979],{"class":828},[736,4238,1823],{"class":832},[736,4240,4241],{"class":824}," as",[736,4243,970],{"class":828},[736,4245,4246,4249,4252],{"class":738,"line":896},[736,4247,4248],{"class":899},"      inputTokens",[736,4250,4251],{"class":828},"?:",[736,4253,4254],{"class":742}," number\n",[736,4256,4257,4260,4262],{"class":738,"line":932},[736,4258,4259],{"class":899},"      outputTokens",[736,4261,4251],{"class":828},[736,4263,4254],{"class":742},[736,4265,4266,4269,4271,4274,4277,4280,4282,4285],{"class":738,"line":948},[736,4267,4268],{"class":899},"      tools",[736,4270,4251],{"class":828},[736,4272,4273],{"class":742}," Array",[736,4275,4276],{"class":828},"\u003C{",[736,4278,4279],{"class":899}," success",[736,4281,812],{"class":828},[736,4283,4284],{"class":742}," boolean",[736,4286,4287],{"class":828}," }>\n",[736,4289,4290,4293,4296],{"class":738,"line":973},[736,4291,4292],{"class":828},"    }",[736,4294,4295],{"class":828}," |",[736,4297,4298],{"class":742}," undefined\n",[736,4300,4301,4303,4306,4308,4310,4312,4314,4316,4319,4321,4324,4327,4329,4331,4333,4335,4337,4339],{"class":738,"line":1006},[736,4302,1228],{"class":966},[736,4304,4305],{"class":832}," totalTokens",[736,4307,990],{"class":828},[736,4309,956],{"class":899},[736,4311,1823],{"class":832},[736,4313,3394],{"class":828},[736,4315,1912],{"class":832},[736,4317,4318],{"class":828}," ??",[736,4320,1614],{"class":1488},[736,4322,4323],{"class":899},") ",[736,4325,4326],{"class":828},"+",[736,4328,956],{"class":899},[736,4330,1823],{"class":832},[736,4332,3394],{"class":828},[736,4334,1929],{"class":832},[736,4336,4318],{"class":828},[736,4338,1614],{"class":1488},[736,4340,1018],{"class":899},[736,4342,4343,4346,4348,4351,4354,4357,4359,4361,4363,4366,4368],{"class":738,"line":1012},[736,4344,4345],{"class":824},"    if",[736,4347,956],{"class":899},[736,4349,4350],{"class":832},"totalTokens",[736,4352,4353],{"class":828}," >",[736,4355,4356],{"class":1488}," 10_000",[736,4358,4323],{"class":899},[736,4360,960],{"class":832},[736,4362,979],{"class":828},[736,4364,4365],{"class":832},"shouldKeep",[736,4367,990],{"class":828},[736,4369,4370],{"class":3889}," true\n",[736,4372,4373,4375,4377,4379,4381,4383,4385,4388,4390,4393,4395,4398,4400,4402,4404,4407,4409,4411,4413,4415],{"class":738,"line":1263},[736,4374,4345],{"class":824},[736,4376,956],{"class":899},[736,4378,1823],{"class":832},[736,4380,3394],{"class":828},[736,4382,1967],{"class":832},[736,4384,3394],{"class":828},[736,4386,4387],{"class":887},"some",[736,4389,890],{"class":899},[736,4391,4392],{"class":959},"t",[736,4394,967],{"class":966},[736,4396,4397],{"class":828}," !",[736,4399,4392],{"class":832},[736,4401,979],{"class":828},[736,4403,2016],{"class":832},[736,4405,4406],{"class":899},")) ",[736,4408,960],{"class":832},[736,4410,979],{"class":828},[736,4412,4365],{"class":832},[736,4414,990],{"class":828},[736,4416,4370],{"class":3889},[736,4418,4419],{"class":738,"line":1331},[736,4420,1009],{"class":828},[736,4422,4423,4425],{"class":738,"line":1340},[736,4424,1015],{"class":828},[736,4426,1018],{"class":832},[639,4428,4430],{"id":4429},"audit-logs","Audit logs",[544,4432,4433,4434,4436,4437,4440,4441,4444,4445,4448,4449,1383,4451,979],{},"Combine with ",[547,4435,378],{"href":384},": register ",[563,4438,4439],{},"auditEnricher()"," via ",[563,4442,4443],{},"init.plugins"," or a global plugin, and call ",[563,4446,4447],{},"log.audit()"," inside tools when a human approval gate fires. Tool rejections surface on ",[563,4450,2502],{},[563,4452,4453],{},"status: \"rejected\"",[639,4455,4457],{"id":4456},"run-locally","Run locally",[726,4459,4461],{"className":728,"code":4460,"language":731,"meta":732,"style":732},"git clone https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog\ncd evlog\npnpm install\npnpm example eve\n",[563,4462,4463,4474,4482,4489],{"__ignoreMap":732},[736,4464,4465,4468,4471],{"class":738,"line":739},[736,4466,4467],{"class":742},"git",[736,4469,4470],{"class":745}," clone",[736,4472,4473],{"class":745}," https:\u002F\u002Fgithub.com\u002FHugoRCD\u002Fevlog\n",[736,4475,4476,4479],{"class":738,"line":850},[736,4477,4478],{"class":887},"cd",[736,4480,4481],{"class":745}," evlog\n",[736,4483,4484,4486],{"class":738,"line":871},[736,4485,730],{"class":742},[736,4487,4488],{"class":745}," install\n",[736,4490,4491,4493,4496],{"class":738,"line":878},[736,4492,730],{"class":742},[736,4494,4495],{"class":745}," example",[736,4497,752],{"class":745},[544,4499,4500,4501,4504,4505,4508,4509,4512,4513,4519],{},"The ",[563,4502,4503],{},"examples\u002Feve"," project is a ",[554,4506,4507],{},"support refund copilot"," (Clearbill SaaS): lookup customer → lookup order → issue refund, with eve approvals when amount > $100. Run ",[563,4510,4511],{},"pnpm example eve",", open ",[554,4514,4515],{},[547,4516,4517],{"href":4517,"rel":4518},"http:\u002F\u002Flocalhost:3000",[551],", and click a starter prompt.",[639,4521,4523],{"id":4522},"what-to-read-next","What to read next",[602,4525,4526,4534,4542,4548],{},[605,4527,4528,4533],{},[547,4529,4532],{"href":4530,"rel":4531},"https:\u002F\u002Feve.dev\u002Fdocs\u002Fguides\u002Fhooks",[551],"eve hooks guide",": stream event vocabulary",[605,4535,4536,4541],{},[547,4537,4540],{"href":4538,"rel":4539},"https:\u002F\u002Feve.dev\u002Fdocs\u002Fguides\u002Finstrumentation",[551],"eve instrumentation",": OTel spans (complementary)",[605,4543,4544,4547],{},[547,4545,4546],{"href":328},"AI SDK use case",": when you own the model loop directly",[605,4549,4550,4553],{},[547,4551,4552],{"href":143},"Adapters overview",": drain destinations",[4555,4556,4557],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":732,"searchDepth":850,"depth":850,"links":4559},[4560,4561,4567,4570,4573,4574,4575,4576,4577,4578],{"id":641,"depth":850,"text":642},{"id":716,"depth":850,"text":25,"children":4562},[4563,4564,4565,4566],{"id":720,"depth":871,"text":721},{"id":804,"depth":871,"text":805},{"id":1032,"depth":871,"text":1033},{"id":1375,"depth":871,"text":1376},{"id":1416,"depth":850,"text":1417,"children":4568},[4569],{"id":2535,"depth":871,"text":2536},{"id":2772,"depth":850,"text":2773,"children":4571},[4572],{"id":2967,"depth":871,"text":2968},{"id":3690,"depth":850,"text":3691},{"id":4017,"depth":850,"text":336},{"id":4165,"depth":850,"text":481},{"id":4429,"depth":850,"text":4430},{"id":4456,"depth":850,"text":4457},{"id":4522,"depth":850,"text":4523},"One evlog wide event per eve agent turn: token usage, tool executions, and business context, through your own drains and tail sampling.","md",[4582],{"label":4583,"icon":4584,"to":1065,"color":1352,"variant":4585},"Source Code","i-simple-icons-github","subtle",{},{"title":436,"icon":439},{"title":436,"description":4579},"aEXREIcOZ0UFy8nrixpzNL8ZYKVqViSt7bL17X6hZnE",[4591,4593],{"title":431,"path":432,"stem":433,"description":4592,"icon":434,"children":-1},"Add derived context to every wide event, from user agent and geo to your own computed fields.",{"title":36,"path":446,"stem":447,"description":4594,"icon":448,"children":-1},"Observe what flows through the pipeline, plug into it, or build your own bricks. The map of every extension point evlog exposes.",1787856371076]