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