[{"data":1,"prerenderedAt":3478},["ShallowReactive",2],{"navigation_docs":3,"-extend-diagnostics-channel":612,"-extend-diagnostics-channel-surround":3473},[4,35,85,138,318,453,489,548,587],{"title":5,"path":6,"stem":7,"children":8,"page":34},"Start","\u002Fstart","1.start",[9,14,19,24,29],{"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",{"title":30,"path":31,"stem":32,"icon":33},"Choose your logger","\u002Fstart\u002Ftypescript-logging-library","1.start\u002F5.typescript-logging-library","i-lucide-file-code",false,{"title":36,"path":37,"stem":38,"children":39,"page":34},"Learn","\u002Flearn","2.learn",[40,45,50,55,60,65,70,75,80],{"title":41,"path":42,"stem":43,"icon":44},"Overview","\u002Flearn\u002Foverview","2.learn\u002F0.overview","i-lucide-list",{"title":46,"path":47,"stem":48,"icon":49},"Simple Logging","\u002Flearn\u002Fsimple-logging","2.learn\u002F1.simple-logging","i-lucide-terminal",{"title":51,"path":52,"stem":53,"icon":54},"Wide Events","\u002Flearn\u002Fwide-events","2.learn\u002F2.wide-events","i-lucide-layers",{"title":56,"path":57,"stem":58,"icon":59},"Structured Errors","\u002Flearn\u002Fstructured-errors","2.learn\u002F3.structured-errors","i-lucide-shield-alert",{"title":61,"path":62,"stem":63,"icon":64},"Lifecycle","\u002Flearn\u002Flifecycle","2.learn\u002F4.lifecycle","i-lucide-arrow-right-left",{"title":66,"path":67,"stem":68,"icon":69},"Sampling","\u002Flearn\u002Fsampling","2.learn\u002F5.sampling","i-lucide-filter",{"title":71,"path":72,"stem":73,"icon":74},"Auto-Redaction","\u002Flearn\u002Fredaction","2.learn\u002F6.redaction","i-lucide-eye-off",{"title":76,"path":77,"stem":78,"icon":79},"Typed Fields","\u002Flearn\u002Ftyped-fields","2.learn\u002F7.typed-fields","i-simple-icons-typescript",{"title":81,"path":82,"stem":83,"icon":84},"Catalogs","\u002Flearn\u002Fcatalogs","2.learn\u002F8.catalogs","i-lucide-book-open",{"title":86,"path":87,"stem":88,"children":89,"page":34},"CLI","\u002Fcli","3.cli",[90,93,98,103,108,113,118,123,128,133],{"title":41,"path":91,"stem":92,"icon":49},"\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":94,"path":95,"stem":96,"icon":97},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":99,"path":100,"stem":101,"icon":102},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":104,"path":105,"stem":106,"icon":107},"Rules","\u002Fcli\u002Frules","3.cli\u002F3.rules","i-lucide-list-checks",{"title":109,"path":110,"stem":111,"icon":112},"Scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring","i-lucide-gauge",{"title":114,"path":115,"stem":116,"icon":117},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":119,"path":120,"stem":121,"icon":122},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":124,"path":125,"stem":126,"icon":127},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":129,"path":130,"stem":131,"icon":132},"agents","\u002Fcli\u002Fagents","3.cli\u002F8.agents","i-lucide-bot",{"title":134,"path":135,"stem":136,"icon":137},"Observability Score","\u002Fcli\u002Fobservability-score","3.cli\u002F9.observability-score","i-lucide-activity",{"title":139,"path":140,"stem":141,"children":142,"page":34},"Integrate","\u002Fintegrate","4.integrate",[143,147,230],{"title":41,"path":144,"stem":145,"icon":146},"\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":148,"path":149,"stem":150,"children":151,"page":34},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[152,155,185,210],{"title":41,"path":153,"stem":154,"icon":44},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview",{"title":156,"path":157,"stem":158,"children":159,"page":34},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[160,165,170,175,180],{"title":161,"path":162,"stem":163,"icon":164},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":166,"path":167,"stem":168,"icon":169},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog","i-simple-icons-posthog",{"title":171,"path":172,"stem":173,"icon":174},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F03.sentry","i-simple-icons-sentry",{"title":176,"path":177,"stem":178,"icon":179},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F04.better-stack","i-simple-icons-betterstack",{"title":181,"path":182,"stem":183,"icon":184},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F05.datadog","i-simple-icons-datadog",{"title":186,"path":187,"stem":188,"children":189,"page":34},"Cloud or Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fhybrid","4.integrate\u002Fadapters\u002Fhybrid",[190,195,200,205],{"title":191,"path":192,"stem":193,"icon":194},"Grafana Loki","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki","4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki","i-simple-icons-grafana",{"title":196,"path":197,"stem":198,"icon":199},"ClickHouse","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fclickhouse","4.integrate\u002Fadapters\u002Fhybrid\u002F02.clickhouse","i-simple-icons-clickhouse",{"title":201,"path":202,"stem":203,"icon":204},"OTLP","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fotlp","4.integrate\u002Fadapters\u002Fhybrid\u002F03.otlp","i-simple-icons-opentelemetry",{"title":206,"path":207,"stem":208,"icon":209},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fhyperdx","4.integrate\u002Fadapters\u002Fhybrid\u002F04.hyperdx","i-custom-hyperdx",{"title":211,"path":212,"stem":213,"children":214,"page":34},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[215,220,225],{"title":216,"path":217,"stem":218,"icon":219},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":221,"path":222,"stem":223,"icon":224},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":226,"path":227,"stem":228,"icon":229},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":231,"path":232,"stem":233,"children":234,"page":34},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[235,239,244,249,254,259,264,269,274,279,284,289,294,299,303,308,313],{"title":41,"path":236,"stem":237,"icon":238},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":240,"path":241,"stem":242,"icon":243},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":245,"path":246,"stem":247,"icon":248},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":250,"path":251,"stem":252,"icon":253},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":255,"path":256,"stem":257,"icon":258},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":260,"path":261,"stem":262,"icon":263},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":265,"path":266,"stem":267,"icon":268},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":270,"path":271,"stem":272,"icon":273},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":275,"path":276,"stem":277,"icon":278},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":280,"path":281,"stem":282,"icon":283},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":285,"path":286,"stem":287,"icon":288},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":290,"path":291,"stem":292,"icon":293},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":295,"path":296,"stem":297,"icon":298},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":300,"path":301,"stem":302,"icon":79},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":304,"path":305,"stem":306,"icon":307},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":309,"path":310,"stem":311,"icon":312},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":314,"path":315,"stem":316,"icon":317},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":319,"path":320,"stem":321,"children":322,"page":34},"Use Cases","\u002Fuse-cases","5.use-cases",[323,326,331,359,386,418,439,444,449],{"title":41,"path":324,"stem":325,"icon":107},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":327,"path":328,"stem":329,"icon":330},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":332,"icon":333,"path":334,"stem":335,"children":336,"page":34},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[337,340,345,350,355],{"title":41,"path":338,"stem":339,"icon":44},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":341,"path":342,"stem":343,"icon":344},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":346,"path":347,"stem":348,"icon":349},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":351,"path":352,"stem":353,"icon":354},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":356,"path":357,"stem":358,"icon":137},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry",{"title":360,"icon":361,"path":362,"stem":363,"children":364,"page":34},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[365,368,373,378,382],{"title":41,"path":366,"stem":367,"icon":44},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":369,"path":370,"stem":371,"icon":372},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":374,"path":375,"stem":376,"icon":377},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":379,"path":380,"stem":381,"icon":330},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":383,"path":384,"stem":385,"icon":112},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance",{"title":387,"icon":388,"path":389,"stem":390,"children":391,"page":34},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[392,395,400,405,410,414],{"title":41,"path":393,"stem":394,"icon":44},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":396,"path":397,"stem":398,"icon":399},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":401,"path":402,"stem":403,"icon":404},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":406,"path":407,"stem":408,"icon":409},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":411,"path":412,"stem":413,"icon":388},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":415,"path":416,"stem":417,"icon":84},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes",{"title":356,"icon":112,"path":419,"stem":420,"children":421,"page":34},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[422,425,430,435],{"title":41,"path":423,"stem":424,"icon":44},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":426,"path":427,"stem":428,"icon":429},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":431,"path":432,"stem":433,"icon":434},"Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest","i-lucide-server",{"title":436,"path":437,"stem":438,"icon":84},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":440,"path":441,"stem":442,"icon":443},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":445,"path":446,"stem":447,"icon":448},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve","i-custom-eve",{"title":450,"path":451,"stem":452,"icon":434},"Node.js request logging","\u002Fuse-cases\u002Fstructured-logging-nodejs","5.use-cases\u002F6.structured-logging-nodejs",{"title":454,"path":455,"stem":456,"children":457,"page":34},"Libraries","\u002Flibraries","6.libraries",[458,462,467,470,474,479,484],{"title":41,"path":459,"stem":460,"icon":461},"\u002Flibraries\u002Foverview","6.libraries\u002F0.overview","i-lucide-package",{"title":463,"path":464,"stem":465,"icon":466},"Emitting Events","\u002Flibraries\u002Femitting","6.libraries\u002F1.emitting","i-lucide-radio",{"title":56,"path":468,"stem":469,"icon":59},"\u002Flibraries\u002Ferrors","6.libraries\u002F2.errors",{"title":471,"path":472,"stem":473,"icon":132},"Errors Agents Can Act On","\u002Flibraries\u002Fagents","6.libraries\u002F3.agents",{"title":475,"path":476,"stem":477,"icon":478},"Exporting the Catalog","\u002Flibraries\u002Fexporting","6.libraries\u002F4.exporting","i-lucide-file-output",{"title":480,"path":481,"stem":482,"icon":483},"Migrating","\u002Flibraries\u002Fmigrating","6.libraries\u002F5.migrating","i-lucide-route",{"title":485,"path":486,"stem":487,"icon":488},"Testing","\u002Flibraries\u002Ftesting","6.libraries\u002F6.testing","i-lucide-flask-conical",{"title":490,"path":491,"stem":492,"children":493,"page":34},"Extend","\u002Fextend","7.extend",[494,498,503,508,512,517,521,525,529,533,538,543],{"title":41,"path":495,"stem":496,"icon":497},"\u002Fextend\u002Foverview","7.extend\u002F0.overview","i-lucide-blocks",{"title":499,"path":500,"stem":501,"icon":502},"Stream","\u002Fextend\u002Fstream","7.extend\u002F1.stream","i-lucide-radio-tower",{"title":504,"path":505,"stem":506,"icon":507},"Custom framework","\u002Fextend\u002Fcustom-framework","7.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":509,"path":510,"stem":511,"icon":502},"Diagnostics channel","\u002Fextend\u002Fdiagnostics-channel","7.extend\u002F11.diagnostics-channel",{"title":513,"path":514,"stem":515,"icon":516},"FS reader","\u002Fextend\u002Ffs-reader","7.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":415,"path":518,"stem":519,"icon":520},"\u002Fextend\u002Fconsumer-recipes","7.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":522,"path":523,"stem":524,"icon":497},"Plugins","\u002Fextend\u002Fplugins","7.extend\u002F4.plugins",{"title":526,"path":527,"stem":528,"icon":443},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","7.extend\u002F5.custom-enrichers",{"title":530,"path":531,"stem":532,"icon":69},"Tail sampling","\u002Fextend\u002Ftail-sampling","7.extend\u002F6.tail-sampling",{"title":534,"path":535,"stem":536,"icon":537},"Identity headers","\u002Fextend\u002Fidentity-headers","7.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":539,"path":540,"stem":541,"icon":542},"Custom drains","\u002Fextend\u002Fcustom-drains","7.extend\u002F8.custom-drains","i-lucide-share-2",{"title":544,"path":545,"stem":546,"icon":547},"Drain pipeline","\u002Fextend\u002Fdrain-pipeline","7.extend\u002F9.drain-pipeline","i-lucide-workflow",{"title":436,"path":549,"stem":550,"children":551,"page":34},"\u002Freference","8.reference",[552,556,561,564,569,573,578,582],{"title":41,"path":553,"stem":554,"icon":555},"\u002Freference\u002Foverview","8.reference\u002F0.overview","i-lucide-book-marked",{"title":557,"path":558,"stem":559,"icon":560},"Configuration","\u002Freference\u002Fconfiguration","8.reference\u002F1.configuration","i-lucide-settings",{"title":383,"path":562,"stem":563,"icon":112},"\u002Freference\u002Fperformance","8.reference\u002F2.performance",{"title":565,"path":566,"stem":567,"icon":568},"Vite Plugin","\u002Freference\u002Fvite-plugin","8.reference\u002F3.vite-plugin","i-custom-vite",{"title":570,"path":571,"stem":572,"icon":388},"Best Practices","\u002Freference\u002Fbest-practices","8.reference\u002F4.best-practices",{"title":574,"path":575,"stem":576,"icon":577},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","8.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":579,"path":580,"stem":581,"icon":443},"Agent Skills","\u002Freference\u002Fagent-skills","8.reference\u002F6.agent-skills",{"title":583,"path":584,"stem":585,"icon":586},"Cost","\u002Freference\u002Fcost","8.reference\u002F7.cost","i-lucide-receipt",{"title":588,"path":589,"stem":590,"children":591,"page":34},"Compare","\u002Fcompare","9.compare",[592,596,600,604,608],{"title":593,"path":594,"stem":595,"icon":577},"evlog vs Pino","\u002Fcompare\u002Fpino","9.compare\u002F1.pino",{"title":597,"path":598,"stem":599,"icon":204},"evlog vs OpenTelemetry","\u002Fcompare\u002Fopentelemetry","9.compare\u002F2.opentelemetry",{"title":601,"path":602,"stem":603,"icon":577},"evlog vs LogTape","\u002Fcompare\u002Flogtape","9.compare\u002F3.logtape",{"title":605,"path":606,"stem":607,"icon":577},"evlog vs Winston: formats and request events","\u002Fcompare\u002Fwinston","9.compare\u002F4.winston",{"title":609,"path":610,"stem":611,"icon":577},"evlog vs Consola: reporters and request context","\u002Fcompare\u002Fconsola","9.compare\u002F5.consola",{"id":613,"title":614,"body":615,"description":3462,"extension":3463,"links":3464,"meta":3469,"navigation":3470,"path":510,"seo":3471,"stem":511,"__hash__":3472},"docs\u002F7.extend\u002F11.diagnostics-channel.md","Diagnostics Channel",{"type":616,"value":617,"toc":3450},"minimark",[618,640,645,656,685,692,696,699,760,768,1610,1625,1636,1640,1643,1872,1886,1889,2079,2089,2093,2096,2382,2404,2417,2424,2428,2433,2439,2666,2683,2688,2692,2695,3092,3098,3101,3112,3340,3361,3365,3372,3440,3446],[619,620,621,631,632,635,636,639],"p",{},[622,623,627],"a",{"href":624,"rel":625},"https:\u002F\u002Fnodejs.org\u002Fapi\u002Fdiagnostics_channel.html",[626],"nofollow",[628,629,630],"code",{},"node:diagnostics_channel"," is the runtime's built-in pub\u002Fsub for instrumentation. evlog can publish every wide event on the ",[628,633,634],{},"evlog.event"," channel, so a consumer subscribes by channel name alone: no evlog import, no entry in ",[628,637,638],{},"initLogger()",".",[641,642,644],"h2",{"id":643},"what-its-for","What it's for",[619,646,647,648,651,652,655],{},"Two things you cannot do with a ",[622,649,650],{"href":523},"plugin"," or a ",[622,653,654],{"href":540},"drain",":",[657,658,659,670],"ul",{},[660,661,662,666,667,669],"li",{},[663,664,665],"strong",{},"Ship an evlog integration from a package that does not depend on evlog."," A subscriber only needs the channel name, so a vendor SDK, an internal shared library, or an APM agent can consume wide events without a peer dependency, a version constraint, or a line in your ",[628,668,638],{}," call.",[660,671,672,675,676,680,681,684],{},[663,673,674],{},"Get events out of a Cloudflare Worker without a drain."," Workers forwards every channel message to a ",[622,677,679],{"href":678},"#cloudflare-workers","Tail Worker",", which runs after the response with its own CPU budget, no ",[628,682,683],{},"waitUntil",", no drain competing with your request.",[619,686,687,688,639],{},"For everything else (batching, retry, adding fields, fanning out to several in-process consumers), a plugin or a drain is the better tool. There is a ",[622,689,691],{"href":690},"#when-a-plugin-is-the-better-tool","comparison at the bottom of this page",[641,693,695],{"id":694},"enabling-it","Enabling it",[619,697,698],{},"It is off by default. Turn it on once, at startup:",[700,701,706],"pre",{"className":702,"code":703,"language":704,"meta":705,"style":705},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { enableDiagnosticsChannel } from 'evlog\u002Fdiagnostics'\n\nawait enableDiagnosticsChannel()\n","typescript","",[628,707,708,741,748],{"__ignoreMap":705},[709,710,713,717,721,725,728,731,734,738],"span",{"class":711,"line":712},"line",1,[709,714,716],{"class":715},"s7zQu","import",[709,718,720],{"class":719},"sMK4o"," {",[709,722,724],{"class":723},"sTEyZ"," enableDiagnosticsChannel",[709,726,727],{"class":719}," }",[709,729,730],{"class":715}," from",[709,732,733],{"class":719}," '",[709,735,737],{"class":736},"sfazB","evlog\u002Fdiagnostics",[709,739,740],{"class":719},"'\n",[709,742,744],{"class":711,"line":743},2,[709,745,747],{"emptyLinePlaceholder":746},true,"\n",[709,749,751,754,757],{"class":711,"line":750},3,[709,752,753],{"class":715},"await",[709,755,724],{"class":756},"s2Zo4",[709,758,759],{"class":723},"()\n",[619,761,762,763,767],{},"The call takes no options and is the same on every framework. Only ",[764,765,766],"em",{},"where"," your app runs startup code differs:",[769,770,771,853,1099,1187,1312,1519],"code-group",{},[700,772,775],{"className":702,"code":773,"filename":774,"language":704,"meta":705,"style":705},"\u002F\u002F server\u002Fplugins\u002Fevlog-diagnostics.ts\nimport { enableDiagnosticsChannel } from 'evlog\u002Fdiagnostics'\n\nexport default defineNitroPlugin(async () => {\n  await enableDiagnosticsChannel()\n})\n","Nuxt \u002F Nitro",[628,776,777,783,801,805,833,844],{"__ignoreMap":705},[709,778,779],{"class":711,"line":712},[709,780,782],{"class":781},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog-diagnostics.ts\n",[709,784,785,787,789,791,793,795,797,799],{"class":711,"line":743},[709,786,716],{"class":715},[709,788,720],{"class":719},[709,790,724],{"class":723},[709,792,727],{"class":719},[709,794,730],{"class":715},[709,796,733],{"class":719},[709,798,737],{"class":736},[709,800,740],{"class":719},[709,802,803],{"class":711,"line":750},[709,804,747],{"emptyLinePlaceholder":746},[709,806,808,811,814,817,820,824,827,830],{"class":711,"line":807},4,[709,809,810],{"class":715},"export",[709,812,813],{"class":715}," default",[709,815,816],{"class":756}," defineNitroPlugin",[709,818,819],{"class":723},"(",[709,821,823],{"class":822},"spNyl","async",[709,825,826],{"class":719}," ()",[709,828,829],{"class":822}," =>",[709,831,832],{"class":719}," {\n",[709,834,836,839,841],{"class":711,"line":835},5,[709,837,838],{"class":715},"  await",[709,840,724],{"class":756},[709,842,759],{"class":843},"swJcz",[709,845,847,850],{"class":711,"line":846},6,[709,848,849],{"class":719},"}",[709,851,852],{"class":723},")\n",[700,854,856],{"className":702,"code":855,"filename":245,"language":704,"meta":705,"style":705},"\u002F\u002F instrumentation.ts\nimport { defineNodeInstrumentation } from 'evlog\u002Fnext\u002Finstrumentation'\n\nexport const { register, onRequestError } = defineNodeInstrumentation(async () => {\n  const { createInstrumentation } = await import('evlog\u002Fnext\u002Finstrumentation\u002Fcreate')\n  const { enableDiagnosticsChannel } = await import('evlog\u002Fdiagnostics')\n  const { register: evlogRegister, onRequestError } = createInstrumentation({ service: 'my-app' })\n\n  return {\n    async register() {\n      await evlogRegister()\n      await enableDiagnosticsChannel()\n    },\n    onRequestError,\n  }\n})\n",[628,857,858,863,883,887,922,954,980,1026,1031,1039,1052,1062,1071,1077,1086,1092],{"__ignoreMap":705},[709,859,860],{"class":711,"line":712},[709,861,862],{"class":781},"\u002F\u002F instrumentation.ts\n",[709,864,865,867,869,872,874,876,878,881],{"class":711,"line":743},[709,866,716],{"class":715},[709,868,720],{"class":719},[709,870,871],{"class":723}," defineNodeInstrumentation",[709,873,727],{"class":719},[709,875,730],{"class":715},[709,877,733],{"class":719},[709,879,880],{"class":736},"evlog\u002Fnext\u002Finstrumentation",[709,882,740],{"class":719},[709,884,885],{"class":711,"line":750},[709,886,747],{"emptyLinePlaceholder":746},[709,888,889,891,894,896,899,902,905,907,910,912,914,916,918,920],{"class":711,"line":807},[709,890,810],{"class":715},[709,892,893],{"class":822}," const",[709,895,720],{"class":719},[709,897,898],{"class":723}," register",[709,900,901],{"class":719},",",[709,903,904],{"class":723}," onRequestError ",[709,906,849],{"class":719},[709,908,909],{"class":719}," =",[709,911,871],{"class":756},[709,913,819],{"class":723},[709,915,823],{"class":822},[709,917,826],{"class":719},[709,919,829],{"class":822},[709,921,832],{"class":719},[709,923,924,927,929,932,934,936,939,942,944,947,950,952],{"class":711,"line":835},[709,925,926],{"class":822},"  const",[709,928,720],{"class":719},[709,930,931],{"class":723}," createInstrumentation",[709,933,727],{"class":719},[709,935,909],{"class":719},[709,937,938],{"class":715}," await",[709,940,941],{"class":719}," import",[709,943,819],{"class":843},[709,945,946],{"class":719},"'",[709,948,949],{"class":736},"evlog\u002Fnext\u002Finstrumentation\u002Fcreate",[709,951,946],{"class":719},[709,953,852],{"class":843},[709,955,956,958,960,962,964,966,968,970,972,974,976,978],{"class":711,"line":846},[709,957,926],{"class":822},[709,959,720],{"class":719},[709,961,724],{"class":723},[709,963,727],{"class":719},[709,965,909],{"class":719},[709,967,938],{"class":715},[709,969,941],{"class":719},[709,971,819],{"class":843},[709,973,946],{"class":719},[709,975,737],{"class":736},[709,977,946],{"class":719},[709,979,852],{"class":843},[709,981,983,985,987,989,991,994,996,999,1001,1003,1005,1007,1010,1013,1015,1017,1020,1022,1024],{"class":711,"line":982},7,[709,984,926],{"class":822},[709,986,720],{"class":719},[709,988,898],{"class":843},[709,990,655],{"class":719},[709,992,993],{"class":723}," evlogRegister",[709,995,901],{"class":719},[709,997,998],{"class":723}," onRequestError",[709,1000,727],{"class":719},[709,1002,909],{"class":719},[709,1004,931],{"class":756},[709,1006,819],{"class":843},[709,1008,1009],{"class":719},"{",[709,1011,1012],{"class":843}," service",[709,1014,655],{"class":719},[709,1016,733],{"class":719},[709,1018,1019],{"class":736},"my-app",[709,1021,946],{"class":719},[709,1023,727],{"class":719},[709,1025,852],{"class":843},[709,1027,1029],{"class":711,"line":1028},8,[709,1030,747],{"emptyLinePlaceholder":746},[709,1032,1034,1037],{"class":711,"line":1033},9,[709,1035,1036],{"class":715},"  return",[709,1038,832],{"class":719},[709,1040,1042,1045,1047,1050],{"class":711,"line":1041},10,[709,1043,1044],{"class":822},"    async",[709,1046,898],{"class":843},[709,1048,1049],{"class":719},"()",[709,1051,832],{"class":719},[709,1053,1055,1058,1060],{"class":711,"line":1054},11,[709,1056,1057],{"class":715},"      await",[709,1059,993],{"class":756},[709,1061,759],{"class":843},[709,1063,1065,1067,1069],{"class":711,"line":1064},12,[709,1066,1057],{"class":715},[709,1068,724],{"class":756},[709,1070,759],{"class":843},[709,1072,1074],{"class":711,"line":1073},13,[709,1075,1076],{"class":719},"    },\n",[709,1078,1080,1083],{"class":711,"line":1079},14,[709,1081,1082],{"class":723},"    onRequestError",[709,1084,1085],{"class":719},",\n",[709,1087,1089],{"class":711,"line":1088},15,[709,1090,1091],{"class":719},"  }\n",[709,1093,1095,1097],{"class":711,"line":1094},16,[709,1096,849],{"class":719},[709,1098,852],{"class":723},[700,1100,1102],{"className":702,"code":1101,"filename":250,"language":704,"meta":705,"style":705},"\u002F\u002F src\u002Fhooks.server.ts\nimport { createEvlogHooks } from 'evlog\u002Fsveltekit'\nimport { enableDiagnosticsChannel } from 'evlog\u002Fdiagnostics'\n\nawait enableDiagnosticsChannel()\n\nexport const { handle, handleError } = createEvlogHooks()\n",[628,1103,1104,1109,1129,1147,1151,1159,1163],{"__ignoreMap":705},[709,1105,1106],{"class":711,"line":712},[709,1107,1108],{"class":781},"\u002F\u002F src\u002Fhooks.server.ts\n",[709,1110,1111,1113,1115,1118,1120,1122,1124,1127],{"class":711,"line":743},[709,1112,716],{"class":715},[709,1114,720],{"class":719},[709,1116,1117],{"class":723}," createEvlogHooks",[709,1119,727],{"class":719},[709,1121,730],{"class":715},[709,1123,733],{"class":719},[709,1125,1126],{"class":736},"evlog\u002Fsveltekit",[709,1128,740],{"class":719},[709,1130,1131,1133,1135,1137,1139,1141,1143,1145],{"class":711,"line":750},[709,1132,716],{"class":715},[709,1134,720],{"class":719},[709,1136,724],{"class":723},[709,1138,727],{"class":719},[709,1140,730],{"class":715},[709,1142,733],{"class":719},[709,1144,737],{"class":736},[709,1146,740],{"class":719},[709,1148,1149],{"class":711,"line":807},[709,1150,747],{"emptyLinePlaceholder":746},[709,1152,1153,1155,1157],{"class":711,"line":835},[709,1154,753],{"class":715},[709,1156,724],{"class":756},[709,1158,759],{"class":723},[709,1160,1161],{"class":711,"line":846},[709,1162,747],{"emptyLinePlaceholder":746},[709,1164,1165,1167,1169,1171,1174,1176,1179,1181,1183,1185],{"class":711,"line":982},[709,1166,810],{"class":715},[709,1168,893],{"class":822},[709,1170,720],{"class":719},[709,1172,1173],{"class":723}," handle",[709,1175,901],{"class":719},[709,1177,1178],{"class":723}," handleError ",[709,1180,849],{"class":719},[709,1182,909],{"class":719},[709,1184,1117],{"class":756},[709,1186,759],{"class":723},[700,1188,1190],{"className":702,"code":1189,"filename":275,"language":704,"meta":705,"style":705},"\u002F\u002F Same shape for Express, Fastify, Elysia, NestJS and oRPC:\n\u002F\u002F enable once in the server entry, before the app starts serving.\nimport { Hono } from 'hono'\nimport { evlog } from 'evlog\u002Fhono'\nimport { enableDiagnosticsChannel } from 'evlog\u002Fdiagnostics'\n\nawait enableDiagnosticsChannel()\n\nconst app = new Hono()\napp.use(evlog())\n",[628,1191,1192,1197,1202,1222,1242,1260,1264,1272,1276,1294],{"__ignoreMap":705},[709,1193,1194],{"class":711,"line":712},[709,1195,1196],{"class":781},"\u002F\u002F Same shape for Express, Fastify, Elysia, NestJS and oRPC:\n",[709,1198,1199],{"class":711,"line":743},[709,1200,1201],{"class":781},"\u002F\u002F enable once in the server entry, before the app starts serving.\n",[709,1203,1204,1206,1208,1211,1213,1215,1217,1220],{"class":711,"line":750},[709,1205,716],{"class":715},[709,1207,720],{"class":719},[709,1209,1210],{"class":723}," Hono",[709,1212,727],{"class":719},[709,1214,730],{"class":715},[709,1216,733],{"class":719},[709,1218,1219],{"class":736},"hono",[709,1221,740],{"class":719},[709,1223,1224,1226,1228,1231,1233,1235,1237,1240],{"class":711,"line":807},[709,1225,716],{"class":715},[709,1227,720],{"class":719},[709,1229,1230],{"class":723}," evlog",[709,1232,727],{"class":719},[709,1234,730],{"class":715},[709,1236,733],{"class":719},[709,1238,1239],{"class":736},"evlog\u002Fhono",[709,1241,740],{"class":719},[709,1243,1244,1246,1248,1250,1252,1254,1256,1258],{"class":711,"line":835},[709,1245,716],{"class":715},[709,1247,720],{"class":719},[709,1249,724],{"class":723},[709,1251,727],{"class":719},[709,1253,730],{"class":715},[709,1255,733],{"class":719},[709,1257,737],{"class":736},[709,1259,740],{"class":719},[709,1261,1262],{"class":711,"line":846},[709,1263,747],{"emptyLinePlaceholder":746},[709,1265,1266,1268,1270],{"class":711,"line":982},[709,1267,753],{"class":715},[709,1269,724],{"class":756},[709,1271,759],{"class":723},[709,1273,1274],{"class":711,"line":1028},[709,1275,747],{"emptyLinePlaceholder":746},[709,1277,1278,1281,1284,1287,1290,1292],{"class":711,"line":1033},[709,1279,1280],{"class":822},"const",[709,1282,1283],{"class":723}," app ",[709,1285,1286],{"class":719},"=",[709,1288,1289],{"class":719}," new",[709,1291,1210],{"class":756},[709,1293,759],{"class":723},[709,1295,1296,1299,1301,1304,1306,1309],{"class":711,"line":1041},[709,1297,1298],{"class":723},"app",[709,1300,639],{"class":719},[709,1302,1303],{"class":756},"use",[709,1305,819],{"class":723},[709,1307,1308],{"class":756},"evlog",[709,1310,1311],{"class":723},"())\n",[700,1313,1315],{"className":702,"code":1314,"filename":295,"language":704,"meta":705,"style":705},"\u002F\u002F src\u002Fworker.ts — needs the nodejs_compat flag\nimport { initWorkersLogger, withEvlog } from 'evlog\u002Fworkers'\nimport { enableDiagnosticsChannel } from 'evlog\u002Fdiagnostics'\n\ninitWorkersLogger({ env: { service: 'my-worker' } })\nawait enableDiagnosticsChannel()\n\nexport default withEvlog(async (request, env, ctx, log) => {\n  log.set({ action: 'handle_request' })\n  return Response.json({ ok: true })\n})\n",[628,1316,1317,1322,1347,1365,1369,1402,1410,1414,1454,1484,1513],{"__ignoreMap":705},[709,1318,1319],{"class":711,"line":712},[709,1320,1321],{"class":781},"\u002F\u002F src\u002Fworker.ts — needs the nodejs_compat flag\n",[709,1323,1324,1326,1328,1331,1333,1336,1338,1340,1342,1345],{"class":711,"line":743},[709,1325,716],{"class":715},[709,1327,720],{"class":719},[709,1329,1330],{"class":723}," initWorkersLogger",[709,1332,901],{"class":719},[709,1334,1335],{"class":723}," withEvlog",[709,1337,727],{"class":719},[709,1339,730],{"class":715},[709,1341,733],{"class":719},[709,1343,1344],{"class":736},"evlog\u002Fworkers",[709,1346,740],{"class":719},[709,1348,1349,1351,1353,1355,1357,1359,1361,1363],{"class":711,"line":750},[709,1350,716],{"class":715},[709,1352,720],{"class":719},[709,1354,724],{"class":723},[709,1356,727],{"class":719},[709,1358,730],{"class":715},[709,1360,733],{"class":719},[709,1362,737],{"class":736},[709,1364,740],{"class":719},[709,1366,1367],{"class":711,"line":807},[709,1368,747],{"emptyLinePlaceholder":746},[709,1370,1371,1374,1376,1378,1381,1383,1385,1387,1389,1391,1394,1396,1398,1400],{"class":711,"line":835},[709,1372,1373],{"class":756},"initWorkersLogger",[709,1375,819],{"class":723},[709,1377,1009],{"class":719},[709,1379,1380],{"class":843}," env",[709,1382,655],{"class":719},[709,1384,720],{"class":719},[709,1386,1012],{"class":843},[709,1388,655],{"class":719},[709,1390,733],{"class":719},[709,1392,1393],{"class":736},"my-worker",[709,1395,946],{"class":719},[709,1397,727],{"class":719},[709,1399,727],{"class":719},[709,1401,852],{"class":723},[709,1403,1404,1406,1408],{"class":711,"line":846},[709,1405,753],{"class":715},[709,1407,724],{"class":756},[709,1409,759],{"class":723},[709,1411,1412],{"class":711,"line":982},[709,1413,747],{"emptyLinePlaceholder":746},[709,1415,1416,1418,1420,1422,1424,1426,1429,1433,1435,1437,1439,1442,1444,1447,1450,1452],{"class":711,"line":1028},[709,1417,810],{"class":715},[709,1419,813],{"class":715},[709,1421,1335],{"class":756},[709,1423,819],{"class":723},[709,1425,823],{"class":822},[709,1427,1428],{"class":719}," (",[709,1430,1432],{"class":1431},"sHdIc","request",[709,1434,901],{"class":719},[709,1436,1380],{"class":1431},[709,1438,901],{"class":719},[709,1440,1441],{"class":1431}," ctx",[709,1443,901],{"class":719},[709,1445,1446],{"class":1431}," log",[709,1448,1449],{"class":719},")",[709,1451,829],{"class":822},[709,1453,832],{"class":719},[709,1455,1456,1459,1461,1464,1466,1468,1471,1473,1475,1478,1480,1482],{"class":711,"line":1033},[709,1457,1458],{"class":723},"  log",[709,1460,639],{"class":719},[709,1462,1463],{"class":756},"set",[709,1465,819],{"class":843},[709,1467,1009],{"class":719},[709,1469,1470],{"class":843}," action",[709,1472,655],{"class":719},[709,1474,733],{"class":719},[709,1476,1477],{"class":736},"handle_request",[709,1479,946],{"class":719},[709,1481,727],{"class":719},[709,1483,852],{"class":843},[709,1485,1486,1488,1491,1493,1496,1498,1500,1503,1505,1509,1511],{"class":711,"line":1041},[709,1487,1036],{"class":715},[709,1489,1490],{"class":723}," Response",[709,1492,639],{"class":719},[709,1494,1495],{"class":756},"json",[709,1497,819],{"class":843},[709,1499,1009],{"class":719},[709,1501,1502],{"class":843}," ok",[709,1504,655],{"class":719},[709,1506,1508],{"class":1507},"sfNiH"," true",[709,1510,727],{"class":719},[709,1512,852],{"class":843},[709,1514,1515,1517],{"class":711,"line":1054},[709,1516,849],{"class":719},[709,1518,852],{"class":723},[700,1520,1522],{"className":702,"code":1521,"filename":300,"language":704,"meta":705,"style":705},"\u002F\u002F Any Node, Bun or Deno entry point\nimport { initLogger } from 'evlog'\nimport { enableDiagnosticsChannel } from 'evlog\u002Fdiagnostics'\n\ninitLogger({ env: { service: 'worker' } })\nawait enableDiagnosticsChannel()\n",[628,1523,1524,1529,1548,1566,1570,1602],{"__ignoreMap":705},[709,1525,1526],{"class":711,"line":712},[709,1527,1528],{"class":781},"\u002F\u002F Any Node, Bun or Deno entry point\n",[709,1530,1531,1533,1535,1538,1540,1542,1544,1546],{"class":711,"line":743},[709,1532,716],{"class":715},[709,1534,720],{"class":719},[709,1536,1537],{"class":723}," initLogger",[709,1539,727],{"class":719},[709,1541,730],{"class":715},[709,1543,733],{"class":719},[709,1545,1308],{"class":736},[709,1547,740],{"class":719},[709,1549,1550,1552,1554,1556,1558,1560,1562,1564],{"class":711,"line":750},[709,1551,716],{"class":715},[709,1553,720],{"class":719},[709,1555,724],{"class":723},[709,1557,727],{"class":719},[709,1559,730],{"class":715},[709,1561,733],{"class":719},[709,1563,737],{"class":736},[709,1565,740],{"class":719},[709,1567,1568],{"class":711,"line":807},[709,1569,747],{"emptyLinePlaceholder":746},[709,1571,1572,1575,1577,1579,1581,1583,1585,1587,1589,1591,1594,1596,1598,1600],{"class":711,"line":835},[709,1573,1574],{"class":756},"initLogger",[709,1576,819],{"class":723},[709,1578,1009],{"class":719},[709,1580,1380],{"class":843},[709,1582,655],{"class":719},[709,1584,720],{"class":719},[709,1586,1012],{"class":843},[709,1588,655],{"class":719},[709,1590,733],{"class":719},[709,1592,1593],{"class":736},"worker",[709,1595,946],{"class":719},[709,1597,727],{"class":719},[709,1599,727],{"class":719},[709,1601,852],{"class":723},[709,1603,1604,1606,1608],{"class":711,"line":846},[709,1605,753],{"class":715},[709,1607,724],{"class":756},[709,1609,759],{"class":723},[619,1611,1612,1615,1616,1618,1619,1621,1622,1624],{},[628,1613,1614],{},"enableDiagnosticsChannel()"," is async because it loads ",[628,1617,630],{}," lazily, which is what keeps the built-in out of the main bundle for Convex, workerd and other non-Node targets. Events emitted before the promise settles are not published, so call it at startup rather than inside a request. Frameworks whose entry point cannot use top-level ",[628,1620,753],{}," should call it from the same place they call ",[628,1623,638],{},", and await it there.",[1626,1627,1629,1630,1632,1633,1635],"callout",{"color":1628,"icon":13},"info","This is an observation side channel, not a transport. Subscribers run synchronously and are not awaited: no batching, no retry, no ",[628,1631,683],{},". For delivery to a backend, use a ",[622,1634,654],{"href":540},"; both see the same event.",[641,1637,1639],{"id":1638},"subscribing","Subscribing",[619,1641,1642],{},"The point of the channel is that a consumer needs nothing from evlog but the channel name:",[700,1644,1647],{"className":702,"code":1645,"filename":1646,"language":704,"meta":705,"style":705},"import { channel } from 'node:diagnostics_channel'\n\n\u002F** The published message. Declared locally so this file needs no evlog import. *\u002F\ntype EvlogMessage = { event: Record\u003Cstring, unknown> & { level: string; service: string } }\n\nchannel('evlog.event').subscribe((message) => {\n  const { event } = message as EvlogMessage\n  if (event.level === 'error') metrics.increment('errors', { path: String(event.path ?? 'unknown') })\n})\n","metrics.ts",[628,1648,1649,1668,1672,1677,1739,1743,1775,1796,1866],{"__ignoreMap":705},[709,1650,1651,1653,1655,1658,1660,1662,1664,1666],{"class":711,"line":712},[709,1652,716],{"class":715},[709,1654,720],{"class":719},[709,1656,1657],{"class":723}," channel",[709,1659,727],{"class":719},[709,1661,730],{"class":715},[709,1663,733],{"class":719},[709,1665,630],{"class":736},[709,1667,740],{"class":719},[709,1669,1670],{"class":711,"line":743},[709,1671,747],{"emptyLinePlaceholder":746},[709,1673,1674],{"class":711,"line":750},[709,1675,1676],{"class":781},"\u002F** The published message. Declared locally so this file needs no evlog import. *\u002F\n",[709,1678,1679,1682,1686,1688,1690,1693,1695,1698,1701,1704,1706,1709,1712,1715,1717,1720,1722,1725,1728,1730,1732,1734,1736],{"class":711,"line":807},[709,1680,1681],{"class":822},"type",[709,1683,1685],{"class":1684},"sBMFI"," EvlogMessage",[709,1687,909],{"class":719},[709,1689,720],{"class":719},[709,1691,1692],{"class":843}," event",[709,1694,655],{"class":719},[709,1696,1697],{"class":1684}," Record",[709,1699,1700],{"class":719},"\u003C",[709,1702,1703],{"class":1684},"string",[709,1705,901],{"class":719},[709,1707,1708],{"class":1684}," unknown",[709,1710,1711],{"class":719},">",[709,1713,1714],{"class":719}," &",[709,1716,720],{"class":719},[709,1718,1719],{"class":843}," level",[709,1721,655],{"class":719},[709,1723,1724],{"class":1684}," string",[709,1726,1727],{"class":719},";",[709,1729,1012],{"class":843},[709,1731,655],{"class":719},[709,1733,1724],{"class":1684},[709,1735,727],{"class":719},[709,1737,1738],{"class":719}," }\n",[709,1740,1741],{"class":711,"line":835},[709,1742,747],{"emptyLinePlaceholder":746},[709,1744,1745,1748,1750,1752,1754,1756,1759,1762,1764,1766,1769,1771,1773],{"class":711,"line":846},[709,1746,1747],{"class":1684},"channel",[709,1749,819],{"class":723},[709,1751,946],{"class":719},[709,1753,634],{"class":736},[709,1755,946],{"class":719},[709,1757,1758],{"class":723},").",[709,1760,1761],{"class":1684},"subscribe",[709,1763,819],{"class":723},[709,1765,819],{"class":719},[709,1767,1768],{"class":1431},"message",[709,1770,1449],{"class":719},[709,1772,829],{"class":822},[709,1774,832],{"class":719},[709,1776,1777,1779,1781,1783,1785,1788,1790,1793],{"class":711,"line":982},[709,1778,926],{"class":1684},[709,1780,720],{"class":719},[709,1782,1692],{"class":843},[709,1784,727],{"class":719},[709,1786,1787],{"class":723}," = ",[709,1789,1768],{"class":1684},[709,1791,1792],{"class":1684}," as",[709,1794,1795],{"class":843}," EvlogMessage\n",[709,1797,1798,1801,1803,1806,1808,1811,1813,1815,1818,1821,1823,1825,1828,1830,1832,1834,1837,1839,1842,1845,1847,1850,1853,1855,1858,1860,1863],{"class":711,"line":1028},[709,1799,1800],{"class":843},"  if",[709,1802,1428],{"class":719},[709,1804,1805],{"class":723},"event.level === ",[709,1807,946],{"class":719},[709,1809,1810],{"class":736},"error",[709,1812,946],{"class":719},[709,1814,1449],{"class":719},[709,1816,1817],{"class":723}," metrics.",[709,1819,1820],{"class":843},"increment",[709,1822,819],{"class":719},[709,1824,946],{"class":719},[709,1826,1827],{"class":736},"errors",[709,1829,946],{"class":719},[709,1831,901],{"class":719},[709,1833,720],{"class":719},[709,1835,1836],{"class":843}," path",[709,1838,655],{"class":719},[709,1840,1841],{"class":1431}," String",[709,1843,1844],{"class":723},"(event",[709,1846,639],{"class":719},[709,1848,1849],{"class":723},"path ",[709,1851,1852],{"class":719},"??",[709,1854,733],{"class":719},[709,1856,1857],{"class":736},"unknown",[709,1859,946],{"class":719},[709,1861,1862],{"class":723},") ",[709,1864,1865],{"class":719},"})\n",[709,1867,1868,1870],{"class":711,"line":1033},[709,1869,849],{"class":719},[709,1871,852],{"class":723},[619,1873,1874,1875,1877,1878,1881,1882,1885],{},"Node types the published message as ",[628,1876,1857],{},", so narrow it once at the top of your handler. ",[628,1879,1880],{},"channel(name).subscribe()"," is used rather than the module-level ",[628,1883,1884],{},"subscribe()"," because it exists on every Node that evlog supports.",[619,1887,1888],{},"If you already depend on evlog and want the payload typed:",[700,1890,1893],{"className":702,"code":1891,"filename":1892,"language":704,"meta":705,"style":705},"import { subscribeToWideEvents } from 'evlog\u002Fdiagnostics'\n\nconst stop = await subscribeToWideEvents((event) => {\n  \u002F\u002F                                       ^? WideEvent\n  if (typeof event.status === 'number' && event.status >= 500) {\n    alerts.push({ path: String(event.path ?? '-'), requestId: String(event.requestId ?? '-') })\n  }\n})\n","alerts.ts",[628,1894,1895,1914,1918,1944,1949,1996,2069,2073],{"__ignoreMap":705},[709,1896,1897,1899,1901,1904,1906,1908,1910,1912],{"class":711,"line":712},[709,1898,716],{"class":715},[709,1900,720],{"class":719},[709,1902,1903],{"class":723}," subscribeToWideEvents",[709,1905,727],{"class":719},[709,1907,730],{"class":715},[709,1909,733],{"class":719},[709,1911,737],{"class":736},[709,1913,740],{"class":719},[709,1915,1916],{"class":711,"line":743},[709,1917,747],{"emptyLinePlaceholder":746},[709,1919,1920,1922,1925,1927,1929,1931,1933,1935,1938,1940,1942],{"class":711,"line":750},[709,1921,1280],{"class":822},[709,1923,1924],{"class":723}," stop ",[709,1926,1286],{"class":719},[709,1928,938],{"class":715},[709,1930,1903],{"class":756},[709,1932,819],{"class":723},[709,1934,819],{"class":719},[709,1936,1937],{"class":1431},"event",[709,1939,1449],{"class":719},[709,1941,829],{"class":822},[709,1943,832],{"class":719},[709,1945,1946],{"class":711,"line":807},[709,1947,1948],{"class":781},"  \u002F\u002F                                       ^? WideEvent\n",[709,1950,1951,1953,1955,1958,1960,1962,1965,1968,1970,1973,1975,1978,1980,1982,1984,1987,1991,1993],{"class":711,"line":835},[709,1952,1800],{"class":715},[709,1954,1428],{"class":843},[709,1956,1957],{"class":719},"typeof",[709,1959,1692],{"class":723},[709,1961,639],{"class":719},[709,1963,1964],{"class":723},"status",[709,1966,1967],{"class":719}," ===",[709,1969,733],{"class":719},[709,1971,1972],{"class":736},"number",[709,1974,946],{"class":719},[709,1976,1977],{"class":719}," &&",[709,1979,1692],{"class":723},[709,1981,639],{"class":719},[709,1983,1964],{"class":723},[709,1985,1986],{"class":719}," >=",[709,1988,1990],{"class":1989},"sbssI"," 500",[709,1992,1862],{"class":843},[709,1994,1995],{"class":719},"{\n",[709,1997,1998,2001,2003,2006,2008,2010,2012,2014,2016,2018,2020,2022,2025,2028,2030,2033,2035,2037,2039,2042,2044,2046,2048,2050,2052,2055,2057,2059,2061,2063,2065,2067],{"class":711,"line":846},[709,1999,2000],{"class":723},"    alerts",[709,2002,639],{"class":719},[709,2004,2005],{"class":756},"push",[709,2007,819],{"class":843},[709,2009,1009],{"class":719},[709,2011,1836],{"class":843},[709,2013,655],{"class":719},[709,2015,1841],{"class":756},[709,2017,819],{"class":843},[709,2019,1937],{"class":723},[709,2021,639],{"class":719},[709,2023,2024],{"class":723},"path",[709,2026,2027],{"class":719}," ??",[709,2029,733],{"class":719},[709,2031,2032],{"class":736},"-",[709,2034,946],{"class":719},[709,2036,1449],{"class":843},[709,2038,901],{"class":719},[709,2040,2041],{"class":843}," requestId",[709,2043,655],{"class":719},[709,2045,1841],{"class":756},[709,2047,819],{"class":843},[709,2049,1937],{"class":723},[709,2051,639],{"class":719},[709,2053,2054],{"class":723},"requestId",[709,2056,2027],{"class":719},[709,2058,733],{"class":719},[709,2060,2032],{"class":736},[709,2062,946],{"class":719},[709,2064,1862],{"class":843},[709,2066,849],{"class":719},[709,2068,852],{"class":843},[709,2070,2071],{"class":711,"line":982},[709,2072,1091],{"class":719},[709,2074,2075,2077],{"class":711,"line":1028},[709,2076,849],{"class":719},[709,2078,852],{"class":723},[619,2080,2081,2082,2085,2086,2088],{},"Fields beyond the ",[622,2083,2084],{"href":52},"base event"," are typed ",[628,2087,1857],{},", and events emitted outside a request carry no HTTP fields at all, so narrow before using them rather than casting.",[641,2090,2092],{"id":2091},"what-a-subscriber-receives","What a subscriber receives",[619,2094,2095],{},"The same object a drain receives: post-audit, post-redaction, post-enrich. Requests carry everything enrichers added: geo, user agent, trace context:",[700,2097,2100],{"className":2098,"code":2099,"language":1495,"meta":705,"style":705},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{\n  \"timestamp\": \"2026-08-02T10:23:45.612Z\",\n  \"level\": \"error\",\n  \"service\": \"checkout\",\n  \"environment\": \"production\",\n  \"method\": \"POST\",\n  \"path\": \"\u002Fapi\u002Fcheckout\",\n  \"status\": 500,\n  \"duration\": \"1.20s\",\n  \"requestId\": \"4a8ff3a8-...\",\n  \"user\": { \"id\": \"usr_123\", \"plan\": \"premium\" },\n  \"error\": { \"name\": \"PaymentDeclined\", \"message\": \"Card declined\" }\n}\n",[628,2101,2102,2106,2129,2148,2168,2188,2208,2227,2241,2261,2280,2330,2377],{"__ignoreMap":705},[709,2103,2104],{"class":711,"line":712},[709,2105,1995],{"class":719},[709,2107,2108,2111,2114,2117,2119,2122,2125,2127],{"class":711,"line":743},[709,2109,2110],{"class":719},"  \"",[709,2112,2113],{"class":822},"timestamp",[709,2115,2116],{"class":719},"\"",[709,2118,655],{"class":719},[709,2120,2121],{"class":719}," \"",[709,2123,2124],{"class":736},"2026-08-02T10:23:45.612Z",[709,2126,2116],{"class":719},[709,2128,1085],{"class":719},[709,2130,2131,2133,2136,2138,2140,2142,2144,2146],{"class":711,"line":750},[709,2132,2110],{"class":719},[709,2134,2135],{"class":822},"level",[709,2137,2116],{"class":719},[709,2139,655],{"class":719},[709,2141,2121],{"class":719},[709,2143,1810],{"class":736},[709,2145,2116],{"class":719},[709,2147,1085],{"class":719},[709,2149,2150,2152,2155,2157,2159,2161,2164,2166],{"class":711,"line":807},[709,2151,2110],{"class":719},[709,2153,2154],{"class":822},"service",[709,2156,2116],{"class":719},[709,2158,655],{"class":719},[709,2160,2121],{"class":719},[709,2162,2163],{"class":736},"checkout",[709,2165,2116],{"class":719},[709,2167,1085],{"class":719},[709,2169,2170,2172,2175,2177,2179,2181,2184,2186],{"class":711,"line":835},[709,2171,2110],{"class":719},[709,2173,2174],{"class":822},"environment",[709,2176,2116],{"class":719},[709,2178,655],{"class":719},[709,2180,2121],{"class":719},[709,2182,2183],{"class":736},"production",[709,2185,2116],{"class":719},[709,2187,1085],{"class":719},[709,2189,2190,2192,2195,2197,2199,2201,2204,2206],{"class":711,"line":846},[709,2191,2110],{"class":719},[709,2193,2194],{"class":822},"method",[709,2196,2116],{"class":719},[709,2198,655],{"class":719},[709,2200,2121],{"class":719},[709,2202,2203],{"class":736},"POST",[709,2205,2116],{"class":719},[709,2207,1085],{"class":719},[709,2209,2210,2212,2214,2216,2218,2220,2223,2225],{"class":711,"line":982},[709,2211,2110],{"class":719},[709,2213,2024],{"class":822},[709,2215,2116],{"class":719},[709,2217,655],{"class":719},[709,2219,2121],{"class":719},[709,2221,2222],{"class":736},"\u002Fapi\u002Fcheckout",[709,2224,2116],{"class":719},[709,2226,1085],{"class":719},[709,2228,2229,2231,2233,2235,2237,2239],{"class":711,"line":1028},[709,2230,2110],{"class":719},[709,2232,1964],{"class":822},[709,2234,2116],{"class":719},[709,2236,655],{"class":719},[709,2238,1990],{"class":1989},[709,2240,1085],{"class":719},[709,2242,2243,2245,2248,2250,2252,2254,2257,2259],{"class":711,"line":1033},[709,2244,2110],{"class":719},[709,2246,2247],{"class":822},"duration",[709,2249,2116],{"class":719},[709,2251,655],{"class":719},[709,2253,2121],{"class":719},[709,2255,2256],{"class":736},"1.20s",[709,2258,2116],{"class":719},[709,2260,1085],{"class":719},[709,2262,2263,2265,2267,2269,2271,2273,2276,2278],{"class":711,"line":1041},[709,2264,2110],{"class":719},[709,2266,2054],{"class":822},[709,2268,2116],{"class":719},[709,2270,655],{"class":719},[709,2272,2121],{"class":719},[709,2274,2275],{"class":736},"4a8ff3a8-...",[709,2277,2116],{"class":719},[709,2279,1085],{"class":719},[709,2281,2282,2284,2287,2289,2291,2293,2295,2298,2300,2302,2304,2307,2309,2311,2313,2316,2318,2320,2322,2325,2327],{"class":711,"line":1054},[709,2283,2110],{"class":719},[709,2285,2286],{"class":822},"user",[709,2288,2116],{"class":719},[709,2290,655],{"class":719},[709,2292,720],{"class":719},[709,2294,2121],{"class":719},[709,2296,2297],{"class":1684},"id",[709,2299,2116],{"class":719},[709,2301,655],{"class":719},[709,2303,2121],{"class":719},[709,2305,2306],{"class":736},"usr_123",[709,2308,2116],{"class":719},[709,2310,901],{"class":719},[709,2312,2121],{"class":719},[709,2314,2315],{"class":1684},"plan",[709,2317,2116],{"class":719},[709,2319,655],{"class":719},[709,2321,2121],{"class":719},[709,2323,2324],{"class":736},"premium",[709,2326,2116],{"class":719},[709,2328,2329],{"class":719}," },\n",[709,2331,2332,2334,2336,2338,2340,2342,2344,2347,2349,2351,2353,2356,2358,2360,2362,2364,2366,2368,2370,2373,2375],{"class":711,"line":1064},[709,2333,2110],{"class":719},[709,2335,1810],{"class":822},[709,2337,2116],{"class":719},[709,2339,655],{"class":719},[709,2341,720],{"class":719},[709,2343,2121],{"class":719},[709,2345,2346],{"class":1684},"name",[709,2348,2116],{"class":719},[709,2350,655],{"class":719},[709,2352,2121],{"class":719},[709,2354,2355],{"class":736},"PaymentDeclined",[709,2357,2116],{"class":719},[709,2359,901],{"class":719},[709,2361,2121],{"class":719},[709,2363,1768],{"class":1684},[709,2365,2116],{"class":719},[709,2367,655],{"class":719},[709,2369,2121],{"class":719},[709,2371,2372],{"class":736},"Card declined",[709,2374,2116],{"class":719},[709,2376,1738],{"class":719},[709,2378,2379],{"class":711,"line":1073},[709,2380,2381],{"class":719},"}\n",[619,2383,2384,2385,2388,2389,2392,2393,2396,2397,2400,2401,639],{},"Events emitted outside a request (",[628,2386,2387],{},"log.info({ ... })",", ",[628,2390,2391],{},"createLogger().emit()",") arrive without the HTTP fields, and events from ",[628,2394,2395],{},"log.fork()"," carry ",[628,2398,2399],{},"operation"," and ",[628,2402,2403],{},"_parentRequestId",[1626,2405,2408,2409,2412,2413,2416],{"color":2406,"icon":2407},"warning","i-lucide-triangle-alert","The event is the live object, not a copy, so mutating it mutates what drains receive. Treat it as read-only. And a subscriber that throws is ",[663,2410,2411],{},"not"," contained: ",[628,2414,2415],{},"Channel.publish()"," re-raises it as an uncaught exception on the next tick, which is fatal in most apps. Keep subscribers total.",[619,2418,2419,2420,2423],{},"In pretty mode (the dev default), tagged logs like ",[628,2421,2422],{},"log.info('auth', 'User logged in')"," are written straight to the console and never become wide events, so they do not appear on the channel. Wide events themselves are published in both modes.",[641,2425,2427],{"id":2426},"what-you-can-build","What you can build",[2429,2430,2432],"h3",{"id":2431},"an-integration-that-does-not-depend-on-evlog","An integration that does not depend on evlog",[619,2434,2435,2436,2438],{},"A package that subscribes needs the channel name and nothing else: no ",[628,2437,1308],{}," dependency, no peer range to keep in sync, no wiring in the host app beyond importing it:",[700,2440,2443],{"className":702,"code":2441,"filename":2442,"language":704,"meta":705,"style":705},"import { channel } from 'node:diagnostics_channel'\n\ntype EvlogMessage = {\n  event: Record\u003Cstring, unknown> & { timestamp: string; level: string; service: string }\n}\n\nchannel('evlog.event').subscribe((message) => {\n  const { event } = message as EvlogMessage\n\n  acme.ingest({\n    at: event.timestamp,\n    level: event.level,\n    service: event.service,\n    attributes: event,\n  })\n})\n","acme-apm\u002Fsrc\u002Fevlog.ts",[628,2444,2445,2463,2467,2477,2525,2529,2533,2561,2579,2583,2597,2612,2627,2642,2653,2660],{"__ignoreMap":705},[709,2446,2447,2449,2451,2453,2455,2457,2459,2461],{"class":711,"line":712},[709,2448,716],{"class":715},[709,2450,720],{"class":719},[709,2452,1657],{"class":723},[709,2454,727],{"class":719},[709,2456,730],{"class":715},[709,2458,733],{"class":719},[709,2460,630],{"class":736},[709,2462,740],{"class":719},[709,2464,2465],{"class":711,"line":743},[709,2466,747],{"emptyLinePlaceholder":746},[709,2468,2469,2471,2473,2475],{"class":711,"line":750},[709,2470,1681],{"class":822},[709,2472,1685],{"class":1684},[709,2474,909],{"class":719},[709,2476,832],{"class":719},[709,2478,2479,2482,2484,2486,2488,2490,2492,2494,2496,2498,2500,2503,2505,2507,2509,2511,2513,2515,2517,2519,2521,2523],{"class":711,"line":807},[709,2480,2481],{"class":843},"  event",[709,2483,655],{"class":719},[709,2485,1697],{"class":1684},[709,2487,1700],{"class":719},[709,2489,1703],{"class":1684},[709,2491,901],{"class":719},[709,2493,1708],{"class":1684},[709,2495,1711],{"class":719},[709,2497,1714],{"class":719},[709,2499,720],{"class":719},[709,2501,2502],{"class":843}," timestamp",[709,2504,655],{"class":719},[709,2506,1724],{"class":1684},[709,2508,1727],{"class":719},[709,2510,1719],{"class":843},[709,2512,655],{"class":719},[709,2514,1724],{"class":1684},[709,2516,1727],{"class":719},[709,2518,1012],{"class":843},[709,2520,655],{"class":719},[709,2522,1724],{"class":1684},[709,2524,1738],{"class":719},[709,2526,2527],{"class":711,"line":835},[709,2528,2381],{"class":719},[709,2530,2531],{"class":711,"line":846},[709,2532,747],{"emptyLinePlaceholder":746},[709,2534,2535,2537,2539,2541,2543,2545,2547,2549,2551,2553,2555,2557,2559],{"class":711,"line":982},[709,2536,1747],{"class":1684},[709,2538,819],{"class":723},[709,2540,946],{"class":719},[709,2542,634],{"class":736},[709,2544,946],{"class":719},[709,2546,1758],{"class":723},[709,2548,1761],{"class":1684},[709,2550,819],{"class":723},[709,2552,819],{"class":719},[709,2554,1768],{"class":1431},[709,2556,1449],{"class":719},[709,2558,829],{"class":822},[709,2560,832],{"class":719},[709,2562,2563,2565,2567,2569,2571,2573,2575,2577],{"class":711,"line":1028},[709,2564,926],{"class":1684},[709,2566,720],{"class":719},[709,2568,1692],{"class":843},[709,2570,727],{"class":719},[709,2572,1787],{"class":723},[709,2574,1768],{"class":1684},[709,2576,1792],{"class":1684},[709,2578,1795],{"class":843},[709,2580,2581],{"class":711,"line":1033},[709,2582,747],{"emptyLinePlaceholder":746},[709,2584,2585,2588,2590,2593,2595],{"class":711,"line":1041},[709,2586,2587],{"class":1684},"  acme",[709,2589,639],{"class":719},[709,2591,2592],{"class":1684},"ingest",[709,2594,819],{"class":723},[709,2596,1995],{"class":719},[709,2598,2599,2602,2604,2606,2608,2610],{"class":711,"line":1054},[709,2600,2601],{"class":843},"    at",[709,2603,655],{"class":719},[709,2605,1692],{"class":1684},[709,2607,639],{"class":719},[709,2609,2113],{"class":1684},[709,2611,1085],{"class":719},[709,2613,2614,2617,2619,2621,2623,2625],{"class":711,"line":1064},[709,2615,2616],{"class":843},"    level",[709,2618,655],{"class":719},[709,2620,1692],{"class":1684},[709,2622,639],{"class":719},[709,2624,2135],{"class":1684},[709,2626,1085],{"class":719},[709,2628,2629,2632,2634,2636,2638,2640],{"class":711,"line":1073},[709,2630,2631],{"class":843},"    service",[709,2633,655],{"class":719},[709,2635,1692],{"class":1684},[709,2637,639],{"class":719},[709,2639,2154],{"class":1684},[709,2641,1085],{"class":719},[709,2643,2644,2647,2649,2651],{"class":711,"line":1079},[709,2645,2646],{"class":843},"    attributes",[709,2648,655],{"class":719},[709,2650,1692],{"class":1684},[709,2652,1085],{"class":719},[709,2654,2655,2658],{"class":711,"line":1088},[709,2656,2657],{"class":719},"  }",[709,2659,852],{"class":723},[709,2661,2662,2664],{"class":711,"line":1094},[709,2663,849],{"class":719},[709,2665,852],{"class":723},[700,2667,2670],{"className":702,"code":2668,"filename":2669,"language":704,"meta":705,"style":705},"import 'acme-apm\u002Fevlog'\n","the host app",[628,2671,2672],{"__ignoreMap":705},[709,2673,2674,2676,2678,2681],{"class":711,"line":712},[709,2675,716],{"class":715},[709,2677,733],{"class":719},[709,2679,2680],{"class":736},"acme-apm\u002Fevlog",[709,2682,740],{"class":719},[619,2684,2685,2686,639],{},"The same shape works for an internal library shared across services: one package subscribes, every service that imports it reports, and none of them touch ",[628,2687,638],{},[2429,2689,2691],{"id":2690},"counters-and-alerts-next-to-your-app","Counters and alerts next to your app",[619,2693,2694],{},"A subscriber is a plain function, so anything you can compute in-process you can compute here, without giving up the drain slot, which stays free for shipping events to your backend:",[700,2696,2699],{"className":702,"code":2697,"filename":2698,"language":704,"meta":705,"style":705},"import { channel } from 'node:diagnostics_channel'\n\nconst errorsByPath = new Map\u003Cstring, number>()\n\nchannel('evlog.event').subscribe((message) => {\n  const { event } = message as { event: Record\u003Cstring, unknown> & { level: string } }\n  if (event.level !== 'error') return\n\n  const path = String(event.path ?? 'unknown')\n  errorsByPath.set(path, (errorsByPath.get(path) ?? 0) + 1)\n\n  if (typeof event.status === 'number' && event.status >= 500) {\n    void pager.notify(`5xx on ${path}`, { requestId: event.requestId })\n  }\n})\n\nexport function errorCounts(): Record\u003Cstring, number> {\n  return Object.fromEntries(errorsByPath)\n}\n","observability.ts",[628,2700,2701,2719,2723,2750,2754,2784,2833,2859,2863,2891,2937,2941,2979,3026,3030,3036,3040,3068,3087],{"__ignoreMap":705},[709,2702,2703,2705,2707,2709,2711,2713,2715,2717],{"class":711,"line":712},[709,2704,716],{"class":715},[709,2706,720],{"class":719},[709,2708,1657],{"class":723},[709,2710,727],{"class":719},[709,2712,730],{"class":715},[709,2714,733],{"class":719},[709,2716,630],{"class":736},[709,2718,740],{"class":719},[709,2720,2721],{"class":711,"line":743},[709,2722,747],{"emptyLinePlaceholder":746},[709,2724,2725,2727,2730,2732,2734,2737,2739,2741,2743,2746,2748],{"class":711,"line":750},[709,2726,1280],{"class":822},[709,2728,2729],{"class":723}," errorsByPath ",[709,2731,1286],{"class":719},[709,2733,1289],{"class":719},[709,2735,2736],{"class":756}," Map",[709,2738,1700],{"class":719},[709,2740,1703],{"class":1684},[709,2742,901],{"class":719},[709,2744,2745],{"class":1684}," number",[709,2747,1711],{"class":719},[709,2749,759],{"class":723},[709,2751,2752],{"class":711,"line":807},[709,2753,747],{"emptyLinePlaceholder":746},[709,2755,2756,2758,2760,2762,2764,2766,2768,2770,2772,2774,2776,2778,2780,2782],{"class":711,"line":835},[709,2757,1747],{"class":756},[709,2759,819],{"class":723},[709,2761,946],{"class":719},[709,2763,634],{"class":736},[709,2765,946],{"class":719},[709,2767,1449],{"class":723},[709,2769,639],{"class":719},[709,2771,1761],{"class":756},[709,2773,819],{"class":723},[709,2775,819],{"class":719},[709,2777,1768],{"class":1431},[709,2779,1449],{"class":719},[709,2781,829],{"class":822},[709,2783,832],{"class":719},[709,2785,2786,2788,2790,2792,2794,2796,2799,2801,2803,2805,2807,2809,2811,2813,2815,2817,2819,2821,2823,2825,2827,2829,2831],{"class":711,"line":846},[709,2787,926],{"class":822},[709,2789,720],{"class":719},[709,2791,1692],{"class":723},[709,2793,727],{"class":719},[709,2795,909],{"class":719},[709,2797,2798],{"class":723}," message",[709,2800,1792],{"class":715},[709,2802,720],{"class":719},[709,2804,1692],{"class":843},[709,2806,655],{"class":719},[709,2808,1697],{"class":1684},[709,2810,1700],{"class":719},[709,2812,1703],{"class":1684},[709,2814,901],{"class":719},[709,2816,1708],{"class":1684},[709,2818,1711],{"class":719},[709,2820,1714],{"class":719},[709,2822,720],{"class":719},[709,2824,1719],{"class":843},[709,2826,655],{"class":719},[709,2828,1724],{"class":1684},[709,2830,727],{"class":719},[709,2832,1738],{"class":719},[709,2834,2835,2837,2839,2841,2843,2845,2848,2850,2852,2854,2856],{"class":711,"line":982},[709,2836,1800],{"class":715},[709,2838,1428],{"class":843},[709,2840,1937],{"class":723},[709,2842,639],{"class":719},[709,2844,2135],{"class":723},[709,2846,2847],{"class":719}," !==",[709,2849,733],{"class":719},[709,2851,1810],{"class":736},[709,2853,946],{"class":719},[709,2855,1862],{"class":843},[709,2857,2858],{"class":715},"return\n",[709,2860,2861],{"class":711,"line":1028},[709,2862,747],{"emptyLinePlaceholder":746},[709,2864,2865,2867,2869,2871,2873,2875,2877,2879,2881,2883,2885,2887,2889],{"class":711,"line":1033},[709,2866,926],{"class":822},[709,2868,1836],{"class":723},[709,2870,909],{"class":719},[709,2872,1841],{"class":756},[709,2874,819],{"class":843},[709,2876,1937],{"class":723},[709,2878,639],{"class":719},[709,2880,2024],{"class":723},[709,2882,2027],{"class":719},[709,2884,733],{"class":719},[709,2886,1857],{"class":736},[709,2888,946],{"class":719},[709,2890,852],{"class":843},[709,2892,2893,2896,2898,2900,2902,2904,2906,2908,2911,2913,2916,2918,2920,2922,2924,2927,2929,2932,2935],{"class":711,"line":1041},[709,2894,2895],{"class":723},"  errorsByPath",[709,2897,639],{"class":719},[709,2899,1463],{"class":756},[709,2901,819],{"class":843},[709,2903,2024],{"class":723},[709,2905,901],{"class":719},[709,2907,1428],{"class":843},[709,2909,2910],{"class":723},"errorsByPath",[709,2912,639],{"class":719},[709,2914,2915],{"class":756},"get",[709,2917,819],{"class":843},[709,2919,2024],{"class":723},[709,2921,1862],{"class":843},[709,2923,1852],{"class":719},[709,2925,2926],{"class":1989}," 0",[709,2928,1862],{"class":843},[709,2930,2931],{"class":719},"+",[709,2933,2934],{"class":1989}," 1",[709,2936,852],{"class":843},[709,2938,2939],{"class":711,"line":1054},[709,2940,747],{"emptyLinePlaceholder":746},[709,2942,2943,2945,2947,2949,2951,2953,2955,2957,2959,2961,2963,2965,2967,2969,2971,2973,2975,2977],{"class":711,"line":1064},[709,2944,1800],{"class":715},[709,2946,1428],{"class":843},[709,2948,1957],{"class":719},[709,2950,1692],{"class":723},[709,2952,639],{"class":719},[709,2954,1964],{"class":723},[709,2956,1967],{"class":719},[709,2958,733],{"class":719},[709,2960,1972],{"class":736},[709,2962,946],{"class":719},[709,2964,1977],{"class":719},[709,2966,1692],{"class":723},[709,2968,639],{"class":719},[709,2970,1964],{"class":723},[709,2972,1986],{"class":719},[709,2974,1990],{"class":1989},[709,2976,1862],{"class":843},[709,2978,1995],{"class":719},[709,2980,2981,2984,2987,2989,2992,2994,2997,3000,3003,3005,3008,3010,3012,3014,3016,3018,3020,3022,3024],{"class":711,"line":1073},[709,2982,2983],{"class":719},"    void",[709,2985,2986],{"class":723}," pager",[709,2988,639],{"class":719},[709,2990,2991],{"class":756},"notify",[709,2993,819],{"class":843},[709,2995,2996],{"class":719},"`",[709,2998,2999],{"class":736},"5xx on ",[709,3001,3002],{"class":719},"${",[709,3004,2024],{"class":723},[709,3006,3007],{"class":719},"}`",[709,3009,901],{"class":719},[709,3011,720],{"class":719},[709,3013,2041],{"class":843},[709,3015,655],{"class":719},[709,3017,1692],{"class":723},[709,3019,639],{"class":719},[709,3021,2054],{"class":723},[709,3023,727],{"class":719},[709,3025,852],{"class":843},[709,3027,3028],{"class":711,"line":1079},[709,3029,1091],{"class":719},[709,3031,3032,3034],{"class":711,"line":1088},[709,3033,849],{"class":719},[709,3035,852],{"class":723},[709,3037,3038],{"class":711,"line":1094},[709,3039,747],{"emptyLinePlaceholder":746},[709,3041,3043,3045,3048,3051,3054,3056,3058,3060,3062,3064,3066],{"class":711,"line":3042},17,[709,3044,810],{"class":715},[709,3046,3047],{"class":822}," function",[709,3049,3050],{"class":756}," errorCounts",[709,3052,3053],{"class":719},"():",[709,3055,1697],{"class":1684},[709,3057,1700],{"class":719},[709,3059,1703],{"class":1684},[709,3061,901],{"class":719},[709,3063,2745],{"class":1684},[709,3065,1711],{"class":719},[709,3067,832],{"class":719},[709,3069,3071,3073,3076,3078,3081,3083,3085],{"class":711,"line":3070},18,[709,3072,1036],{"class":715},[709,3074,3075],{"class":723}," Object",[709,3077,639],{"class":719},[709,3079,3080],{"class":756},"fromEntries",[709,3082,819],{"class":843},[709,3084,2910],{"class":723},[709,3086,852],{"class":843},[709,3088,3090],{"class":711,"line":3089},19,[709,3091,2381],{"class":719},[619,3093,3094,3095,3097],{},"A ",[622,3096,650],{"href":523}," does this too, and is the better choice when the code lives in your own app. The channel wins when the subscriber ships as a separate package, or when it has to attach without editing the app's logger configuration.",[641,3099,295],{"id":3100},"cloudflare-workers",[619,3102,3103,3104,3108,3109,3111],{},"Workers forwards every diagnostics channel message to a ",[622,3105,679],{"href":3106,"rel":3107},"https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fobservability\u002Flogs\u002Ftail-workers\u002F",[626],". Enable the channel in your Worker and the wide events leave the isolate with no drain, no ",[628,3110,683],{},", and their own CPU budget, and the Tail Worker does the shipping, after the response has already gone out:",[700,3113,3116],{"className":702,"code":3114,"filename":3115,"language":704,"meta":705,"style":705},"export default {\n  async tail(events) {\n    for (const event of events) {\n      for (const messageData of event.diagnosticsChannelEvents) {\n        if (messageData.channel !== 'evlog.event') continue\n\n        await fetch('https:\u002F\u002Flogs.example.com\u002Fingest', {\n          method: 'POST',\n          headers: { 'Content-Type': 'application\u002Fjson' },\n          body: JSON.stringify(messageData.message.event),\n        })\n      }\n    }\n  },\n}\n","tail-worker\u002Findex.ts",[628,3117,3118,3126,3143,3164,3189,3216,3220,3241,3256,3283,3314,3321,3326,3331,3336],{"__ignoreMap":705},[709,3119,3120,3122,3124],{"class":711,"line":712},[709,3121,810],{"class":715},[709,3123,813],{"class":715},[709,3125,832],{"class":719},[709,3127,3128,3131,3134,3136,3139,3141],{"class":711,"line":743},[709,3129,3130],{"class":822},"  async",[709,3132,3133],{"class":843}," tail",[709,3135,819],{"class":719},[709,3137,3138],{"class":1431},"events",[709,3140,1449],{"class":719},[709,3142,832],{"class":719},[709,3144,3145,3148,3150,3152,3154,3157,3160,3162],{"class":711,"line":750},[709,3146,3147],{"class":715},"    for",[709,3149,1428],{"class":843},[709,3151,1280],{"class":822},[709,3153,1692],{"class":723},[709,3155,3156],{"class":719}," of",[709,3158,3159],{"class":723}," events",[709,3161,1862],{"class":843},[709,3163,1995],{"class":719},[709,3165,3166,3169,3171,3173,3176,3178,3180,3182,3185,3187],{"class":711,"line":807},[709,3167,3168],{"class":715},"      for",[709,3170,1428],{"class":843},[709,3172,1280],{"class":822},[709,3174,3175],{"class":723}," messageData",[709,3177,3156],{"class":719},[709,3179,1692],{"class":723},[709,3181,639],{"class":719},[709,3183,3184],{"class":723},"diagnosticsChannelEvents",[709,3186,1862],{"class":843},[709,3188,1995],{"class":719},[709,3190,3191,3194,3196,3199,3201,3203,3205,3207,3209,3211,3213],{"class":711,"line":835},[709,3192,3193],{"class":715},"        if",[709,3195,1428],{"class":843},[709,3197,3198],{"class":723},"messageData",[709,3200,639],{"class":719},[709,3202,1747],{"class":723},[709,3204,2847],{"class":719},[709,3206,733],{"class":719},[709,3208,634],{"class":736},[709,3210,946],{"class":719},[709,3212,1862],{"class":843},[709,3214,3215],{"class":715},"continue\n",[709,3217,3218],{"class":711,"line":846},[709,3219,747],{"emptyLinePlaceholder":746},[709,3221,3222,3225,3228,3230,3232,3235,3237,3239],{"class":711,"line":982},[709,3223,3224],{"class":715},"        await",[709,3226,3227],{"class":756}," fetch",[709,3229,819],{"class":843},[709,3231,946],{"class":719},[709,3233,3234],{"class":736},"https:\u002F\u002Flogs.example.com\u002Fingest",[709,3236,946],{"class":719},[709,3238,901],{"class":719},[709,3240,832],{"class":719},[709,3242,3243,3246,3248,3250,3252,3254],{"class":711,"line":1028},[709,3244,3245],{"class":843},"          method",[709,3247,655],{"class":719},[709,3249,733],{"class":719},[709,3251,2203],{"class":736},[709,3253,946],{"class":719},[709,3255,1085],{"class":719},[709,3257,3258,3261,3263,3265,3267,3270,3272,3274,3276,3279,3281],{"class":711,"line":1033},[709,3259,3260],{"class":843},"          headers",[709,3262,655],{"class":719},[709,3264,720],{"class":719},[709,3266,733],{"class":719},[709,3268,3269],{"class":843},"Content-Type",[709,3271,946],{"class":719},[709,3273,655],{"class":719},[709,3275,733],{"class":719},[709,3277,3278],{"class":736},"application\u002Fjson",[709,3280,946],{"class":719},[709,3282,2329],{"class":719},[709,3284,3285,3288,3290,3293,3295,3298,3300,3302,3304,3306,3308,3310,3312],{"class":711,"line":1041},[709,3286,3287],{"class":843},"          body",[709,3289,655],{"class":719},[709,3291,3292],{"class":723}," JSON",[709,3294,639],{"class":719},[709,3296,3297],{"class":756},"stringify",[709,3299,819],{"class":843},[709,3301,3198],{"class":723},[709,3303,639],{"class":719},[709,3305,1768],{"class":723},[709,3307,639],{"class":719},[709,3309,1937],{"class":723},[709,3311,1449],{"class":843},[709,3313,1085],{"class":719},[709,3315,3316,3319],{"class":711,"line":1054},[709,3317,3318],{"class":719},"        }",[709,3320,852],{"class":843},[709,3322,3323],{"class":711,"line":1064},[709,3324,3325],{"class":719},"      }\n",[709,3327,3328],{"class":711,"line":1073},[709,3329,3330],{"class":719},"    }\n",[709,3332,3333],{"class":711,"line":1079},[709,3334,3335],{"class":719},"  },\n",[709,3337,3338],{"class":711,"line":1088},[709,3339,2381],{"class":719},[619,3341,3342,3343,2388,3345,2400,3347,3349,3350,3352,3353,3356,3357,3360],{},"Each entry carries ",[628,3344,2113],{},[628,3346,1747],{},[628,3348,1768],{},", with ",[628,3351,1768],{}," being what evlog published, so the wide event is at ",[628,3354,3355],{},"messageData.message.event",". Requires the ",[628,3358,3359],{},"nodejs_compat"," flag, and messages go through the structured clone algorithm, so only cloneable values survive.",[641,3362,3364],{"id":3363},"when-a-plugin-is-the-better-tool","When a plugin is the better tool",[619,3366,3367,3368,3371],{},"The channel is not a replacement for ",[622,3369,3370],{"href":523},"plugins",". It is narrower on purpose:",[3373,3374,3375,3388],"table",{},[3376,3377,3378],"thead",{},[3379,3380,3381,3385],"tr",{},[3382,3383,3384],"th",{},"You want to…",[3382,3386,3387],{},"Use",[3389,3390,3391,3402,3413,3425,3433],"tbody",{},[3379,3392,3393,3397],{},[3394,3395,3396],"td",{},"Ship events to a backend, with batching and retry",[3394,3398,3399],{},[622,3400,3401],{"href":540},"Custom drain",[3379,3403,3404,3407],{},[3394,3405,3406],{},"Add fields to the event before it drains",[3394,3408,3409,3412],{},[622,3410,3411],{"href":527},"Enricher"," or a plugin",[3379,3414,3415,3418],{},[3394,3416,3417],{},"Fan out to several in-process consumers",[3394,3419,3420,3421,3424],{},"Plugins — ",[628,3422,3423],{},"initLogger({ plugins: [a, b, c] })"," already does this",[3379,3426,3427,3430],{},[3394,3428,3429],{},"Subscribe from a package that must not depend on evlog",[3394,3431,3432],{},"This channel",[3379,3434,3435,3438],{},[3394,3436,3437],{},"Get events out of a Cloudflare Worker without a drain",[3394,3439,3432],{},[619,3441,3442,3445],{},[628,3443,3444],{},"diagnostics_channel"," is in-process: nothing attaches to a running process from the outside. A subscriber's code has to be loaded by your app either way, so the channel saves it a line of configuration, not a dependency.",[3447,3448,3449],"style",{},"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 .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 .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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":705,"searchDepth":743,"depth":743,"links":3451},[3452,3453,3454,3455,3456,3460,3461],{"id":643,"depth":743,"text":644},{"id":694,"depth":743,"text":695},{"id":1638,"depth":743,"text":1639},{"id":2091,"depth":743,"text":2092},{"id":2426,"depth":743,"text":2427,"children":3457},[3458,3459],{"id":2431,"depth":750,"text":2432},{"id":2690,"depth":750,"text":2691},{"id":3100,"depth":743,"text":295},{"id":3363,"depth":743,"text":3364},"Publish every wide event on a node:diagnostics_channel, so a consumer subscribes without importing evlog and Cloudflare can Tail Worker it.","md",[3465,3468],{"label":522,"icon":497,"to":523,"color":3466,"variant":3467},"neutral","subtle",{"label":499,"icon":466,"to":500,"color":3466,"variant":3467},{},{"title":509,"icon":502},{"title":614,"description":3462},"5oLaXxFOH7j00PASnXByKQDaOmgENXeu1FFujVl0TGY",[3474,3476],{"title":504,"path":505,"stem":506,"description":3475,"icon":507,"children":-1},"Build evlog support for a framework or runtime that has no integration, with defineFrameworkIntegration or the lower-level helpers.",{"title":513,"path":514,"stem":515,"description":3477,"icon":516,"children":-1},"Replay and tail the local NDJSON drain with readFsLogs and tailFsLogs — works in-process or from any external Node tool, survives restarts.",1789294040487]