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