[{"data":1,"prerenderedAt":691},["ShallowReactive",2],{"navigation_docs":3,"-enrichers-overview":171,"-enrichers-overview-surround":686},[4,30,55,105,122,136],{"title":5,"path":6,"stem":7,"children":8,"page":29},"Getting Started","/getting-started","1.getting-started",[9,14,19,24],{"title":10,"path":11,"stem":12,"icon":13},"Introduction","/getting-started/introduction","1.getting-started/1.introduction","i-lucide-info",{"title":15,"path":16,"stem":17,"icon":18},"Installation","/getting-started/installation","1.getting-started/2.installation","i-lucide-download",{"title":20,"path":21,"stem":22,"icon":23},"Quick Start","/getting-started/quick-start","1.getting-started/3.quick-start","i-lucide-zap",{"title":25,"path":26,"stem":27,"icon":28},"Agent Skills","/getting-started/agent-skills","1.getting-started/4.agent-skills","i-lucide-sparkles",false,{"title":31,"path":32,"stem":33,"children":34,"page":29},"Core Concepts","/core-concepts","2.core-concepts",[35,40,45,50],{"title":36,"path":37,"stem":38,"icon":39},"Wide Events","/core-concepts/wide-events","2.core-concepts/1.wide-events","i-lucide-layers",{"title":41,"path":42,"stem":43,"icon":44},"Structured Errors","/core-concepts/structured-errors","2.core-concepts/2.structured-errors","i-lucide-shield-alert",{"title":46,"path":47,"stem":48,"icon":49},"Best Practices","/core-concepts/best-practices","2.core-concepts/3.best-practices","i-lucide-shield-check",{"title":51,"path":52,"stem":53,"icon":54},"Typed Fields","/core-concepts/typed-fields","2.core-concepts/4.typed-fields","i-simple-icons-typescript",{"title":56,"path":57,"stem":58,"children":59,"page":29},"Adapters","/adapters","3.adapters",[60,65,70,75,80,85,90,95,100],{"title":61,"path":62,"stem":63,"icon":64},"Overview","/adapters/overview","3.adapters/1.overview","i-custom-plug",{"title":66,"path":67,"stem":68,"icon":69},"Axiom","/adapters/axiom","3.adapters/2.axiom","i-custom-axiom",{"title":71,"path":72,"stem":73,"icon":74},"OTLP","/adapters/otlp","3.adapters/3.otlp","i-simple-icons-opentelemetry",{"title":76,"path":77,"stem":78,"icon":79},"PostHog","/adapters/posthog","3.adapters/4.posthog","i-simple-icons-posthog",{"title":81,"path":82,"stem":83,"icon":84},"Sentry","/adapters/sentry","3.adapters/5.sentry","i-simple-icons-sentry",{"title":86,"path":87,"stem":88,"icon":89},"Better Stack","/adapters/better-stack","3.adapters/6.better-stack","i-simple-icons-betterstack",{"title":91,"path":92,"stem":93,"icon":94},"Custom Adapters","/adapters/custom","3.adapters/7.custom","i-lucide-code",{"title":96,"path":97,"stem":98,"icon":99},"Pipeline","/adapters/pipeline","3.adapters/8.pipeline","i-lucide-workflow",{"title":101,"path":102,"stem":103,"icon":104},"Browser","/adapters/browser","3.adapters/9.browser","i-lucide-globe",{"title":106,"path":107,"stem":108,"children":109,"page":29},"Enrichers","/enrichers","4.enrichers",[110,113,118],{"title":61,"path":111,"stem":112,"icon":28},"/enrichers/overview","4.enrichers/1.overview",{"title":114,"path":115,"stem":116,"icon":117},"Built-in","/enrichers/built-in","4.enrichers/2.built-in","i-lucide-puzzle",{"title":119,"path":120,"stem":121,"icon":94},"Custom","/enrichers/custom","4.enrichers/3.custom",{"title":123,"path":124,"stem":125,"children":126,"page":29},"NuxtHub","/nuxthub","5.nuxthub",[127,131],{"title":61,"path":128,"stem":129,"icon":130},"/nuxthub/overview","5.nuxthub/1.overview","i-lucide-database",{"title":132,"path":133,"stem":134,"icon":135},"Retention","/nuxthub/retention","5.nuxthub/2.retention","i-lucide-clock",{"title":137,"path":138,"stem":139,"children":140,"page":29},"Examples","/examples","6.examples",[141,146,151,156,161,166],{"title":142,"path":143,"stem":144,"icon":145},"Next.js","/examples/nextjs","6.examples/1.nextjs","i-simple-icons-nextdotjs",{"title":147,"path":148,"stem":149,"icon":150},"TanStack Start","/examples/tanstack-start","6.examples/2.tanstack-start","i-custom-tanstack",{"title":152,"path":153,"stem":154,"icon":155},"Hono","/examples/hono","6.examples/3.hono","i-simple-icons-hono",{"title":157,"path":158,"stem":159,"icon":160},"Express","/examples/express","6.examples/4.express","i-simple-icons-express",{"title":162,"path":163,"stem":164,"icon":165},"Elysia","/examples/elysia","6.examples/5.elysia","i-custom-elysia",{"title":167,"path":168,"stem":169,"icon":170},"Fastify","/examples/fastify","6.examples/6.fastify","i-simple-icons-fastify",{"id":172,"title":173,"body":174,"description":676,"extension":677,"links":678,"meta":682,"navigation":683,"path":111,"seo":684,"stem":112,"__hash__":685},"docs/4.enrichers/1.overview.md","Enrichers Overview",{"type":175,"value":176,"toc":669},"minimark",[177,181,186,198,208,431,435,442,538,557,561,592,596,607,636,645,649,665],[178,179,180],"p",{},"Enrichers add derived context to your wide events after they are emitted, before they reach your drain adapters. Use them to automatically extract useful information from request headers without cluttering your application code.",[182,183,185],"h2",{"id":184},"how-enrichers-work","How Enrichers Work",[178,187,188,189,193,194,197],{},"Enrichers hook into the ",[190,191,192],"code",{},"evlog:enrich"," event, which fires after a wide event is emitted and before the ",[190,195,196],{},"evlog:drain"," hook. The enricher receives the event and request metadata, and can mutate the event to add derived fields.",[199,200,205],"pre",{"className":201,"code":203,"language":204},[202],"language-text","Request → emit() → evlog:enrich → evlog:drain\n                    ↑ enrichers      ↑ adapters\n                    add context      send to services\n","text",[190,206,203],{"__ignoreMap":207},"",[199,209,214],{"className":210,"code":211,"filename":212,"language":213,"meta":207,"style":207},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createUserAgentEnricher, createGeoEnricher } from 'evlog/enrichers'\n\nexport default defineNitroPlugin((nitroApp) => {\n  const enrichers = [\n    createUserAgentEnricher(),\n    createGeoEnricher(),\n  ]\n\n  nitroApp.hooks.hook('evlog:enrich', (ctx) => {\n    for (const enricher of enrichers) enricher(ctx)\n  })\n})\n","server/plugins/evlog-enrich.ts","typescript",[190,215,216,255,262,294,310,322,332,338,343,383,415,423],{"__ignoreMap":207},[217,218,221,225,229,233,236,239,242,245,248,252],"span",{"class":219,"line":220},"line",1,[217,222,224],{"class":223},"s7zQu","import",[217,226,228],{"class":227},"sMK4o"," {",[217,230,232],{"class":231},"sTEyZ"," createUserAgentEnricher",[217,234,235],{"class":227},",",[217,237,238],{"class":231}," createGeoEnricher",[217,240,241],{"class":227}," }",[217,243,244],{"class":223}," from",[217,246,247],{"class":227}," '",[217,249,251],{"class":250},"sfazB","evlog/enrichers",[217,253,254],{"class":227},"'\n",[217,256,258],{"class":219,"line":257},2,[217,259,261],{"emptyLinePlaceholder":260},true,"\n",[217,263,265,268,271,275,278,280,284,287,291],{"class":219,"line":264},3,[217,266,267],{"class":223},"export",[217,269,270],{"class":223}," default",[217,272,274],{"class":273},"s2Zo4"," defineNitroPlugin",[217,276,277],{"class":231},"(",[217,279,277],{"class":227},[217,281,283],{"class":282},"sHdIc","nitroApp",[217,285,286],{"class":227},")",[217,288,290],{"class":289},"spNyl"," =>",[217,292,293],{"class":227}," {\n",[217,295,297,300,303,306],{"class":219,"line":296},4,[217,298,299],{"class":289},"  const",[217,301,302],{"class":231}," enrichers",[217,304,305],{"class":227}," =",[217,307,309],{"class":308},"swJcz"," [\n",[217,311,313,316,319],{"class":219,"line":312},5,[217,314,315],{"class":273},"    createUserAgentEnricher",[217,317,318],{"class":308},"()",[217,320,321],{"class":227},",\n",[217,323,325,328,330],{"class":219,"line":324},6,[217,326,327],{"class":273},"    createGeoEnricher",[217,329,318],{"class":308},[217,331,321],{"class":227},[217,333,335],{"class":219,"line":334},7,[217,336,337],{"class":308},"  ]\n",[217,339,341],{"class":219,"line":340},8,[217,342,261],{"emptyLinePlaceholder":260},[217,344,346,349,352,355,357,360,362,365,367,369,371,374,377,379,381],{"class":219,"line":345},9,[217,347,348],{"class":231},"  nitroApp",[217,350,351],{"class":227},".",[217,353,354],{"class":231},"hooks",[217,356,351],{"class":227},[217,358,359],{"class":273},"hook",[217,361,277],{"class":308},[217,363,364],{"class":227},"'",[217,366,192],{"class":250},[217,368,364],{"class":227},[217,370,235],{"class":227},[217,372,373],{"class":227}," (",[217,375,376],{"class":282},"ctx",[217,378,286],{"class":227},[217,380,290],{"class":289},[217,382,293],{"class":227},[217,384,386,389,391,394,397,400,402,405,408,410,412],{"class":219,"line":385},10,[217,387,388],{"class":223},"    for",[217,390,373],{"class":308},[217,392,393],{"class":289},"const",[217,395,396],{"class":231}," enricher",[217,398,399],{"class":227}," of",[217,401,302],{"class":231},[217,403,404],{"class":308},") ",[217,406,407],{"class":273},"enricher",[217,409,277],{"class":308},[217,411,376],{"class":231},[217,413,414],{"class":308},")\n",[217,416,418,421],{"class":219,"line":417},11,[217,419,420],{"class":227},"  }",[217,422,414],{"class":308},[217,424,426,429],{"class":219,"line":425},12,[217,427,428],{"class":227},"}",[217,430,414],{"class":231},[182,432,434],{"id":433},"enrich-context","Enrich Context",[178,436,437,438,441],{},"Every enricher receives an ",[190,439,440],{},"EnrichContext"," with:",[443,444,445,461],"table",{},[446,447,448],"thead",{},[449,450,451,455,458],"tr",{},[452,453,454],"th",{},"Field",[452,456,457],{},"Type",[452,459,460],{},"Description",[462,463,464,480,505,519],"tbody",{},[449,465,466,472,477],{},[467,468,469],"td",{},[190,470,471],{},"event",[467,473,474],{},[190,475,476],{},"WideEvent",[467,478,479],{},"The emitted wide event (mutable)",[449,481,482,487,492],{},[467,483,484],{},[190,485,486],{},"request",[467,488,489],{},[190,490,491],{},"object",[467,493,494,495,498,499,498,502,286],{},"Request metadata (",[190,496,497],{},"method",", ",[190,500,501],{},"path",[190,503,504],{},"requestId",[449,506,507,512,516],{},[467,508,509],{},[190,510,511],{},"headers",[467,513,514],{},[190,515,491],{},[467,517,518],{},"Safe HTTP request headers (sensitive headers are filtered)",[449,520,521,526,530],{},[467,522,523],{},[190,524,525],{},"response",[467,527,528],{},[190,529,491],{},[467,531,532,533,498,536,286],{},"Response metadata (",[190,534,535],{},"status",[190,537,511],{},[539,540,542,546,547,498,550,498,553,556],"callout",{"color":541,"icon":49},"success",[543,544,545],"strong",{},"Security:"," Sensitive headers (",[190,548,549],{},"authorization",[190,551,552],{},"cookie",[190,554,555],{},"x-api-key",", etc.) are automatically filtered and never passed to enrichers.",[182,558,560],{"id":559},"available-enrichers","Available Enrichers",[562,563,564,571,577,583,589],"card-group",{},[565,566,570],"card",{"icon":567,"title":568,"to":569},"i-lucide-monitor-smartphone","User Agent","/enrichers/built-in#user-agent","Parse browser, OS, and device type from the User-Agent header.",[565,572,576],{"icon":573,"title":574,"to":575},"i-lucide-map-pin","Geo","/enrichers/built-in#geo","Extract country, region, city, and coordinates from platform headers.",[565,578,582],{"icon":579,"title":580,"to":581},"i-lucide-hard-drive","Request Size","/enrichers/built-in#request-size","Capture request and response payload sizes from Content-Length headers.",[565,584,588],{"icon":585,"title":586,"to":587},"i-lucide-route","Trace Context","/enrichers/built-in#trace-context","Extract W3C trace context (traceId, spanId) from the traceparent header.",[565,590,591],{"icon":94,"title":119,"to":120},"Write your own enricher for any derived context.",[182,593,595],{"id":594},"overwrite-behavior","Overwrite Behavior",[178,597,598,599,602,603,606],{},"By default, enrichers preserve existing fields. If your application code already sets ",[190,600,601],{},"event.userAgent",", the enricher won't overwrite it. Pass ",[190,604,605],{},"{ overwrite: true }"," to change this:",[199,608,610],{"className":210,"code":609,"language":213,"meta":207,"style":207},"createUserAgentEnricher({ overwrite: true })\n",[190,611,612],{"__ignoreMap":207},[217,613,614,617,619,622,625,628,632,634],{"class":219,"line":220},[217,615,616],{"class":273},"createUserAgentEnricher",[217,618,277],{"class":231},[217,620,621],{"class":227},"{",[217,623,624],{"class":308}," overwrite",[217,626,627],{"class":227},":",[217,629,631],{"class":630},"sfNiH"," true",[217,633,241],{"class":227},[217,635,414],{"class":231},[539,637,639,640,644],{"color":638,"icon":94},"neutral","See the ",[641,642,643],"a",{"href":143},"Next.js example"," for a working implementation.",[182,646,648],{"id":647},"next-steps","Next Steps",[650,651,652,659],"ul",{},[653,654,655,658],"li",{},[641,656,657],{"href":115},"Built-in Enrichers"," - Detailed reference for all built-in enrichers",[653,660,661,664],{},[641,662,663],{"href":120},"Custom Enrichers"," - Write your own enrichers",[666,667,668],"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 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 .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 .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}",{"title":207,"searchDepth":257,"depth":257,"links":670},[671,672,673,674,675],{"id":184,"depth":257,"text":185},{"id":433,"depth":257,"text":434},{"id":559,"depth":257,"text":560},{"id":594,"depth":257,"text":595},{"id":647,"depth":257,"text":648},"Enrich your wide events with derived context like user agent, geo data, request size, and trace context. Built-in enrichers and custom enricher support.","md",[679,681],{"label":657,"icon":117,"to":115,"color":638,"variant":680},"subtle",{"label":663,"icon":94,"to":120,"color":638,"variant":680},{},{"title":61,"icon":28},{"title":173,"description":676},"IOlh7nkpCAN1a5Rfyc1kTlui5y7SCMeNZnS6yaHfatE",[687,689],{"title":101,"path":102,"stem":103,"description":688,"icon":104,"children":-1},"Framework-agnostic browser log transport for sending client-side logs to your server via fetch or sendBeacon. Works with any frontend stack.",{"title":114,"path":115,"stem":116,"description":690,"icon":117,"children":-1},"Reference for all built-in evlog enrichers. Parse user agents, extract geo data, measure request sizes, and capture trace context automatically.",1772880294753]