[{"data":1,"prerenderedAt":2874},["ShallowReactive",2],{"navigation_docs":3,"-integrate-adapters-hybrid-loki":533,"-integrate-adapters-hybrid-loki-surround":2869},[4,29,76,122,304,436,495],{"title":5,"path":6,"stem":7,"children":8,"page":28},"Start","\u002Fstart","1.start",[9,13,18,23],{"title":10,"path":11,"stem":12},"Introduction","\u002Fstart\u002Fintroduction","1.start\u002F1.introduction",{"title":14,"path":15,"stem":16,"icon":17},"Why start with evlog","\u002Fstart\u002Fwhy-evlog","1.start\u002F2.why-evlog","i-lucide-rocket",{"title":19,"path":20,"stem":21,"icon":22},"Installation","\u002Fstart\u002Finstallation","1.start\u002F3.installation","i-lucide-download",{"title":24,"path":25,"stem":26,"icon":27},"Quick Start","\u002Fstart\u002Fquick-start","1.start\u002F4.quick-start","i-lucide-zap",false,{"title":30,"path":31,"stem":32,"children":33,"page":28},"Learn","\u002Flearn","2.learn",[34,38,43,48,53,58,62,67,72],{"title":35,"path":36,"stem":37},"Learn evlog","\u002Flearn\u002Foverview","2.learn\u002F0.overview",{"title":39,"path":40,"stem":41,"icon":42},"Simple Logging","\u002Flearn\u002Fsimple-logging","2.learn\u002F1.simple-logging","i-lucide-terminal",{"title":44,"path":45,"stem":46,"icon":47},"Wide Events","\u002Flearn\u002Fwide-events","2.learn\u002F2.wide-events","i-lucide-layers",{"title":49,"path":50,"stem":51,"icon":52},"Structured Errors","\u002Flearn\u002Fstructured-errors","2.learn\u002F3.structured-errors","i-lucide-shield-alert",{"title":54,"path":55,"stem":56,"icon":57},"Lifecycle","\u002Flearn\u002Flifecycle","2.learn\u002F4.lifecycle","i-lucide-arrow-right-left",{"title":59,"path":60,"stem":61},"Sampling","\u002Flearn\u002Fsampling","2.learn\u002F5.sampling",{"title":63,"path":64,"stem":65,"icon":66},"Auto-Redaction","\u002Flearn\u002Fredaction","2.learn\u002F6.redaction","i-lucide-eye-off",{"title":68,"path":69,"stem":70,"icon":71},"Typed Fields","\u002Flearn\u002Ftyped-fields","2.learn\u002F7.typed-fields","i-simple-icons-typescript",{"title":73,"path":74,"stem":75},"Catalogs","\u002Flearn\u002Fcatalogs","2.learn\u002F8.catalogs",{"title":77,"path":78,"stem":79,"children":80,"page":28},"CLI","\u002Fcli","3.cli",[81,85,90,95,99,103,108,113,118],{"title":82,"path":83,"stem":84},"evlog CLI","\u002Fcli\u002Foverview","3.cli\u002F0.overview",{"title":86,"path":87,"stem":88,"icon":89},"init","\u002Fcli\u002Finit","3.cli\u002F1.init","i-lucide-wand-sparkles",{"title":91,"path":92,"stem":93,"icon":94},"map","\u002Fcli\u002Fmap","3.cli\u002F2.map","i-lucide-radar",{"title":96,"path":97,"stem":98},"Map rules","\u002Fcli\u002Frules","3.cli\u002F3.rules",{"title":100,"path":101,"stem":102},"Map scoring","\u002Fcli\u002Fscoring","3.cli\u002F4.scoring",{"title":104,"path":105,"stem":106,"icon":107},"CI","\u002Fcli\u002Fci","3.cli\u002F5.ci","i-lucide-git-pull-request",{"title":109,"path":110,"stem":111,"icon":112},"doctor","\u002Fcli\u002Fdoctor","3.cli\u002F6.doctor","i-lucide-stethoscope",{"title":114,"path":115,"stem":116,"icon":117},"telemetry","\u002Fcli\u002Ftelemetry","3.cli\u002F7.telemetry","i-lucide-bar-chart-3",{"title":119,"path":120,"stem":121},"evlog agents","\u002Fcli\u002Fagents","3.cli\u002F8.agents",{"title":123,"path":124,"stem":125,"children":126,"page":28},"Integrate","\u002Fintegrate","4.integrate",[127,132,216],{"title":128,"path":129,"stem":130,"icon":131},"Overview","\u002Fintegrate\u002Foverview","4.integrate\u002F0.overview","i-lucide-plug",{"title":133,"path":134,"stem":135,"children":136,"page":28},"Adapters","\u002Fintegrate\u002Fadapters","4.integrate\u002Fadapters",[137,141,171,196],{"title":128,"path":138,"stem":139,"icon":140},"\u002Fintegrate\u002Fadapters\u002Foverview","4.integrate\u002Fadapters\u002F01.overview","i-lucide-list",{"title":142,"path":143,"stem":144,"children":145,"page":28},"Cloud","\u002Fintegrate\u002Fadapters\u002Fcloud","4.integrate\u002Fadapters\u002Fcloud",[146,151,156,161,166],{"title":147,"path":148,"stem":149,"icon":150},"Axiom","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Faxiom","4.integrate\u002Fadapters\u002Fcloud\u002F01.axiom","i-custom-axiom",{"title":152,"path":153,"stem":154,"icon":155},"PostHog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fposthog","4.integrate\u002Fadapters\u002Fcloud\u002F02.posthog","i-simple-icons-posthog",{"title":157,"path":158,"stem":159,"icon":160},"Sentry","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fsentry","4.integrate\u002Fadapters\u002Fcloud\u002F03.sentry","i-simple-icons-sentry",{"title":162,"path":163,"stem":164,"icon":165},"Better Stack","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fbetter-stack","4.integrate\u002Fadapters\u002Fcloud\u002F04.better-stack","i-simple-icons-betterstack",{"title":167,"path":168,"stem":169,"icon":170},"Datadog","\u002Fintegrate\u002Fadapters\u002Fcloud\u002Fdatadog","4.integrate\u002Fadapters\u002Fcloud\u002F05.datadog","i-simple-icons-datadog",{"title":172,"path":173,"stem":174,"children":175,"page":28},"Cloud or Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fhybrid","4.integrate\u002Fadapters\u002Fhybrid",[176,181,186,191],{"title":177,"path":178,"stem":179,"icon":180},"Grafana Loki","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki","4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki","i-simple-icons-grafana",{"title":182,"path":183,"stem":184,"icon":185},"ClickHouse","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fclickhouse","4.integrate\u002Fadapters\u002Fhybrid\u002F02.clickhouse","i-simple-icons-clickhouse",{"title":187,"path":188,"stem":189,"icon":190},"OTLP","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fotlp","4.integrate\u002Fadapters\u002Fhybrid\u002F03.otlp","i-simple-icons-opentelemetry",{"title":192,"path":193,"stem":194,"icon":195},"HyperDX","\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Fhyperdx","4.integrate\u002Fadapters\u002Fhybrid\u002F04.hyperdx","i-custom-hyperdx",{"title":197,"path":198,"stem":199,"children":200,"page":28},"Self-Hosted","\u002Fintegrate\u002Fadapters\u002Fself-hosted","4.integrate\u002Fadapters\u002Fself-hosted",[201,206,211],{"title":202,"path":203,"stem":204,"icon":205},"File System","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Ffs","4.integrate\u002Fadapters\u002Fself-hosted\u002F01.fs","i-lucide-hard-drive",{"title":207,"path":208,"stem":209,"icon":210},"NuxtHub","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fnuxthub","4.integrate\u002Fadapters\u002Fself-hosted\u002F02.nuxthub","i-simple-icons-nuxt",{"title":212,"path":213,"stem":214,"icon":215},"Memory","\u002Fintegrate\u002Fadapters\u002Fself-hosted\u002Fmemory","4.integrate\u002Fadapters\u002Fself-hosted\u002F03.memory","i-lucide-cpu",{"title":217,"path":218,"stem":219,"children":220,"page":28},"Frameworks","\u002Fintegrate\u002Fframeworks","4.integrate\u002Fframeworks",[221,225,230,235,240,245,250,255,260,265,270,275,280,285,289,294,299],{"title":128,"path":222,"stem":223,"icon":224},"\u002Fintegrate\u002Fframeworks\u002Foverview","4.integrate\u002Fframeworks\u002F00.overview","i-lucide-layout-grid",{"title":226,"path":227,"stem":228,"icon":229},"Nuxt","\u002Fintegrate\u002Fframeworks\u002Fnuxt","4.integrate\u002Fframeworks\u002F01.nuxt","i-simple-icons-nuxtdotjs",{"title":231,"path":232,"stem":233,"icon":234},"Next.js","\u002Fintegrate\u002Fframeworks\u002Fnextjs","4.integrate\u002Fframeworks\u002F02.nextjs","i-simple-icons-nextdotjs",{"title":236,"path":237,"stem":238,"icon":239},"SvelteKit","\u002Fintegrate\u002Fframeworks\u002Fsveltekit","4.integrate\u002Fframeworks\u002F03.sveltekit","i-simple-icons-svelte",{"title":241,"path":242,"stem":243,"icon":244},"Nitro","\u002Fintegrate\u002Fframeworks\u002Fnitro","4.integrate\u002Fframeworks\u002F04.nitro","i-custom-nitro",{"title":246,"path":247,"stem":248,"icon":249},"TanStack Start","\u002Fintegrate\u002Fframeworks\u002Ftanstack-start","4.integrate\u002Fframeworks\u002F05.tanstack-start","i-custom-tanstack",{"title":251,"path":252,"stem":253,"icon":254},"NestJS","\u002Fintegrate\u002Fframeworks\u002Fnestjs","4.integrate\u002Fframeworks\u002F06.nestjs","i-simple-icons-nestjs",{"title":256,"path":257,"stem":258,"icon":259},"Express","\u002Fintegrate\u002Fframeworks\u002Fexpress","4.integrate\u002Fframeworks\u002F07.express","i-simple-icons-express",{"title":261,"path":262,"stem":263,"icon":264},"Hono","\u002Fintegrate\u002Fframeworks\u002Fhono","4.integrate\u002Fframeworks\u002F08.hono","i-simple-icons-hono",{"title":266,"path":267,"stem":268,"icon":269},"Fastify","\u002Fintegrate\u002Fframeworks\u002Ffastify","4.integrate\u002Fframeworks\u002F09.fastify","i-simple-icons-fastify",{"title":271,"path":272,"stem":273,"icon":274},"Elysia","\u002Fintegrate\u002Fframeworks\u002Felysia","4.integrate\u002Fframeworks\u002F10.elysia","i-custom-elysia",{"title":276,"path":277,"stem":278,"icon":279},"React Router","\u002Fintegrate\u002Fframeworks\u002Freact-router","4.integrate\u002Fframeworks\u002F11.react-router","i-custom-reactrouter",{"title":281,"path":282,"stem":283,"icon":284},"Cloudflare Workers","\u002Fintegrate\u002Fframeworks\u002Fcloudflare-workers","4.integrate\u002Fframeworks\u002F12.cloudflare-workers","i-simple-icons-cloudflare",{"title":286,"path":287,"stem":288,"icon":71},"Standalone","\u002Fintegrate\u002Fframeworks\u002Fstandalone","4.integrate\u002Fframeworks\u002F13.standalone",{"title":290,"path":291,"stem":292,"icon":293},"Astro","\u002Fintegrate\u002Fframeworks\u002Fastro","4.integrate\u002Fframeworks\u002F14.astro","i-simple-icons-astro",{"title":295,"path":296,"stem":297,"icon":298},"oRPC","\u002Fintegrate\u002Fframeworks\u002Forpc","4.integrate\u002Fframeworks\u002F15.orpc","i-lucide-network",{"title":300,"path":301,"stem":302,"icon":303},"AWS Lambda","\u002Fintegrate\u002Fframeworks\u002Faws-lambda","4.integrate\u002Fframeworks\u002F16.aws-lambda","i-custom-lambda",{"title":305,"path":306,"stem":307,"children":308,"page":28},"Use Cases","\u002Fuse-cases","5.use-cases",[309,312,317,346,374,407,427,432],{"title":305,"path":310,"stem":311},"\u002Fuse-cases\u002Foverview","5.use-cases\u002F0.overview",{"title":313,"path":314,"stem":315,"icon":316},"Client Logging","\u002Fuse-cases\u002Fclient-logging","5.use-cases\u002F1.client-logging","i-lucide-monitor",{"title":318,"icon":319,"path":320,"stem":321,"children":322,"page":28},"AI SDK","i-simple-icons-vercel","\u002Fuse-cases\u002Fai-sdk","5.use-cases\u002F2.ai-sdk",[323,326,331,336,341],{"title":128,"path":324,"stem":325,"icon":140},"\u002Fuse-cases\u002Fai-sdk\u002Foverview","5.use-cases\u002F2.ai-sdk\u002F01.overview",{"title":327,"path":328,"stem":329,"icon":330},"Usage","\u002Fuse-cases\u002Fai-sdk\u002Fusage","5.use-cases\u002F2.ai-sdk\u002F02.usage","i-lucide-code",{"title":332,"path":333,"stem":334,"icon":335},"Options","\u002Fuse-cases\u002Fai-sdk\u002Foptions","5.use-cases\u002F2.ai-sdk\u002F03.options","i-lucide-sliders",{"title":337,"path":338,"stem":339,"icon":340},"Metadata","\u002Fuse-cases\u002Fai-sdk\u002Fmetadata","5.use-cases\u002F2.ai-sdk\u002F04.metadata","i-lucide-database",{"title":342,"path":343,"stem":344,"icon":345},"Telemetry","\u002Fuse-cases\u002Fai-sdk\u002Ftelemetry","5.use-cases\u002F2.ai-sdk\u002F05.telemetry","i-lucide-activity",{"title":347,"icon":348,"path":349,"stem":350,"children":351,"page":28},"Better Auth","i-simple-icons-betterauth","\u002Fuse-cases\u002Fbetter-auth","5.use-cases\u002F3.better-auth",[352,355,360,365,369],{"title":128,"path":353,"stem":354,"icon":140},"\u002Fuse-cases\u002Fbetter-auth\u002Foverview","5.use-cases\u002F3.better-auth\u002F01.overview",{"title":356,"path":357,"stem":358,"icon":359},"Identify User","\u002Fuse-cases\u002Fbetter-auth\u002Fidentify-user","5.use-cases\u002F3.better-auth\u002F02.identify-user","i-lucide-user-check",{"title":361,"path":362,"stem":363,"icon":364},"Middleware","\u002Fuse-cases\u002Fbetter-auth\u002Fmiddleware","5.use-cases\u002F3.better-auth\u002F03.middleware","i-lucide-shield",{"title":366,"path":367,"stem":368,"icon":316},"Client Sync","\u002Fuse-cases\u002Fbetter-auth\u002Fclient-sync","5.use-cases\u002F3.better-auth\u002F04.client-sync",{"title":370,"path":371,"stem":372,"icon":373},"Performance","\u002Fuse-cases\u002Fbetter-auth\u002Fperformance","5.use-cases\u002F3.better-auth\u002F05.performance","i-lucide-gauge",{"title":375,"icon":376,"path":377,"stem":378,"children":379,"page":28},"Audit Logs","i-lucide-shield-check","\u002Fuse-cases\u002Faudit","5.use-cases\u002F4.audit",[380,383,388,393,398,402],{"title":128,"path":381,"stem":382,"icon":140},"\u002Fuse-cases\u002Faudit\u002Foverview","5.use-cases\u002F4.audit\u002F01.overview",{"title":384,"path":385,"stem":386,"icon":387},"Schema","\u002Fuse-cases\u002Faudit\u002Fschema","5.use-cases\u002F4.audit\u002F02.schema","i-lucide-file-text",{"title":389,"path":390,"stem":391,"icon":392},"Recording","\u002Fuse-cases\u002Faudit\u002Frecording","5.use-cases\u002F4.audit\u002F03.recording","i-lucide-pen-line",{"title":394,"path":395,"stem":396,"icon":397},"Drains","\u002Fuse-cases\u002Faudit\u002Fpipeline","5.use-cases\u002F4.audit\u002F04.pipeline","i-lucide-link",{"title":399,"path":400,"stem":401,"icon":376},"Compliance","\u002Fuse-cases\u002Faudit\u002Fcompliance","5.use-cases\u002F4.audit\u002F05.compliance",{"title":403,"path":404,"stem":405,"icon":406},"Recipes","\u002Fuse-cases\u002Faudit\u002Frecipes","5.use-cases\u002F4.audit\u002F06.recipes","i-lucide-book-open",{"title":342,"icon":373,"path":408,"stem":409,"children":410,"page":28},"\u002Fuse-cases\u002Ftelemetry","5.use-cases\u002F4.telemetry",[411,414,419,423],{"title":128,"path":412,"stem":413,"icon":140},"\u002Fuse-cases\u002Ftelemetry\u002Foverview","5.use-cases\u002F4.telemetry\u002F01.overview",{"title":415,"path":416,"stem":417,"icon":418},"Setup","\u002Fuse-cases\u002Ftelemetry\u002Fsetup","5.use-cases\u002F4.telemetry\u002F02.setup","i-lucide-wrench",{"title":420,"path":421,"stem":422},"Telemetry Ingest","\u002Fuse-cases\u002Ftelemetry\u002Fingest","5.use-cases\u002F4.telemetry\u002F03.ingest",{"title":424,"path":425,"stem":426,"icon":406},"Reference","\u002Fuse-cases\u002Ftelemetry\u002Freference","5.use-cases\u002F4.telemetry\u002F04.reference",{"title":428,"path":429,"stem":430,"icon":431},"Enrichers","\u002Fuse-cases\u002Fenrichers","5.use-cases\u002F5.enrichers","i-lucide-sparkles",{"title":433,"path":434,"stem":435},"eve","\u002Fuse-cases\u002Feve","5.use-cases\u002F5.eve",{"title":437,"path":438,"stem":439,"children":440,"page":28},"Extend","\u002Fextend","6.extend",[441,445,450,455,459,464,468,472,476,481,486,491],{"title":128,"path":442,"stem":443,"icon":444},"\u002Fextend\u002Foverview","6.extend\u002F0.overview","i-lucide-blocks",{"title":446,"path":447,"stem":448,"icon":449},"Stream","\u002Fextend\u002Fstream","6.extend\u002F1.stream","i-lucide-radio-tower",{"title":451,"path":452,"stem":453,"icon":454},"Custom framework","\u002Fextend\u002Fcustom-framework","6.extend\u002F10.custom-framework","i-lucide-puzzle",{"title":456,"path":457,"stem":458,"icon":449},"Diagnostics channel","\u002Fextend\u002Fdiagnostics-channel","6.extend\u002F11.diagnostics-channel",{"title":460,"path":461,"stem":462,"icon":463},"FS reader","\u002Fextend\u002Ffs-reader","6.extend\u002F2.fs-reader","i-lucide-folder-search",{"title":403,"path":465,"stem":466,"icon":467},"\u002Fextend\u002Fconsumer-recipes","6.extend\u002F3.consumer-recipes","i-lucide-chef-hat",{"title":469,"path":470,"stem":471},"Plugins","\u002Fextend\u002Fplugins","6.extend\u002F4.plugins",{"title":473,"path":474,"stem":475,"icon":431},"Custom enrichers","\u002Fextend\u002Fcustom-enrichers","6.extend\u002F5.custom-enrichers",{"title":477,"path":478,"stem":479,"icon":480},"Tail sampling","\u002Fextend\u002Ftail-sampling","6.extend\u002F6.tail-sampling","i-lucide-filter",{"title":482,"path":483,"stem":484,"icon":485},"Identity headers","\u002Fextend\u002Fidentity-headers","6.extend\u002F7.identity-headers","i-lucide-fingerprint",{"title":487,"path":488,"stem":489,"icon":490},"Custom drains","\u002Fextend\u002Fcustom-drains","6.extend\u002F8.custom-drains","i-lucide-share-2",{"title":492,"path":493,"stem":494},"Drain Pipeline","\u002Fextend\u002Fdrain-pipeline","6.extend\u002F9.drain-pipeline",{"title":424,"path":496,"stem":497,"children":498,"page":28},"\u002Freference","7.reference",[499,503,508,511,516,520,525,529],{"title":128,"path":500,"stem":501,"icon":502},"\u002Freference\u002Foverview","7.reference\u002F0.overview","i-lucide-book-marked",{"title":504,"path":505,"stem":506,"icon":507},"Configuration","\u002Freference\u002Fconfiguration","7.reference\u002F1.configuration","i-lucide-settings",{"title":370,"path":509,"stem":510,"icon":373},"\u002Freference\u002Fperformance","7.reference\u002F2.performance",{"title":512,"path":513,"stem":514,"icon":515},"Vite Plugin","\u002Freference\u002Fvite-plugin","7.reference\u002F3.vite-plugin","i-custom-vite",{"title":517,"path":518,"stem":519,"icon":376},"Best Practices","\u002Freference\u002Fbest-practices","7.reference\u002F4.best-practices",{"title":521,"path":522,"stem":523,"icon":524},"vs Other Loggers","\u002Freference\u002Fvs-other-loggers","7.reference\u002F5.vs-other-loggers","i-lucide-scale",{"title":526,"path":527,"stem":528,"icon":431},"Agent Skills","\u002Freference\u002Fagent-skills","7.reference\u002F6.agent-skills",{"title":530,"path":531,"stem":532},"Log cost","\u002Freference\u002Fcost","7.reference\u002F7.cost",{"id":534,"title":535,"body":536,"description":2852,"extension":2853,"links":2854,"meta":2865,"navigation":2866,"path":178,"seo":2867,"stem":179,"__hash__":2868},"docs\u002F4.integrate\u002Fadapters\u002Fhybrid\u002F01.loki.md","Grafana Loki Adapter",{"type":537,"value":538,"toc":2831},"minimark",[539,550,585,635,639,642,685,688,695,1485,1488,1493,1581,1585,1588,1609,1612,1777,1781,1784,1788,1791,1821,1838,1847,1898,1921,1930,1934,1941,2012,2044,2064,2068,2142,2147,2151,2163,2166,2264,2267,2271,2276,2298,2313,2328,2343,2347,2350,2544,2547,2551,2554,2613,2623,2632,2636,2654,2668,2681,2691,2695,2698,2786,2798,2802,2827],[540,541,542,543,549],"p",{},"The Loki adapter pushes wide events to ",[544,545,177],"a",{"href":546,"rel":547},"https:\u002F\u002Fgrafana.com\u002Fdocs\u002Floki\u002Flatest\u002F",[548],"nofollow"," via its push API. It works with a self-hosted single-tenant instance, a multi-tenant deployment, and Grafana Cloud.",[540,551,552,553,557,558,562,563,566,567,570,571,562,574,562,577,580,581,584],{},"Each event is pushed as a ",[554,555,556],"strong",{},"JSON log line"," under a small, low-cardinality label set. That distinction matters in Loki: labels are indexed and billed by cardinality, while the log line is searched at query time. evlog labels only ",[559,560,561],"code",{},"service",", ",[559,564,565],{},"environment",", and ",[559,568,569],{},"level"," by default, and leaves everything else (",[559,572,573],{},"requestId",[559,575,576],{},"path",[559,578,579],{},"user",", your custom fields) in the line, queryable with ",[559,582,583],{},"| json",".",[586,587,590,593,623],"prompt",{":actions":588,"description":589,"icon":180},"[\"copy\",\"cursor\",\"claude\"]","Add the Grafana Loki drain adapter",[540,591,592],{},"Add the Grafana Loki drain adapter to send evlog wide events to Loki.",[594,595,596,600,603,606,609,617,620],"ol",{},[597,598,599],"li",{},"Identify which framework I'm using and follow its evlog integration pattern",[597,601,602],{},"Install evlog if not already installed",[597,604,605],{},"Import createLokiDrain from 'evlog\u002Floki'",[597,607,608],{},"Wire createLokiDrain() into my framework's drain configuration",[597,610,611,612,616],{},"Set LOKI_ENDPOINT (e.g. ",[544,613,614],{"href":614,"rel":615},"http:\u002F\u002Flocalhost:3100",[548],"). For Grafana Cloud also set LOKI_USER (instance ID) and LOKI_API_KEY",[597,618,619],{},"For multi-tenant self-hosted Loki, set LOKI_TENANT_ID instead",[597,621,622],{},"Test by triggering a request and querying {service=\"my-app\"} in Grafana",[540,624,625,626,630,631],{},"Adapter docs: ",[544,627,628],{"href":628,"rel":629},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fadapters\u002Fhybrid\u002Floki",[548],"\nFramework setup: ",[544,632,633],{"href":633,"rel":634},"https:\u002F\u002Fwww.evlog.dev\u002Fintegrate\u002Fframeworks\u002Foverview",[548],[636,637,19],"h2",{"id":638},"installation",[540,640,641],{},"The Loki adapter comes bundled with evlog:",[643,644,650],"pre",{"className":645,"code":646,"filename":647,"language":648,"meta":649,"style":649},"language-typescript shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { createLokiDrain } from 'evlog\u002Floki'\n","src\u002Findex.ts","typescript","",[559,651,652],{"__ignoreMap":649},[653,654,657,661,665,669,672,675,678,682],"span",{"class":655,"line":656},"line",1,[653,658,660],{"class":659},"s7zQu","import",[653,662,664],{"class":663},"sMK4o"," {",[653,666,668],{"class":667},"sTEyZ"," createLokiDrain",[653,670,671],{"class":663}," }",[653,673,674],{"class":659}," from",[653,676,677],{"class":663}," '",[653,679,681],{"class":680},"sfazB","evlog\u002Floki",[653,683,684],{"class":663},"'\n",[636,686,24],{"id":687},"quick-start",[540,689,690,691,694],{},"Set ",[559,692,693],{},"LOKI_ENDPOINT"," and wire the drain into your framework.",[696,697,698,812,934,1038,1145,1250,1387],"code-group",{},[643,699,702],{"className":645,"code":700,"filename":701,"language":648,"meta":649,"style":649},"\u002F\u002F server\u002Fplugins\u002Fevlog.ts\nimport { createLokiDrain } from 'evlog\u002Floki'\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', createLokiDrain())\n})\n","Nuxt \u002F Nitro",[559,703,704,710,729,736,768,803],{"__ignoreMap":649},[653,705,706],{"class":655,"line":656},[653,707,709],{"class":708},"sHwdD","\u002F\u002F server\u002Fplugins\u002Fevlog.ts\n",[653,711,713,715,717,719,721,723,725,727],{"class":655,"line":712},2,[653,714,660],{"class":659},[653,716,664],{"class":663},[653,718,668],{"class":667},[653,720,671],{"class":663},[653,722,674],{"class":659},[653,724,677],{"class":663},[653,726,681],{"class":680},[653,728,684],{"class":663},[653,730,732],{"class":655,"line":731},3,[653,733,735],{"emptyLinePlaceholder":734},true,"\n",[653,737,739,742,745,749,752,754,758,761,765],{"class":655,"line":738},4,[653,740,741],{"class":659},"export",[653,743,744],{"class":659}," default",[653,746,748],{"class":747},"s2Zo4"," defineNitroPlugin",[653,750,751],{"class":667},"(",[653,753,751],{"class":663},[653,755,757],{"class":756},"sHdIc","nitroApp",[653,759,760],{"class":663},")",[653,762,764],{"class":763},"spNyl"," =>",[653,766,767],{"class":663}," {\n",[653,769,771,774,776,779,781,784,787,790,793,795,798,800],{"class":655,"line":770},5,[653,772,773],{"class":667},"  nitroApp",[653,775,584],{"class":663},[653,777,778],{"class":667},"hooks",[653,780,584],{"class":663},[653,782,783],{"class":747},"hook",[653,785,751],{"class":786},"swJcz",[653,788,789],{"class":663},"'",[653,791,792],{"class":680},"evlog:drain",[653,794,789],{"class":663},[653,796,797],{"class":663},",",[653,799,668],{"class":747},[653,801,802],{"class":786},"())\n",[653,804,806,809],{"class":655,"line":805},6,[653,807,808],{"class":663},"}",[653,810,811],{"class":667},")\n",[643,813,815],{"className":645,"code":814,"filename":261,"language":648,"meta":649,"style":649},"import { Hono } from 'hono'\nimport { evlog } from 'evlog\u002Fhono'\nimport { createLokiDrain } from 'evlog\u002Floki'\n\nconst app = new Hono()\napp.use(evlog({ drain: createLokiDrain() }))\n",[559,816,817,837,857,875,879,898],{"__ignoreMap":649},[653,818,819,821,823,826,828,830,832,835],{"class":655,"line":656},[653,820,660],{"class":659},[653,822,664],{"class":663},[653,824,825],{"class":667}," Hono",[653,827,671],{"class":663},[653,829,674],{"class":659},[653,831,677],{"class":663},[653,833,834],{"class":680},"hono",[653,836,684],{"class":663},[653,838,839,841,843,846,848,850,852,855],{"class":655,"line":712},[653,840,660],{"class":659},[653,842,664],{"class":663},[653,844,845],{"class":667}," evlog",[653,847,671],{"class":663},[653,849,674],{"class":659},[653,851,677],{"class":663},[653,853,854],{"class":680},"evlog\u002Fhono",[653,856,684],{"class":663},[653,858,859,861,863,865,867,869,871,873],{"class":655,"line":731},[653,860,660],{"class":659},[653,862,664],{"class":663},[653,864,668],{"class":667},[653,866,671],{"class":663},[653,868,674],{"class":659},[653,870,677],{"class":663},[653,872,681],{"class":680},[653,874,684],{"class":663},[653,876,877],{"class":655,"line":738},[653,878,735],{"emptyLinePlaceholder":734},[653,880,881,884,887,890,893,895],{"class":655,"line":770},[653,882,883],{"class":763},"const",[653,885,886],{"class":667}," app ",[653,888,889],{"class":663},"=",[653,891,892],{"class":663}," new",[653,894,825],{"class":747},[653,896,897],{"class":667},"()\n",[653,899,900,903,905,908,910,913,915,918,921,924,926,929,931],{"class":655,"line":805},[653,901,902],{"class":667},"app",[653,904,584],{"class":663},[653,906,907],{"class":747},"use",[653,909,751],{"class":667},[653,911,912],{"class":747},"evlog",[653,914,751],{"class":667},[653,916,917],{"class":663},"{",[653,919,920],{"class":786}," drain",[653,922,923],{"class":663},":",[653,925,668],{"class":747},[653,927,928],{"class":667},"() ",[653,930,808],{"class":663},[653,932,933],{"class":667},"))\n",[643,935,937],{"className":645,"code":936,"filename":256,"language":648,"meta":649,"style":649},"import express from 'express'\nimport { evlog } from 'evlog\u002Fexpress'\nimport { createLokiDrain } from 'evlog\u002Floki'\n\nconst app = express()\napp.use(evlog({ drain: createLokiDrain() }))\n",[559,938,939,956,975,993,997,1010],{"__ignoreMap":649},[653,940,941,943,946,949,951,954],{"class":655,"line":656},[653,942,660],{"class":659},[653,944,945],{"class":667}," express ",[653,947,948],{"class":659},"from",[653,950,677],{"class":663},[653,952,953],{"class":680},"express",[653,955,684],{"class":663},[653,957,958,960,962,964,966,968,970,973],{"class":655,"line":712},[653,959,660],{"class":659},[653,961,664],{"class":663},[653,963,845],{"class":667},[653,965,671],{"class":663},[653,967,674],{"class":659},[653,969,677],{"class":663},[653,971,972],{"class":680},"evlog\u002Fexpress",[653,974,684],{"class":663},[653,976,977,979,981,983,985,987,989,991],{"class":655,"line":731},[653,978,660],{"class":659},[653,980,664],{"class":663},[653,982,668],{"class":667},[653,984,671],{"class":663},[653,986,674],{"class":659},[653,988,677],{"class":663},[653,990,681],{"class":680},[653,992,684],{"class":663},[653,994,995],{"class":655,"line":738},[653,996,735],{"emptyLinePlaceholder":734},[653,998,999,1001,1003,1005,1008],{"class":655,"line":770},[653,1000,883],{"class":763},[653,1002,886],{"class":667},[653,1004,889],{"class":663},[653,1006,1007],{"class":747}," express",[653,1009,897],{"class":667},[653,1011,1012,1014,1016,1018,1020,1022,1024,1026,1028,1030,1032,1034,1036],{"class":655,"line":805},[653,1013,902],{"class":667},[653,1015,584],{"class":663},[653,1017,907],{"class":747},[653,1019,751],{"class":667},[653,1021,912],{"class":747},[653,1023,751],{"class":667},[653,1025,917],{"class":663},[653,1027,920],{"class":786},[653,1029,923],{"class":663},[653,1031,668],{"class":747},[653,1033,928],{"class":667},[653,1035,808],{"class":663},[653,1037,933],{"class":667},[643,1039,1041],{"className":645,"code":1040,"filename":266,"language":648,"meta":649,"style":649},"import Fastify from 'fastify'\nimport { evlog } from 'evlog\u002Ffastify'\nimport { createLokiDrain } from 'evlog\u002Floki'\n\nconst app = Fastify()\nawait app.register(evlog, { drain: createLokiDrain() })\n",[559,1042,1043,1059,1078,1096,1100,1113],{"__ignoreMap":649},[653,1044,1045,1047,1050,1052,1054,1057],{"class":655,"line":656},[653,1046,660],{"class":659},[653,1048,1049],{"class":667}," Fastify ",[653,1051,948],{"class":659},[653,1053,677],{"class":663},[653,1055,1056],{"class":680},"fastify",[653,1058,684],{"class":663},[653,1060,1061,1063,1065,1067,1069,1071,1073,1076],{"class":655,"line":712},[653,1062,660],{"class":659},[653,1064,664],{"class":663},[653,1066,845],{"class":667},[653,1068,671],{"class":663},[653,1070,674],{"class":659},[653,1072,677],{"class":663},[653,1074,1075],{"class":680},"evlog\u002Ffastify",[653,1077,684],{"class":663},[653,1079,1080,1082,1084,1086,1088,1090,1092,1094],{"class":655,"line":731},[653,1081,660],{"class":659},[653,1083,664],{"class":663},[653,1085,668],{"class":667},[653,1087,671],{"class":663},[653,1089,674],{"class":659},[653,1091,677],{"class":663},[653,1093,681],{"class":680},[653,1095,684],{"class":663},[653,1097,1098],{"class":655,"line":738},[653,1099,735],{"emptyLinePlaceholder":734},[653,1101,1102,1104,1106,1108,1111],{"class":655,"line":770},[653,1103,883],{"class":763},[653,1105,886],{"class":667},[653,1107,889],{"class":663},[653,1109,1110],{"class":747}," Fastify",[653,1112,897],{"class":667},[653,1114,1115,1118,1121,1123,1126,1129,1131,1133,1135,1137,1139,1141,1143],{"class":655,"line":805},[653,1116,1117],{"class":659},"await",[653,1119,1120],{"class":667}," app",[653,1122,584],{"class":663},[653,1124,1125],{"class":747},"register",[653,1127,1128],{"class":667},"(evlog",[653,1130,797],{"class":663},[653,1132,664],{"class":663},[653,1134,920],{"class":786},[653,1136,923],{"class":663},[653,1138,668],{"class":747},[653,1140,928],{"class":667},[653,1142,808],{"class":663},[653,1144,811],{"class":667},[643,1146,1148],{"className":645,"code":1147,"filename":271,"language":648,"meta":649,"style":649},"import { Elysia } from 'elysia'\nimport { evlog } from 'evlog\u002Felysia'\nimport { createLokiDrain } from 'evlog\u002Floki'\n\nconst app = new Elysia().use(evlog({ drain: createLokiDrain() }))\n",[559,1149,1150,1170,1189,1207,1211],{"__ignoreMap":649},[653,1151,1152,1154,1156,1159,1161,1163,1165,1168],{"class":655,"line":656},[653,1153,660],{"class":659},[653,1155,664],{"class":663},[653,1157,1158],{"class":667}," Elysia",[653,1160,671],{"class":663},[653,1162,674],{"class":659},[653,1164,677],{"class":663},[653,1166,1167],{"class":680},"elysia",[653,1169,684],{"class":663},[653,1171,1172,1174,1176,1178,1180,1182,1184,1187],{"class":655,"line":712},[653,1173,660],{"class":659},[653,1175,664],{"class":663},[653,1177,845],{"class":667},[653,1179,671],{"class":663},[653,1181,674],{"class":659},[653,1183,677],{"class":663},[653,1185,1186],{"class":680},"evlog\u002Felysia",[653,1188,684],{"class":663},[653,1190,1191,1193,1195,1197,1199,1201,1203,1205],{"class":655,"line":731},[653,1192,660],{"class":659},[653,1194,664],{"class":663},[653,1196,668],{"class":667},[653,1198,671],{"class":663},[653,1200,674],{"class":659},[653,1202,677],{"class":663},[653,1204,681],{"class":680},[653,1206,684],{"class":663},[653,1208,1209],{"class":655,"line":738},[653,1210,735],{"emptyLinePlaceholder":734},[653,1212,1213,1215,1217,1219,1221,1223,1226,1228,1230,1232,1234,1236,1238,1240,1242,1244,1246,1248],{"class":655,"line":770},[653,1214,883],{"class":763},[653,1216,886],{"class":667},[653,1218,889],{"class":663},[653,1220,892],{"class":663},[653,1222,1158],{"class":747},[653,1224,1225],{"class":667},"()",[653,1227,584],{"class":663},[653,1229,907],{"class":747},[653,1231,751],{"class":667},[653,1233,912],{"class":747},[653,1235,751],{"class":667},[653,1237,917],{"class":663},[653,1239,920],{"class":786},[653,1241,923],{"class":663},[653,1243,668],{"class":747},[653,1245,928],{"class":667},[653,1247,808],{"class":663},[653,1249,933],{"class":667},[643,1251,1253],{"className":645,"code":1252,"filename":251,"language":648,"meta":649,"style":649},"import { Module } from '@nestjs\u002Fcommon'\nimport { EvlogModule } from 'evlog\u002Fnestjs'\nimport { createLokiDrain } from 'evlog\u002Floki'\n\n@Module({\n  imports: [EvlogModule.forRoot({ drain: createLokiDrain() })],\n})\nexport class AppModule {}\n",[559,1254,1255,1275,1295,1313,1317,1330,1365,1372],{"__ignoreMap":649},[653,1256,1257,1259,1261,1264,1266,1268,1270,1273],{"class":655,"line":656},[653,1258,660],{"class":659},[653,1260,664],{"class":663},[653,1262,1263],{"class":667}," Module",[653,1265,671],{"class":663},[653,1267,674],{"class":659},[653,1269,677],{"class":663},[653,1271,1272],{"class":680},"@nestjs\u002Fcommon",[653,1274,684],{"class":663},[653,1276,1277,1279,1281,1284,1286,1288,1290,1293],{"class":655,"line":712},[653,1278,660],{"class":659},[653,1280,664],{"class":663},[653,1282,1283],{"class":667}," EvlogModule",[653,1285,671],{"class":663},[653,1287,674],{"class":659},[653,1289,677],{"class":663},[653,1291,1292],{"class":680},"evlog\u002Fnestjs",[653,1294,684],{"class":663},[653,1296,1297,1299,1301,1303,1305,1307,1309,1311],{"class":655,"line":731},[653,1298,660],{"class":659},[653,1300,664],{"class":663},[653,1302,668],{"class":667},[653,1304,671],{"class":663},[653,1306,674],{"class":659},[653,1308,677],{"class":663},[653,1310,681],{"class":680},[653,1312,684],{"class":663},[653,1314,1315],{"class":655,"line":738},[653,1316,735],{"emptyLinePlaceholder":734},[653,1318,1319,1322,1325,1327],{"class":655,"line":770},[653,1320,1321],{"class":663},"@",[653,1323,1324],{"class":747},"Module",[653,1326,751],{"class":667},[653,1328,1329],{"class":663},"{\n",[653,1331,1332,1335,1337,1340,1342,1345,1347,1349,1351,1353,1355,1357,1359,1362],{"class":655,"line":805},[653,1333,1334],{"class":786},"  imports",[653,1336,923],{"class":663},[653,1338,1339],{"class":667}," [EvlogModule",[653,1341,584],{"class":663},[653,1343,1344],{"class":747},"forRoot",[653,1346,751],{"class":667},[653,1348,917],{"class":663},[653,1350,920],{"class":786},[653,1352,923],{"class":663},[653,1354,668],{"class":747},[653,1356,928],{"class":667},[653,1358,808],{"class":663},[653,1360,1361],{"class":667},")]",[653,1363,1364],{"class":663},",\n",[653,1366,1368,1370],{"class":655,"line":1367},7,[653,1369,808],{"class":663},[653,1371,811],{"class":667},[653,1373,1375,1377,1380,1384],{"class":655,"line":1374},8,[653,1376,741],{"class":659},[653,1378,1379],{"class":763}," class",[653,1381,1383],{"class":1382},"sBMFI"," AppModule",[653,1385,1386],{"class":663}," {}\n",[643,1388,1390],{"className":645,"code":1389,"filename":286,"language":648,"meta":649,"style":649},"import { initLogger } from 'evlog'\nimport { createLokiDrain } from 'evlog\u002Floki'\n\ninitLogger({\n  env: { service: 'my-app' },\n  drain: createLokiDrain(),\n})\n",[559,1391,1392,1411,1429,1433,1442,1466,1479],{"__ignoreMap":649},[653,1393,1394,1396,1398,1401,1403,1405,1407,1409],{"class":655,"line":656},[653,1395,660],{"class":659},[653,1397,664],{"class":663},[653,1399,1400],{"class":667}," initLogger",[653,1402,671],{"class":663},[653,1404,674],{"class":659},[653,1406,677],{"class":663},[653,1408,912],{"class":680},[653,1410,684],{"class":663},[653,1412,1413,1415,1417,1419,1421,1423,1425,1427],{"class":655,"line":712},[653,1414,660],{"class":659},[653,1416,664],{"class":663},[653,1418,668],{"class":667},[653,1420,671],{"class":663},[653,1422,674],{"class":659},[653,1424,677],{"class":663},[653,1426,681],{"class":680},[653,1428,684],{"class":663},[653,1430,1431],{"class":655,"line":731},[653,1432,735],{"emptyLinePlaceholder":734},[653,1434,1435,1438,1440],{"class":655,"line":738},[653,1436,1437],{"class":747},"initLogger",[653,1439,751],{"class":667},[653,1441,1329],{"class":663},[653,1443,1444,1447,1449,1451,1454,1456,1458,1461,1463],{"class":655,"line":770},[653,1445,1446],{"class":786},"  env",[653,1448,923],{"class":663},[653,1450,664],{"class":663},[653,1452,1453],{"class":786}," service",[653,1455,923],{"class":663},[653,1457,677],{"class":663},[653,1459,1460],{"class":680},"my-app",[653,1462,789],{"class":663},[653,1464,1465],{"class":663}," },\n",[653,1467,1468,1471,1473,1475,1477],{"class":655,"line":805},[653,1469,1470],{"class":786},"  drain",[653,1472,923],{"class":663},[653,1474,668],{"class":747},[653,1476,1225],{"class":667},[653,1478,1364],{"class":663},[653,1480,1481,1483],{"class":655,"line":1367},[653,1482,808],{"class":663},[653,1484,811],{"class":667},[636,1486,504],{"id":1487},"configuration",[1489,1490,1492],"h3",{"id":1491},"environment-variables","Environment variables",[1494,1495,1496,1512],"table",{},[1497,1498,1499],"thead",{},[1500,1501,1502,1506,1509],"tr",{},[1503,1504,1505],"th",{},"Variable",[1503,1507,1508],{},"Required",[1503,1510,1511],{},"Description",[1513,1514,1515,1532,1552,1566],"tbody",{},[1500,1516,1517,1522,1525],{},[1518,1519,1520],"td",{},[559,1521,693],{},[1518,1523,1524],{},"Yes",[1518,1526,1527,1528,1531],{},"Base URL of the Loki instance, without the push path (",[559,1529,1530],{},"LOKI_URL"," also accepted)",[1500,1533,1534,1539,1542],{},[1518,1535,1536],{},[559,1537,1538],{},"LOKI_API_KEY",[1518,1540,1541],{},"No",[1518,1543,1544,1545,1548,1549,1531],{},"API token. Sent as Basic with ",[559,1546,1547],{},"LOKI_USER",", otherwise as Bearer (",[559,1550,1551],{},"GRAFANA_API_KEY",[1500,1553,1554,1558,1560],{},[1518,1555,1556],{},[559,1557,1547],{},[1518,1559,1541],{},[1518,1561,1562,1563,1531],{},"Grafana Cloud instance ID. Switches auth to Basic (",[559,1564,1565],{},"GRAFANA_USER",[1500,1567,1568,1573,1575],{},[1518,1569,1570],{},[559,1571,1572],{},"LOKI_TENANT_ID",[1518,1574,1541],{},[1518,1576,1577,1578],{},"Tenant for multi-tenant self-hosted Loki, sent as ",[559,1579,1580],{},"X-Scope-OrgID",[1489,1582,1584],{"id":1583},"priority","Priority",[540,1586,1587],{},"Configuration is resolved highest to lowest:",[594,1589,1590,1596,1602,1607],{},[597,1591,1592,1593],{},"Overrides passed to ",[559,1594,1595],{},"createLokiDrain()",[597,1597,1598,1601],{},[559,1599,1600],{},"runtimeConfig.evlog.loki"," (Nitro)",[597,1603,1604,1601],{},[559,1605,1606],{},"runtimeConfig.loki",[597,1608,1492],{},[1489,1610,332],{"id":1611},"options",[1494,1613,1614,1629],{},[1497,1615,1616],{},[1500,1617,1618,1621,1624,1627],{},[1503,1619,1620],{},"Option",[1503,1622,1623],{},"Type",[1503,1625,1626],{},"Default",[1503,1628,1511],{},[1513,1630,1631,1652,1668,1683,1701,1721,1738,1758],{},[1500,1632,1633,1638,1643,1646],{},[1518,1634,1635],{},[559,1636,1637],{},"endpoint",[1518,1639,1640],{},[559,1641,1642],{},"string",[1518,1644,1645],{},"—",[1518,1647,1648,1649],{},"Base URL, without ",[559,1650,1651],{},"\u002Floki\u002Fapi\u002Fv1\u002Fpush",[1500,1653,1654,1659,1663,1665],{},[1518,1655,1656],{},[559,1657,1658],{},"apiKey",[1518,1660,1661],{},[559,1662,1642],{},[1518,1664,1645],{},[1518,1666,1667],{},"API token",[1500,1669,1670,1674,1678,1680],{},[1518,1671,1672],{},[559,1673,579],{},[1518,1675,1676],{},[559,1677,1642],{},[1518,1679,1645],{},[1518,1681,1682],{},"Grafana Cloud instance ID (enables Basic auth)",[1500,1684,1685,1690,1694,1696],{},[1518,1686,1687],{},[559,1688,1689],{},"tenantId",[1518,1691,1692],{},[559,1693,1642],{},[1518,1695,1645],{},[1518,1697,1698,1700],{},[559,1699,1580],{}," for multi-tenant Loki",[1500,1702,1703,1708,1713,1718],{},[1518,1704,1705],{},[559,1706,1707],{},"labelFields",[1518,1709,1710],{},[559,1711,1712],{},"string[]",[1518,1714,1715],{},[559,1716,1717],{},"['service', 'environment', 'level']",[1518,1719,1720],{},"Event fields promoted to Loki labels",[1500,1722,1723,1728,1733,1735],{},[1518,1724,1725],{},[559,1726,1727],{},"labels",[1518,1729,1730],{},[559,1731,1732],{},"Record\u003Cstring, string>",[1518,1734,1645],{},[1518,1736,1737],{},"Static labels merged into every stream",[1500,1739,1740,1745,1750,1755],{},[1518,1741,1742],{},[559,1743,1744],{},"timeout",[1518,1746,1747],{},[559,1748,1749],{},"number",[1518,1751,1752],{},[559,1753,1754],{},"5000",[1518,1756,1757],{},"Request timeout in ms",[1500,1759,1760,1765,1769,1774],{},[1518,1761,1762],{},[559,1763,1764],{},"retries",[1518,1766,1767],{},[559,1768,1749],{},[1518,1770,1771],{},[559,1772,1773],{},"2",[1518,1775,1776],{},"Retry attempts on transient failures",[636,1778,1780],{"id":1779},"deployment","Deployment",[540,1782,1783],{},"Loki runs either way, and the adapter is the same in both cases. Only\nauthentication differs.",[1489,1785,1787],{"id":1786},"self-hosted","Self-hosted",[540,1789,1790],{},"A single-tenant instance needs nothing but the endpoint:",[643,1792,1795],{"className":645,"code":1793,"filename":1794,"language":648,"meta":649,"style":649},"createLokiDrain({ endpoint: 'http:\u002F\u002Flocalhost:3100' })\n","server\u002Fplugins\u002Fevlog.ts",[559,1796,1797],{"__ignoreMap":649},[653,1798,1799,1802,1804,1806,1809,1811,1813,1815,1817,1819],{"class":655,"line":656},[653,1800,1801],{"class":747},"createLokiDrain",[653,1803,751],{"class":667},[653,1805,917],{"class":663},[653,1807,1808],{"class":786}," endpoint",[653,1810,923],{"class":663},[653,1812,677],{"class":663},[653,1814,614],{"class":680},[653,1816,789],{"class":663},[653,1818,671],{"class":663},[653,1820,811],{"class":667},[643,1822,1827],{"className":1823,"code":1824,"filename":1825,"language":1826,"meta":649,"style":649},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","LOKI_ENDPOINT=http:\u002F\u002Flocalhost:3100\n",".env","bash",[559,1828,1829],{"__ignoreMap":649},[653,1830,1831,1833,1835],{"class":655,"line":656},[653,1832,693],{"class":667},[653,1834,889],{"class":663},[653,1836,1837],{"class":680},"http:\u002F\u002Flocalhost:3100\n",[540,1839,1840,1841,1844,1845,923],{},"For a ",[554,1842,1843],{},"multi-tenant"," deployment, name the tenant, and it is sent as ",[559,1846,1580],{},[643,1848,1850],{"className":645,"code":1849,"filename":1794,"language":648,"meta":649,"style":649},"createLokiDrain({\n  endpoint: 'http:\u002F\u002Floki.internal:3100',\n  tenantId: 'team-checkout',\n})\n",[559,1851,1852,1860,1876,1892],{"__ignoreMap":649},[653,1853,1854,1856,1858],{"class":655,"line":656},[653,1855,1801],{"class":747},[653,1857,751],{"class":667},[653,1859,1329],{"class":663},[653,1861,1862,1865,1867,1869,1872,1874],{"class":655,"line":712},[653,1863,1864],{"class":786},"  endpoint",[653,1866,923],{"class":663},[653,1868,677],{"class":663},[653,1870,1871],{"class":680},"http:\u002F\u002Floki.internal:3100",[653,1873,789],{"class":663},[653,1875,1364],{"class":663},[653,1877,1878,1881,1883,1885,1888,1890],{"class":655,"line":731},[653,1879,1880],{"class":786},"  tenantId",[653,1882,923],{"class":663},[653,1884,677],{"class":663},[653,1886,1887],{"class":680},"team-checkout",[653,1889,789],{"class":663},[653,1891,1364],{"class":663},[653,1893,1894,1896],{"class":655,"line":738},[653,1895,808],{"class":663},[653,1897,811],{"class":667},[643,1899,1901],{"className":1823,"code":1900,"filename":1825,"language":1826,"meta":649,"style":649},"LOKI_ENDPOINT=http:\u002F\u002Floki.internal:3100\nLOKI_TENANT_ID=team-checkout\n",[559,1902,1903,1912],{"__ignoreMap":649},[653,1904,1905,1907,1909],{"class":655,"line":656},[653,1906,693],{"class":667},[653,1908,889],{"class":663},[653,1910,1911],{"class":680},"http:\u002F\u002Floki.internal:3100\n",[653,1913,1914,1916,1918],{"class":655,"line":712},[653,1915,1572],{"class":667},[653,1917,889],{"class":663},[653,1919,1920],{"class":680},"team-checkout\n",[540,1922,1923,1924,1926,1927,584],{},"If your instance sits behind an authenticating proxy, ",[559,1925,1658],{}," alone is sent as\n",[559,1928,1929],{},"Authorization: Bearer",[1489,1931,1933],{"id":1932},"grafana-cloud","Grafana Cloud",[540,1935,1936,1937,1940],{},"Grafana Cloud authenticates with your ",[554,1938,1939],{},"instance ID"," plus an access policy\ntoken, sent together as HTTP Basic:",[643,1942,1944],{"className":645,"code":1943,"filename":1794,"language":648,"meta":649,"style":649},"createLokiDrain({\n  endpoint: 'https:\u002F\u002Flogs-prod-eu-west-0.grafana.net',\n  user: '123456',\n  apiKey: process.env.GRAFANA_API_KEY,\n})\n",[559,1945,1946,1954,1969,1985,2006],{"__ignoreMap":649},[653,1947,1948,1950,1952],{"class":655,"line":656},[653,1949,1801],{"class":747},[653,1951,751],{"class":667},[653,1953,1329],{"class":663},[653,1955,1956,1958,1960,1962,1965,1967],{"class":655,"line":712},[653,1957,1864],{"class":786},[653,1959,923],{"class":663},[653,1961,677],{"class":663},[653,1963,1964],{"class":680},"https:\u002F\u002Flogs-prod-eu-west-0.grafana.net",[653,1966,789],{"class":663},[653,1968,1364],{"class":663},[653,1970,1971,1974,1976,1978,1981,1983],{"class":655,"line":731},[653,1972,1973],{"class":786},"  user",[653,1975,923],{"class":663},[653,1977,677],{"class":663},[653,1979,1980],{"class":680},"123456",[653,1982,789],{"class":663},[653,1984,1364],{"class":663},[653,1986,1987,1990,1992,1995,1997,2000,2002,2004],{"class":655,"line":738},[653,1988,1989],{"class":786},"  apiKey",[653,1991,923],{"class":663},[653,1993,1994],{"class":667}," process",[653,1996,584],{"class":663},[653,1998,1999],{"class":667},"env",[653,2001,584],{"class":663},[653,2003,1551],{"class":667},[653,2005,1364],{"class":663},[653,2007,2008,2010],{"class":655,"line":770},[653,2009,808],{"class":663},[653,2011,811],{"class":667},[643,2013,2015],{"className":1823,"code":2014,"filename":1825,"language":1826,"meta":649,"style":649},"LOKI_ENDPOINT=https:\u002F\u002Flogs-prod-eu-west-0.grafana.net\nLOKI_USER=123456\nLOKI_API_KEY=glc_xxx\n",[559,2016,2017,2026,2035],{"__ignoreMap":649},[653,2018,2019,2021,2023],{"class":655,"line":656},[653,2020,693],{"class":667},[653,2022,889],{"class":663},[653,2024,2025],{"class":680},"https:\u002F\u002Flogs-prod-eu-west-0.grafana.net\n",[653,2027,2028,2030,2032],{"class":655,"line":712},[653,2029,1547],{"class":667},[653,2031,889],{"class":663},[653,2033,2034],{"class":680},"123456\n",[653,2036,2037,2039,2041],{"class":655,"line":731},[653,2038,1538],{"class":667},[653,2040,889],{"class":663},[653,2042,2043],{"class":680},"glc_xxx\n",[2045,2046,2049,2051,2052,2055,2056,2060,2061,584],"callout",{"color":2047,"icon":2048},"info","i-lucide-info",[559,2050,579],{}," is the ",[554,2053,2054],{},"numeric instance ID"," of the Loki datasource. Find it under\n",[2057,2058,2059],"em",{},"Connections → Data sources → Loki"," in your Grafana Cloud stack. It is not your\naccount email. Using the wrong value is the usual cause of a ",[559,2062,2063],{},"401",[1489,2065,2067],{"id":2066},"which-auth-applies","Which auth applies",[1494,2069,2070,2089],{},[1497,2071,2072],{},[1500,2073,2074,2078,2082,2086],{},[1503,2075,2076],{},[559,2077,579],{},[1503,2079,2080],{},[559,2081,1658],{},[1503,2083,2084],{},[559,2085,1689],{},[1503,2087,2088],{},"Header sent",[1513,2090,2091,2105,2118,2131],{},[1500,2092,2093,2096,2098,2100],{},[1518,2094,2095],{},"✓",[1518,2097,2095],{},[1518,2099],{},[1518,2101,2102],{},[559,2103,2104],{},"Authorization: Basic base64(user:apiKey)",[1500,2106,2107,2109,2111,2113],{},[1518,2108],{},[1518,2110,2095],{},[1518,2112],{},[1518,2114,2115],{},[559,2116,2117],{},"Authorization: Bearer \u003CapiKey>",[1500,2119,2120,2122,2124,2126],{},[1518,2121],{},[1518,2123],{},[1518,2125,2095],{},[1518,2127,2128],{},[559,2129,2130],{},"X-Scope-OrgID: \u003CtenantId>",[1500,2132,2133,2135,2137,2139],{},[1518,2134],{},[1518,2136],{},[1518,2138],{},[1518,2140,2141],{},"none — unauthenticated instance",[540,2143,2144,2146],{},[559,2145,1689],{}," is independent and can be combined with either auth mode.",[636,2148,2150],{"id":2149},"labels-and-cardinality","Labels and cardinality",[2045,2152,2155,2156,2158,2159,2162],{"color":2153,"icon":2154},"warning","i-lucide-triangle-alert","Never promote a high-cardinality field to a label. Loki creates one stream per unique label combination, so labelling ",[559,2157,573],{}," or ",[559,2160,2161],{},"userId"," will create millions of streams and degrade or break your instance.",[540,2164,2165],{},"Add a label only for values you filter on and that have a bounded set:",[643,2167,2169],{"className":645,"code":2168,"filename":1794,"language":648,"meta":649,"style":649},"createLokiDrain({\n  \u002F\u002F `region` has a handful of values — safe\n  labelFields: ['service', 'environment', 'level', 'region'],\n  \u002F\u002F Static labels for everything in this deployment\n  labels: { cluster: 'prod-eu' },\n})\n",[559,2170,2171,2179,2184,2230,2235,2258],{"__ignoreMap":649},[653,2172,2173,2175,2177],{"class":655,"line":656},[653,2174,1801],{"class":747},[653,2176,751],{"class":667},[653,2178,1329],{"class":663},[653,2180,2181],{"class":655,"line":712},[653,2182,2183],{"class":708},"  \u002F\u002F `region` has a handful of values — safe\n",[653,2185,2186,2189,2191,2194,2196,2198,2200,2202,2204,2206,2208,2210,2212,2214,2216,2218,2220,2223,2225,2228],{"class":655,"line":731},[653,2187,2188],{"class":786},"  labelFields",[653,2190,923],{"class":663},[653,2192,2193],{"class":667}," [",[653,2195,789],{"class":663},[653,2197,561],{"class":680},[653,2199,789],{"class":663},[653,2201,797],{"class":663},[653,2203,677],{"class":663},[653,2205,565],{"class":680},[653,2207,789],{"class":663},[653,2209,797],{"class":663},[653,2211,677],{"class":663},[653,2213,569],{"class":680},[653,2215,789],{"class":663},[653,2217,797],{"class":663},[653,2219,677],{"class":663},[653,2221,2222],{"class":680},"region",[653,2224,789],{"class":663},[653,2226,2227],{"class":667},"]",[653,2229,1364],{"class":663},[653,2231,2232],{"class":655,"line":738},[653,2233,2234],{"class":708},"  \u002F\u002F Static labels for everything in this deployment\n",[653,2236,2237,2240,2242,2244,2247,2249,2251,2254,2256],{"class":655,"line":770},[653,2238,2239],{"class":786},"  labels",[653,2241,923],{"class":663},[653,2243,664],{"class":663},[653,2245,2246],{"class":786}," cluster",[653,2248,923],{"class":663},[653,2250,677],{"class":663},[653,2252,2253],{"class":680},"prod-eu",[653,2255,789],{"class":663},[653,2257,1465],{"class":663},[653,2259,2260,2262],{"class":655,"line":805},[653,2261,808],{"class":663},[653,2263,811],{"class":667},[540,2265,2266],{},"Everything else stays in the JSON line and is fully queryable. See below.",[636,2268,2270],{"id":2269},"querying-in-grafana","Querying in Grafana",[540,2272,2273,2274,923],{},"Filter by label, then reach into the wide event with ",[559,2275,583],{},[643,2277,2281],{"className":2278,"code":2279,"language":2280,"meta":649,"style":649},"language-logql shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","{service=\"checkout\", environment=\"production\"}\n  | json\n  | status >= 500\n","logql",[559,2282,2283,2288,2293],{"__ignoreMap":649},[653,2284,2285],{"class":655,"line":656},[653,2286,2287],{},"{service=\"checkout\", environment=\"production\"}\n",[653,2289,2290],{"class":655,"line":712},[653,2291,2292],{},"  | json\n",[653,2294,2295],{"class":655,"line":731},[653,2296,2297],{},"  | status >= 500\n",[643,2299,2301],{"className":2278,"code":2300,"language":2280,"meta":649,"style":649},"# Slow requests on one route\n{service=\"checkout\"} | json | path=\"\u002Fapi\u002Forders\" | durationMs > 1000\n",[559,2302,2303,2308],{"__ignoreMap":649},[653,2304,2305],{"class":655,"line":656},[653,2306,2307],{},"# Slow requests on one route\n",[653,2309,2310],{"class":655,"line":712},[653,2311,2312],{},"{service=\"checkout\"} | json | path=\"\u002Fapi\u002Forders\" | durationMs > 1000\n",[643,2314,2316],{"className":2278,"code":2315,"language":2280,"meta":649,"style":649},"# One request end to end\n{service=\"checkout\"} | json | requestId=\"4a8ff3a8-...\"\n",[559,2317,2318,2323],{"__ignoreMap":649},[653,2319,2320],{"class":655,"line":656},[653,2321,2322],{},"# One request end to end\n",[653,2324,2325],{"class":655,"line":712},[653,2326,2327],{},"{service=\"checkout\"} | json | requestId=\"4a8ff3a8-...\"\n",[643,2329,2331],{"className":2278,"code":2330,"language":2280,"meta":649,"style":649},"# Error rate per service\nsum by (service) (rate({environment=\"production\", level=\"error\"}[5m]))\n",[559,2332,2333,2338],{"__ignoreMap":649},[653,2334,2335],{"class":655,"line":656},[653,2336,2337],{},"# Error rate per service\n",[653,2339,2340],{"class":655,"line":712},[653,2341,2342],{},"sum by (service) (rate({environment=\"production\", level=\"error\"}[5m]))\n",[636,2344,2346],{"id":2345},"batching","Batching",[540,2348,2349],{},"Pair the drain with a pipeline to push in batches rather than per request:",[643,2351,2353],{"className":645,"code":2352,"filename":1794,"language":648,"meta":649,"style":649},"import { createDrainPipeline } from 'evlog\u002Fpipeline'\nimport { createLokiDrain } from 'evlog\u002Floki'\nimport type { DrainContext } from 'evlog'\n\nconst pipeline = createDrainPipeline\u003CDrainContext>({\n  batch: { size: 100, intervalMs: 5000 },\n})\n\nexport default defineNitroPlugin((nitroApp) => {\n  nitroApp.hooks.hook('evlog:drain', pipeline(createLokiDrain()))\n})\n",[559,2354,2355,2375,2393,2415,2419,2443,2473,2479,2483,2504,2537],{"__ignoreMap":649},[653,2356,2357,2359,2361,2364,2366,2368,2370,2373],{"class":655,"line":656},[653,2358,660],{"class":659},[653,2360,664],{"class":663},[653,2362,2363],{"class":667}," createDrainPipeline",[653,2365,671],{"class":663},[653,2367,674],{"class":659},[653,2369,677],{"class":663},[653,2371,2372],{"class":680},"evlog\u002Fpipeline",[653,2374,684],{"class":663},[653,2376,2377,2379,2381,2383,2385,2387,2389,2391],{"class":655,"line":712},[653,2378,660],{"class":659},[653,2380,664],{"class":663},[653,2382,668],{"class":667},[653,2384,671],{"class":663},[653,2386,674],{"class":659},[653,2388,677],{"class":663},[653,2390,681],{"class":680},[653,2392,684],{"class":663},[653,2394,2395,2397,2400,2402,2405,2407,2409,2411,2413],{"class":655,"line":731},[653,2396,660],{"class":659},[653,2398,2399],{"class":659}," type",[653,2401,664],{"class":663},[653,2403,2404],{"class":667}," DrainContext",[653,2406,671],{"class":663},[653,2408,674],{"class":659},[653,2410,677],{"class":663},[653,2412,912],{"class":680},[653,2414,684],{"class":663},[653,2416,2417],{"class":655,"line":738},[653,2418,735],{"emptyLinePlaceholder":734},[653,2420,2421,2423,2426,2428,2430,2433,2436,2439,2441],{"class":655,"line":770},[653,2422,883],{"class":763},[653,2424,2425],{"class":667}," pipeline ",[653,2427,889],{"class":663},[653,2429,2363],{"class":747},[653,2431,2432],{"class":663},"\u003C",[653,2434,2435],{"class":1382},"DrainContext",[653,2437,2438],{"class":663},">",[653,2440,751],{"class":667},[653,2442,1329],{"class":663},[653,2444,2445,2448,2450,2452,2455,2457,2461,2463,2466,2468,2471],{"class":655,"line":805},[653,2446,2447],{"class":786},"  batch",[653,2449,923],{"class":663},[653,2451,664],{"class":663},[653,2453,2454],{"class":786}," size",[653,2456,923],{"class":663},[653,2458,2460],{"class":2459},"sbssI"," 100",[653,2462,797],{"class":663},[653,2464,2465],{"class":786}," intervalMs",[653,2467,923],{"class":663},[653,2469,2470],{"class":2459}," 5000",[653,2472,1465],{"class":663},[653,2474,2475,2477],{"class":655,"line":1367},[653,2476,808],{"class":663},[653,2478,811],{"class":667},[653,2480,2481],{"class":655,"line":1374},[653,2482,735],{"emptyLinePlaceholder":734},[653,2484,2486,2488,2490,2492,2494,2496,2498,2500,2502],{"class":655,"line":2485},9,[653,2487,741],{"class":659},[653,2489,744],{"class":659},[653,2491,748],{"class":747},[653,2493,751],{"class":667},[653,2495,751],{"class":663},[653,2497,757],{"class":756},[653,2499,760],{"class":663},[653,2501,764],{"class":763},[653,2503,767],{"class":663},[653,2505,2507,2509,2511,2513,2515,2517,2519,2521,2523,2525,2527,2530,2532,2534],{"class":655,"line":2506},10,[653,2508,773],{"class":667},[653,2510,584],{"class":663},[653,2512,778],{"class":667},[653,2514,584],{"class":663},[653,2516,783],{"class":747},[653,2518,751],{"class":786},[653,2520,789],{"class":663},[653,2522,792],{"class":680},[653,2524,789],{"class":663},[653,2526,797],{"class":663},[653,2528,2529],{"class":747}," pipeline",[653,2531,751],{"class":786},[653,2533,1801],{"class":747},[653,2535,2536],{"class":786},"()))\n",[653,2538,2540,2542],{"class":655,"line":2539},11,[653,2541,808],{"class":663},[653,2543,811],{"class":667},[540,2545,2546],{},"Events sharing a label set are grouped into a single Loki stream, and entries are sorted by timestamp, because Loki rejects out-of-order pushes within a stream.",[636,2548,2550],{"id":2549},"verify-it-locally","Verify it locally",[540,2552,2553],{},"Spin up Loki in Docker and push a real event, with no cloud account needed:",[643,2555,2558],{"className":1823,"code":2556,"filename":2557,"language":1826,"meta":649,"style":649},"docker compose -f packages\u002Fevlog\u002Ftest\u002Fe2e\u002Fdocker-compose.yml up -d\nLOKI_ENDPOINT=http:\u002F\u002Flocalhost:3100 pnpm run test:e2e\ndocker compose -f packages\u002Fevlog\u002Ftest\u002Fe2e\u002Fdocker-compose.yml down -v\n","Terminal",[559,2559,2560,2580,2597],{"__ignoreMap":649},[653,2561,2562,2565,2568,2571,2574,2577],{"class":655,"line":656},[653,2563,2564],{"class":1382},"docker",[653,2566,2567],{"class":680}," compose",[653,2569,2570],{"class":680}," -f",[653,2572,2573],{"class":680}," packages\u002Fevlog\u002Ftest\u002Fe2e\u002Fdocker-compose.yml",[653,2575,2576],{"class":680}," up",[653,2578,2579],{"class":680}," -d\n",[653,2581,2582,2584,2586,2588,2591,2594],{"class":655,"line":712},[653,2583,693],{"class":667},[653,2585,889],{"class":663},[653,2587,614],{"class":680},[653,2589,2590],{"class":1382}," pnpm",[653,2592,2593],{"class":680}," run",[653,2595,2596],{"class":680}," test:e2e\n",[653,2598,2599,2601,2603,2605,2607,2610],{"class":655,"line":731},[653,2600,2564],{"class":1382},[653,2602,2567],{"class":680},[653,2604,2570],{"class":680},[653,2606,2573],{"class":680},[653,2608,2609],{"class":680}," down",[653,2611,2612],{"class":680}," -v\n",[540,2614,2615,2616,2619,2620,2622],{},"The suite is a ",[554,2617,2618],{},"round-trip",": it pushes events, queries them back through\nLoki's range API, and asserts the label set, the JSON log line and the\ntimestamp survived. Without ",[559,2621,693],{}," it skips itself with a visible\nlabel rather than passing silently.",[540,2624,2625,2626,2628,2629,584],{},"To eyeball the result instead, point any Grafana at ",[559,2627,614],{},"\nand run ",[559,2630,2631],{},"{service=\"evlog-e2e\"}",[636,2633,2635],{"id":2634},"troubleshooting","Troubleshooting",[540,2637,2638,2643,2644,2646,2647,2649,2650,2653],{},[554,2639,2640,584],{},[559,2641,2642],{},"Missing endpoint"," ",[559,2645,693],{}," is unset and no ",[559,2648,1637],{}," was passed. The drain logs ",[559,2651,2652],{},"[evlog\u002Floki] Missing endpoint"," once and then does nothing, so requests are never blocked or failed.",[540,2655,2656,2661,2662,2664,2665,2667],{},[554,2657,2658,584],{},[559,2659,2660],{},"Loki API error: 401"," On Grafana Cloud, check that ",[559,2663,579],{}," is the numeric ",[554,2666,1939],{}," of the Loki datasource, not your account email.",[540,2669,2670,2676,2677,2680],{},[554,2671,2672,2675],{},[559,2673,2674],{},"Loki API error: 400"," mentioning out-of-order entries."," Older Loki versions reject entries older than the most recent one in a stream. evlog sorts within each push; if you still hit this, enable ",[559,2678,2679],{},"unordered_writes"," in Loki or reduce the batch interval.",[540,2682,2683,2686,2687,2690],{},[554,2684,2685],{},"Nothing appears in Grafana."," Confirm the label set you are querying. Run ",[559,2688,2689],{},"{service=~\".+\"}"," first to see which streams arrived.",[636,2692,2694],{"id":2693},"direct-api-usage","Direct API usage",[540,2696,2697],{},"Bypass the drain to push events yourself:",[643,2699,2702],{"className":645,"code":2700,"filename":2701,"language":648,"meta":649,"style":649},"import { sendBatchToLoki, sendToLoki } from 'evlog\u002Floki'\n\nawait sendToLoki(event, { endpoint: 'http:\u002F\u002Flocalhost:3100' })\nawait sendBatchToLoki(events, { endpoint: 'http:\u002F\u002Flocalhost:3100' })\n","scripts\u002Fbackfill.ts",[559,2703,2704,2728,2732,2759],{"__ignoreMap":649},[653,2705,2706,2708,2710,2713,2715,2718,2720,2722,2724,2726],{"class":655,"line":656},[653,2707,660],{"class":659},[653,2709,664],{"class":663},[653,2711,2712],{"class":667}," sendBatchToLoki",[653,2714,797],{"class":663},[653,2716,2717],{"class":667}," sendToLoki",[653,2719,671],{"class":663},[653,2721,674],{"class":659},[653,2723,677],{"class":663},[653,2725,681],{"class":680},[653,2727,684],{"class":663},[653,2729,2730],{"class":655,"line":712},[653,2731,735],{"emptyLinePlaceholder":734},[653,2733,2734,2736,2738,2741,2743,2745,2747,2749,2751,2753,2755,2757],{"class":655,"line":731},[653,2735,1117],{"class":659},[653,2737,2717],{"class":747},[653,2739,2740],{"class":667},"(event",[653,2742,797],{"class":663},[653,2744,664],{"class":663},[653,2746,1808],{"class":786},[653,2748,923],{"class":663},[653,2750,677],{"class":663},[653,2752,614],{"class":680},[653,2754,789],{"class":663},[653,2756,671],{"class":663},[653,2758,811],{"class":667},[653,2760,2761,2763,2765,2768,2770,2772,2774,2776,2778,2780,2782,2784],{"class":655,"line":738},[653,2762,1117],{"class":659},[653,2764,2712],{"class":747},[653,2766,2767],{"class":667},"(events",[653,2769,797],{"class":663},[653,2771,664],{"class":663},[653,2773,1808],{"class":786},[653,2775,923],{"class":663},[653,2777,677],{"class":663},[653,2779,614],{"class":680},[653,2781,789],{"class":663},[653,2783,671],{"class":663},[653,2785,811],{"class":667},[540,2787,2788,562,2791,566,2794,2797],{},[559,2789,2790],{},"buildLokiPayload()",[559,2792,2793],{},"toLokiLabels()",[559,2795,2796],{},"resolveLokiPushUrl()"," are also exported for custom transports.",[636,2799,2801],{"id":2800},"next-steps","Next steps",[2803,2804,2805,2810,2815,2821],"ul",{},[597,2806,2807,2809],{},[544,2808,59],{"href":60},": control log volume before it reaches Loki",[597,2811,2812,2814],{},[544,2813,428],{"href":429},": add derived fields to every event",[597,2816,2817,2820],{},[544,2818,2819],{"href":493},"Drain pipeline",": batching, retries, and fan-out",[597,2822,2823,2826],{},[544,2824,2825],{"href":138},"Adapters Overview",": all available destinations",[2828,2829,2830],"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 .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 .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 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":649,"searchDepth":712,"depth":712,"links":2832},[2833,2834,2835,2840,2845,2846,2847,2848,2849,2850,2851],{"id":638,"depth":712,"text":19},{"id":687,"depth":712,"text":24},{"id":1487,"depth":712,"text":504,"children":2836},[2837,2838,2839],{"id":1491,"depth":731,"text":1492},{"id":1583,"depth":731,"text":1584},{"id":1611,"depth":731,"text":332},{"id":1779,"depth":712,"text":1780,"children":2841},[2842,2843,2844],{"id":1786,"depth":731,"text":1787},{"id":1932,"depth":731,"text":1933},{"id":2066,"depth":731,"text":2067},{"id":2149,"depth":712,"text":2150},{"id":2269,"depth":712,"text":2270},{"id":2345,"depth":712,"text":2346},{"id":2549,"depth":712,"text":2550},{"id":2634,"depth":712,"text":2635},{"id":2693,"depth":712,"text":2694},{"id":2800,"depth":712,"text":2801},"Push wide events to Grafana Loki — self-hosted, multi-tenant, or Grafana Cloud — with low-cardinality labels and full JSON querying.","md",[2855,2862],{"label":2856,"icon":2857,"to":2858,"target":2859,"color":2860,"variant":2861},"Loki HTTP API","i-lucide-external-link","https:\u002F\u002Fgrafana.com\u002Fdocs\u002Floki\u002Flatest\u002Freference\u002Floki-http-api\u002F","_blank","neutral","subtle",{"label":2863,"icon":2857,"to":2864,"target":2859,"color":2860,"variant":2861},"LogQL","https:\u002F\u002Fgrafana.com\u002Fdocs\u002Floki\u002Flatest\u002Fquery\u002F",{},{"title":177,"icon":180},{"title":535,"description":2852},"3ojNapfXdoP0ukimUFES-lT5m0GMw5mDjlzlQ4F9Dtc",[2870,2872],{"title":167,"path":168,"stem":169,"description":2871,"icon":170,"children":-1},"Send wide events to Datadog Logs via the native HTTP intake API. Supports all Datadog sites and DD_* environment variables.",{"title":182,"path":183,"stem":184,"description":2873,"icon":185,"children":-1},"Insert wide events into ClickHouse over the HTTP interface — typed columns for what you aggregate, full JSON for everything else.",1786806593089]