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