[{"data":1,"prerenderedAt":1486},["ShallowReactive",2],{"navigation_docs":3,"-docs-connect-any-stack":150,"-docs-connect-any-stack-surround":1481},[4,23,41,99,128],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":22},"Getting started","i-lucide-rocket","\u002Fdocs\u002Fgetting-started","docs\u002F1.getting-started",[10,14,18],{"title":11,"path":12,"stem":13},"Introduction","\u002Fdocs\u002Fgetting-started\u002Fintroduction","docs\u002F1.getting-started\u002F1.introduction",{"title":15,"path":16,"stem":17},"Quickstart","\u002Fdocs\u002Fgetting-started\u002Fquickstart","docs\u002F1.getting-started\u002F2.quickstart",{"title":19,"path":20,"stem":21},"How it works","\u002Fdocs\u002Fgetting-started\u002Fhow-it-works","docs\u002F1.getting-started\u002F3.how-it-works",false,{"title":24,"icon":25,"path":26,"stem":27,"children":28,"page":22},"Connect an app","i-lucide-plug","\u002Fdocs\u002Fconnect","docs\u002F2.connect",[29,33,37],{"title":30,"path":31,"stem":32},"Adonis","\u002Fdocs\u002Fconnect\u002Fadonis","docs\u002F2.connect\u002F1.adonis",{"title":34,"path":35,"stem":36},"NestJS","\u002Fdocs\u002Fconnect\u002Fnestjs","docs\u002F2.connect\u002F2.nestjs",{"title":38,"path":39,"stem":40},"Any stack, no SDK","\u002Fdocs\u002Fconnect\u002Fany-stack","docs\u002F2.connect\u002F3.any-stack",{"title":42,"icon":43,"path":44,"stem":45,"children":46,"page":22},"Definitions","i-lucide-code","\u002Fdocs\u002Fdefinitions","docs\u002F3.definitions",[47,51,55,59,63,67,71,75,79,83,87,91,95],{"title":48,"path":49,"stem":50},"Overview","\u002Fdocs\u002Fdefinitions\u002Foverview","docs\u002F3.definitions\u002F01.overview",{"title":52,"path":53,"stem":54},"Log renderers","\u002Fdocs\u002Fdefinitions\u002Flog-renderers","docs\u002F3.definitions\u002F02.log-renderers",{"title":56,"path":57,"stem":58},"Error renderers","\u002Fdocs\u002Fdefinitions\u002Ferror-renderers","docs\u002F3.definitions\u002F03.error-renderers",{"title":60,"path":61,"stem":62},"Processes","\u002Fdocs\u002Fdefinitions\u002Fprocesses","docs\u002F3.definitions\u002F04.processes",{"title":64,"path":65,"stem":66},"Pages","\u002Fdocs\u002Fdefinitions\u002Fpages","docs\u002F3.definitions\u002F05.pages",{"title":68,"path":69,"stem":70},"Dashboards","\u002Fdocs\u002Fdefinitions\u002Fdashboards","docs\u002F3.definitions\u002F06.dashboards",{"title":72,"path":73,"stem":74},"Alerts","\u002Fdocs\u002Fdefinitions\u002Falerts","docs\u002F3.definitions\u002F07.alerts",{"title":76,"path":77,"stem":78},"Monitors","\u002Fdocs\u002Fdefinitions\u002Fmonitors","docs\u002F3.definitions\u002F08.monitors",{"title":80,"path":81,"stem":82},"Status page","\u002Fdocs\u002Fdefinitions\u002Fstatus-page","docs\u002F3.definitions\u002F09.status-page",{"title":84,"path":85,"stem":86},"Tools","\u002Fdocs\u002Fdefinitions\u002Ftools","docs\u002F3.definitions\u002F10.tools",{"title":88,"path":89,"stem":90},"Redactors","\u002Fdocs\u002Fdefinitions\u002Fredactors","docs\u002F3.definitions\u002F11.redactors",{"title":92,"path":93,"stem":94},"Catalog","\u002Fdocs\u002Fdefinitions\u002Fcatalog","docs\u002F3.definitions\u002F12.catalog",{"title":96,"path":97,"stem":98},"More definitions","\u002Fdocs\u002Fdefinitions\u002Fmore","docs\u002F3.definitions\u002F13.more",{"title":100,"icon":101,"path":102,"stem":103,"children":104,"page":22},"Features","i-lucide-layers","\u002Fdocs\u002Ffeatures","docs\u002F4.features",[105,109,112,116,120,124],{"title":106,"path":107,"stem":108},"Tasks","\u002Fdocs\u002Ffeatures\u002Ftasks","docs\u002F4.features\u002F1.tasks",{"title":80,"path":110,"stem":111},"\u002Fdocs\u002Ffeatures\u002Fstatus-page","docs\u002F4.features\u002F2.status-page",{"title":113,"path":114,"stem":115},"Alerts and notifications","\u002Fdocs\u002Ffeatures\u002Falerts","docs\u002F4.features\u002F3.alerts",{"title":117,"path":118,"stem":119},"MCP","\u002Fdocs\u002Ffeatures\u002Fmcp","docs\u002F4.features\u002F4.mcp",{"title":121,"path":122,"stem":123},"Releases","\u002Fdocs\u002Ffeatures\u002Freleases","docs\u002F4.features\u002F5.releases",{"title":125,"path":126,"stem":127},"Ask Vigie","\u002Fdocs\u002Ffeatures\u002Fask-vigie","docs\u002F4.features\u002F6.ask-vigie",{"title":129,"icon":130,"path":131,"stem":132,"children":133,"page":22},"Self-hosting","i-lucide-server","\u002Fdocs\u002Fself-hosting","docs\u002F5.self-hosting",[134,138,142,146],{"title":135,"path":136,"stem":137},"Deploy","\u002Fdocs\u002Fself-hosting\u002Fdeploy","docs\u002F5.self-hosting\u002F1.deploy",{"title":139,"path":140,"stem":141},"Configuration","\u002Fdocs\u002Fself-hosting\u002Fconfiguration","docs\u002F5.self-hosting\u002F2.configuration",{"title":143,"path":144,"stem":145},"Security","\u002Fdocs\u002Fself-hosting\u002Fsecurity","docs\u002F5.self-hosting\u002F3.security",{"title":147,"path":148,"stem":149},"Backups and retention","\u002Fdocs\u002Fself-hosting\u002Fbackups","docs\u002F5.self-hosting\u002F4.backups",{"id":151,"title":38,"body":152,"description":1475,"extension":1476,"links":1477,"meta":1478,"navigation":799,"path":39,"seo":1479,"stem":40,"__hash__":1480},"docs\u002Fdocs\u002F2.connect\u002F3.any-stack.md",{"type":153,"value":154,"toc":1467},"minimark",[155,164,169,212,223,226,230,233,546,549,581,585,748,758,762,1179,1183,1298,1302,1355,1438,1444,1463],[156,157,158,159,163],"p",{},"Vigie has no SDK of its own to install. It reads standard OpenTelemetry over OTLP\u002FHTTP, so anything that can export OTLP can send to it: the official SDKs in Node, Python, Go, Java, .NET, Ruby or PHP, an OpenTelemetry Collector, or a ",[160,161,162],"code",{},"curl",".",[165,166,168],"h2",{"id":167},"where-to-send","Where to send",[170,171,172,185],"table",{},[173,174,175],"thead",{},[176,177,178,182],"tr",{},[179,180,181],"th",{},"Endpoint",[179,183,184],{},"When",[186,187,188,202],"tbody",{},[176,189,190,196],{},[191,192,193],"td",{},[160,194,195],{},"\u003CVIGIE_URL>\u002Fotlp",[191,197,198,199,163],{},"One URL for everything, behind HTTPS. Set it as ",[160,200,201],{},"OTEL_EXPORTER_OTLP_ENDPOINT",[176,203,204,209],{},[191,205,206],{},[160,207,208],{},"http:\u002F\u002Flocalhost:4318",[191,210,211],{},"The ingest port, on your machine.",[156,213,214,215,219,220,163],{},"On a server, add the ingest key from ",[216,217,218],"strong",{},"Settings, Tokens",": ",[160,221,222],{},"OTEL_EXPORTER_OTLP_HEADERS=\"authorization=Bearer vk_…\"",[156,224,225],{},"Traces and metrics need nothing else. Logs become useful once they carry a few agreed names.",[165,227,229],{"id":228},"the-wide-event-contract","The wide-event contract",[156,231,232],{},"A wide event is one log record per unit of work. Vigie reads its attributes, dotted or nested:",[170,234,235,248],{},[173,236,237],{},[176,238,239,242,245],{},[179,240,241],{},"Attribute",[179,243,244],{},"Makes it",[179,246,247],{},"Example",[186,249,250,268,283,298,313,328,355,370,388,403,420,441,462,477,509,528],{},[176,251,252,257,263],{},[191,253,254],{},[160,255,256],{},"method",[191,258,259,260],{},"a ",[216,261,262],{},"request",[191,264,265],{},[160,266,267],{},"POST",[176,269,270,275,278],{},[191,271,272],{},[160,273,274],{},"path",[191,276,277],{},"the URL path as called",[191,279,280],{},[160,281,282],{},"\u002Forders\u002Fo_81\u002Fcheckout",[176,284,285,290,293],{},[191,286,287],{},[160,288,289],{},"route.pattern",[191,291,292],{},"the route as written in code, to group requests",[191,294,295],{},[160,296,297],{},"\u002Forders\u002F:id\u002Fcheckout",[176,299,300,305,308],{},[191,301,302],{},[160,303,304],{},"status",[191,306,307],{},"the response status",[191,309,310],{},[160,311,312],{},"201",[176,314,315,320,323],{},[191,316,317],{},[160,318,319],{},"durationMs",[191,321,322],{},"how long it took",[191,324,325],{},[160,326,327],{},"42",[176,329,330,335,351],{},[191,331,332],{},[160,333,334],{},"outcome",[191,336,337,340,341,340,344,347,348],{},[160,338,339],{},"succeeded",", ",[160,342,343],{},"failed",[160,345,346],{},"denied"," or ",[160,349,350],{},"skipped",[191,352,353],{},[160,354,343],{},[176,356,357,362,365],{},[191,358,359],{},[160,360,361],{},"reason",[191,363,364],{},"a short code for why it failed",[191,366,367],{},[160,368,369],{},"CART_EMPTY",[176,371,372,380,383],{},[191,373,374,340,377],{},[160,375,376],{},"why",[160,378,379],{},"fix",[191,381,382],{},"one sentence each, shown on the issue",[191,384,385],{},[160,386,387],{},"The cart has no items.",[176,389,390,395,398],{},[191,391,392],{},[160,393,394],{},"user.id",[191,396,397],{},"who did it",[191,399,400],{},[160,401,402],{},"u_12",[176,404,405,410,415],{},[191,406,407],{},[160,408,409],{},"task.kind",[191,411,259,412],{},[216,413,414],{},"task attempt",[191,416,417],{},[160,418,419],{},"emails.send",[176,421,422,430,433],{},[191,423,424,340,427],{},[160,425,426],{},"task.id",[160,428,429],{},"task.attempt",[191,431,432],{},"which run, which try",[191,434,435,340,438],{},[160,436,437],{},"job-81",[160,439,440],{},"2",[176,442,443,451,454],{},[191,444,445,340,448],{},[160,446,447],{},"task.queue",[160,449,450],{},"task.waitMs",[191,452,453],{},"where it waited, and how long",[191,455,456,340,459],{},[160,457,458],{},"emails",[160,460,461],{},"120",[176,463,464,469,472],{},[191,465,466],{},[160,467,468],{},"task.integration",[191,470,471],{},"the provider it talks to",[191,473,474],{},[160,475,476],{},"postwing",[176,478,479,487,502],{},[191,480,481,340,484],{},[160,482,483],{},"taskOutcome.type",[160,485,486],{},"taskOutcome.code",[191,488,489,340,492,340,495,347,498,501],{},[160,490,491],{},"SUCCEEDED",[160,493,494],{},"FAILED",[160,496,497],{},"SKIPPED",[160,499,500],{},"RETRY",", and why",[191,503,504,340,506],{},[160,505,497],{},[160,507,508],{},"UNSUBSCRIBED",[176,510,511,516,523],{},[191,512,513],{},[160,514,515],{},"operation",[191,517,518,519,522],{},"any ",[216,520,521],{},"other unit of work",": a cron, a script",[191,524,525],{},[160,526,527],{},"reports.nightly",[176,529,530,541,544],{},[191,531,532,340,535,340,538],{},[160,533,534],{},"error.name",[160,536,537],{},"error.message",[160,539,540],{},"error.stack",[191,542,543],{},"the error behind a failure",[191,545],{},[156,547,548],{},"Put the record's trace id in the log record itself, as every OpenTelemetry SDK does, and the event opens on its trace.",[156,550,551,552,555,556,559,560,340,563,340,566,340,569,572,573,576,577,580],{},"Two gauges feed the task backlog: ",[160,553,554],{},"vigie.tasks.backlog"," with a ",[160,557,558],{},"task.state"," attribute (",[160,561,562],{},"due",[160,564,565],{},"scheduled",[160,567,568],{},"running",[160,570,571],{},"held",") and ",[160,574,575],{},"vigie.tasks.oldest_due_age"," in seconds. If your app already sends them under another prefix, set ",[160,578,579],{},"VIGIE_TASK_METRICS"," to it.",[165,582,584],{"id":583},"try-it-with-curl","Try it with curl",[586,587,592],"pre",{"className":588,"code":589,"language":590,"meta":591,"style":591},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","curl -X POST http:\u002F\u002Flocalhost:4318\u002Fv1\u002Flogs -H 'content-type: application\u002Fjson' -d '{\n  \"resourceLogs\": [{\n    \"resource\": { \"attributes\": [{ \"key\": \"service.name\", \"value\": { \"stringValue\": \"shop-api\" } }] },\n    \"scopeLogs\": [{ \"logRecords\": [{\n      \"timeUnixNano\": \"'$(date +%s)000000000'\",\n      \"body\": { \"stringValue\": \"POST \u002Forders 201\" },\n      \"attributes\": [\n        { \"key\": \"method\", \"value\": { \"stringValue\": \"POST\" } },\n        { \"key\": \"route.pattern\", \"value\": { \"stringValue\": \"\u002Forders\" } },\n        { \"key\": \"status\", \"value\": { \"intValue\": \"201\" } },\n        { \"key\": \"durationMs\", \"value\": { \"doubleValue\": 42 } },\n        { \"key\": \"outcome\", \"value\": { \"stringValue\": \"succeeded\" } }\n      ]\n    }]}]\n  }]\n}'\n","bash","",[160,593,594,633,639,645,651,679,685,691,697,703,709,715,721,727,733,739],{"__ignoreMap":591},[595,596,599,602,606,609,612,615,619,622,625,628,630],"span",{"class":597,"line":598},"line",1,[595,600,162],{"class":601},"sBMFI",[595,603,605],{"class":604},"sfazB"," -X",[595,607,608],{"class":604}," POST",[595,610,611],{"class":604}," http:\u002F\u002Flocalhost:4318\u002Fv1\u002Flogs",[595,613,614],{"class":604}," -H",[595,616,618],{"class":617},"sMK4o"," '",[595,620,621],{"class":604},"content-type: application\u002Fjson",[595,623,624],{"class":617},"'",[595,626,627],{"class":604}," -d",[595,629,618],{"class":617},[595,631,632],{"class":604},"{\n",[595,634,636],{"class":597,"line":635},2,[595,637,638],{"class":604},"  \"resourceLogs\": [{\n",[595,640,642],{"class":597,"line":641},3,[595,643,644],{"class":604},"    \"resource\": { \"attributes\": [{ \"key\": \"service.name\", \"value\": { \"stringValue\": \"shop-api\" } }] },\n",[595,646,648],{"class":597,"line":647},4,[595,649,650],{"class":604},"    \"scopeLogs\": [{ \"logRecords\": [{\n",[595,652,654,657,659,662,665,668,671,674,676],{"class":597,"line":653},5,[595,655,656],{"class":604},"      \"timeUnixNano\": \"",[595,658,624],{"class":617},[595,660,661],{"class":617},"$(",[595,663,664],{"class":601},"date",[595,666,667],{"class":604}," +%s",[595,669,670],{"class":617},")",[595,672,673],{"class":604},"000000000",[595,675,624],{"class":617},[595,677,678],{"class":604},"\",\n",[595,680,682],{"class":597,"line":681},6,[595,683,684],{"class":604},"      \"body\": { \"stringValue\": \"POST \u002Forders 201\" },\n",[595,686,688],{"class":597,"line":687},7,[595,689,690],{"class":604},"      \"attributes\": [\n",[595,692,694],{"class":597,"line":693},8,[595,695,696],{"class":604},"        { \"key\": \"method\", \"value\": { \"stringValue\": \"POST\" } },\n",[595,698,700],{"class":597,"line":699},9,[595,701,702],{"class":604},"        { \"key\": \"route.pattern\", \"value\": { \"stringValue\": \"\u002Forders\" } },\n",[595,704,706],{"class":597,"line":705},10,[595,707,708],{"class":604},"        { \"key\": \"status\", \"value\": { \"intValue\": \"201\" } },\n",[595,710,712],{"class":597,"line":711},11,[595,713,714],{"class":604},"        { \"key\": \"durationMs\", \"value\": { \"doubleValue\": 42 } },\n",[595,716,718],{"class":597,"line":717},12,[595,719,720],{"class":604},"        { \"key\": \"outcome\", \"value\": { \"stringValue\": \"succeeded\" } }\n",[595,722,724],{"class":597,"line":723},13,[595,725,726],{"class":604},"      ]\n",[595,728,730],{"class":597,"line":729},14,[595,731,732],{"class":604},"    }]}]\n",[595,734,736],{"class":597,"line":735},15,[595,737,738],{"class":604},"  }]\n",[595,740,742,745],{"class":597,"line":741},16,[595,743,744],{"class":604},"}",[595,746,747],{"class":617},"'\n",[156,749,750,751,754,755,163],{},"Open ",[216,752,753],{},"Logs",": it is there as a request, ",[160,756,757],{},"POST \u002Forders 201 in 42 ms",[165,759,761],{"id":760},"node-with-the-opentelemetry-sdk","Node, with the OpenTelemetry SDK",[586,763,767],{"className":764,"code":765,"language":766,"meta":591,"style":591},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { logs } from '@opentelemetry\u002Fapi-logs'\n\nconst logger = logs.getLogger('http')\n\napp.use((req, res, next) => {\n  const started = performance.now()\n  res.on('finish', () => {\n    logger.emit({\n      body: `${req.method} ${req.path} ${res.statusCode}`,\n      attributes: {\n        method: req.method,\n        path: req.path,\n        'route.pattern': req.route?.path,\n        status: res.statusCode,\n        durationMs: Math.round(performance.now() - started),\n        outcome: res.statusCode >= 400 ? 'failed' : 'succeeded',\n      },\n    })\n  })\n  next()\n})\n","ts",[160,768,769,795,801,834,838,875,898,926,940,986,995,1011,1026,1051,1066,1102,1142,1148,1156,1164,1172],{"__ignoreMap":591},[595,770,771,775,778,782,785,788,790,793],{"class":597,"line":598},[595,772,774],{"class":773},"s7zQu","import",[595,776,777],{"class":617}," {",[595,779,781],{"class":780},"sTEyZ"," logs",[595,783,784],{"class":617}," }",[595,786,787],{"class":773}," from",[595,789,618],{"class":617},[595,791,792],{"class":604},"@opentelemetry\u002Fapi-logs",[595,794,747],{"class":617},[595,796,797],{"class":597,"line":635},[595,798,800],{"emptyLinePlaceholder":799},true,"\n",[595,802,803,807,810,813,815,817,821,824,826,829,831],{"class":597,"line":641},[595,804,806],{"class":805},"spNyl","const",[595,808,809],{"class":780}," logger ",[595,811,812],{"class":617},"=",[595,814,781],{"class":780},[595,816,163],{"class":617},[595,818,820],{"class":819},"s2Zo4","getLogger",[595,822,823],{"class":780},"(",[595,825,624],{"class":617},[595,827,828],{"class":604},"http",[595,830,624],{"class":617},[595,832,833],{"class":780},")\n",[595,835,836],{"class":597,"line":647},[595,837,800],{"emptyLinePlaceholder":799},[595,839,840,843,845,848,850,852,856,859,862,864,867,869,872],{"class":597,"line":653},[595,841,842],{"class":780},"app",[595,844,163],{"class":617},[595,846,847],{"class":819},"use",[595,849,823],{"class":780},[595,851,823],{"class":617},[595,853,855],{"class":854},"sHdIc","req",[595,857,858],{"class":617},",",[595,860,861],{"class":854}," res",[595,863,858],{"class":617},[595,865,866],{"class":854}," next",[595,868,670],{"class":617},[595,870,871],{"class":805}," =>",[595,873,874],{"class":617}," {\n",[595,876,877,880,883,886,889,891,894],{"class":597,"line":681},[595,878,879],{"class":805},"  const",[595,881,882],{"class":780}," started",[595,884,885],{"class":617}," =",[595,887,888],{"class":780}," performance",[595,890,163],{"class":617},[595,892,893],{"class":819},"now",[595,895,897],{"class":896},"swJcz","()\n",[595,899,900,903,905,908,910,912,915,917,919,922,924],{"class":597,"line":687},[595,901,902],{"class":780},"  res",[595,904,163],{"class":617},[595,906,907],{"class":819},"on",[595,909,823],{"class":896},[595,911,624],{"class":617},[595,913,914],{"class":604},"finish",[595,916,624],{"class":617},[595,918,858],{"class":617},[595,920,921],{"class":617}," ()",[595,923,871],{"class":805},[595,925,874],{"class":617},[595,927,928,931,933,936,938],{"class":597,"line":693},[595,929,930],{"class":780},"    logger",[595,932,163],{"class":617},[595,934,935],{"class":819},"emit",[595,937,823],{"class":896},[595,939,632],{"class":617},[595,941,942,945,948,951,953,955,957,959,962,964,966,968,970,972,975,977,980,983],{"class":597,"line":699},[595,943,944],{"class":896},"      body",[595,946,947],{"class":617},":",[595,949,950],{"class":617}," `${",[595,952,855],{"class":780},[595,954,163],{"class":617},[595,956,256],{"class":780},[595,958,744],{"class":617},[595,960,961],{"class":617}," ${",[595,963,855],{"class":780},[595,965,163],{"class":617},[595,967,274],{"class":780},[595,969,744],{"class":617},[595,971,961],{"class":617},[595,973,974],{"class":780},"res",[595,976,163],{"class":617},[595,978,979],{"class":780},"statusCode",[595,981,982],{"class":617},"}`",[595,984,985],{"class":617},",\n",[595,987,988,991,993],{"class":597,"line":705},[595,989,990],{"class":896},"      attributes",[595,992,947],{"class":617},[595,994,874],{"class":617},[595,996,997,1000,1002,1005,1007,1009],{"class":597,"line":711},[595,998,999],{"class":896},"        method",[595,1001,947],{"class":617},[595,1003,1004],{"class":780}," req",[595,1006,163],{"class":617},[595,1008,256],{"class":780},[595,1010,985],{"class":617},[595,1012,1013,1016,1018,1020,1022,1024],{"class":597,"line":717},[595,1014,1015],{"class":896},"        path",[595,1017,947],{"class":617},[595,1019,1004],{"class":780},[595,1021,163],{"class":617},[595,1023,274],{"class":780},[595,1025,985],{"class":617},[595,1027,1028,1031,1033,1035,1037,1039,1041,1044,1047,1049],{"class":597,"line":723},[595,1029,1030],{"class":617},"        '",[595,1032,289],{"class":896},[595,1034,624],{"class":617},[595,1036,947],{"class":617},[595,1038,1004],{"class":780},[595,1040,163],{"class":617},[595,1042,1043],{"class":780},"route",[595,1045,1046],{"class":617},"?.",[595,1048,274],{"class":780},[595,1050,985],{"class":617},[595,1052,1053,1056,1058,1060,1062,1064],{"class":597,"line":729},[595,1054,1055],{"class":896},"        status",[595,1057,947],{"class":617},[595,1059,861],{"class":780},[595,1061,163],{"class":617},[595,1063,979],{"class":780},[595,1065,985],{"class":617},[595,1067,1068,1071,1073,1076,1078,1081,1083,1086,1088,1090,1093,1096,1098,1100],{"class":597,"line":735},[595,1069,1070],{"class":896},"        durationMs",[595,1072,947],{"class":617},[595,1074,1075],{"class":780}," Math",[595,1077,163],{"class":617},[595,1079,1080],{"class":819},"round",[595,1082,823],{"class":896},[595,1084,1085],{"class":780},"performance",[595,1087,163],{"class":617},[595,1089,893],{"class":819},[595,1091,1092],{"class":896},"() ",[595,1094,1095],{"class":617},"-",[595,1097,882],{"class":780},[595,1099,670],{"class":896},[595,1101,985],{"class":617},[595,1103,1104,1107,1109,1111,1113,1115,1118,1122,1125,1127,1129,1131,1134,1136,1138,1140],{"class":597,"line":741},[595,1105,1106],{"class":896},"        outcome",[595,1108,947],{"class":617},[595,1110,861],{"class":780},[595,1112,163],{"class":617},[595,1114,979],{"class":780},[595,1116,1117],{"class":617}," >=",[595,1119,1121],{"class":1120},"sbssI"," 400",[595,1123,1124],{"class":617}," ?",[595,1126,618],{"class":617},[595,1128,343],{"class":604},[595,1130,624],{"class":617},[595,1132,1133],{"class":617}," :",[595,1135,618],{"class":617},[595,1137,339],{"class":604},[595,1139,624],{"class":617},[595,1141,985],{"class":617},[595,1143,1145],{"class":597,"line":1144},17,[595,1146,1147],{"class":617},"      },\n",[595,1149,1151,1154],{"class":597,"line":1150},18,[595,1152,1153],{"class":617},"    }",[595,1155,833],{"class":896},[595,1157,1159,1162],{"class":597,"line":1158},19,[595,1160,1161],{"class":617},"  }",[595,1163,833],{"class":896},[595,1165,1167,1170],{"class":597,"line":1166},20,[595,1168,1169],{"class":819},"  next",[595,1171,897],{"class":896},[595,1173,1175,1177],{"class":597,"line":1174},21,[595,1176,744],{"class":617},[595,1178,833],{"class":780},[165,1180,1182],{"id":1181},"python","Python",[586,1184,1187],{"className":1185,"code":1186,"language":1181,"meta":591,"style":591},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import logging, time\nfrom opentelemetry.sdk._logs import LoggerProvider, LoggingHandler\nfrom opentelemetry.sdk._logs.export import BatchLogRecordProcessor\nfrom opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter\n\nprovider = LoggerProvider()\nprovider.add_log_record_processor(BatchLogRecordProcessor(OTLPLogExporter()))\nlog = logging.getLogger(\"http\")\nlog.addHandler(LoggingHandler(logger_provider=provider))\n\n@app.middleware(\"http\")\nasync def wide_event(request, call_next):\n    started = time.perf_counter()\n    response = await call_next(request)\n    log.info(f\"{request.method} {request.url.path} {response.status_code}\", extra={\n        \"method\": request.method,\n        \"path\": request.url.path,\n        \"status\": response.status_code,\n        \"durationMs\": round((time.perf_counter() - started) * 1000),\n        \"outcome\": \"failed\" if response.status_code >= 400 else \"succeeded\",\n    })\n    return response\n",[160,1188,1189,1194,1199,1204,1209,1213,1218,1223,1228,1233,1237,1242,1247,1252,1257,1262,1267,1272,1277,1282,1287,1292],{"__ignoreMap":591},[595,1190,1191],{"class":597,"line":598},[595,1192,1193],{},"import logging, time\n",[595,1195,1196],{"class":597,"line":635},[595,1197,1198],{},"from opentelemetry.sdk._logs import LoggerProvider, LoggingHandler\n",[595,1200,1201],{"class":597,"line":641},[595,1202,1203],{},"from opentelemetry.sdk._logs.export import BatchLogRecordProcessor\n",[595,1205,1206],{"class":597,"line":647},[595,1207,1208],{},"from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter\n",[595,1210,1211],{"class":597,"line":653},[595,1212,800],{"emptyLinePlaceholder":799},[595,1214,1215],{"class":597,"line":681},[595,1216,1217],{},"provider = LoggerProvider()\n",[595,1219,1220],{"class":597,"line":687},[595,1221,1222],{},"provider.add_log_record_processor(BatchLogRecordProcessor(OTLPLogExporter()))\n",[595,1224,1225],{"class":597,"line":693},[595,1226,1227],{},"log = logging.getLogger(\"http\")\n",[595,1229,1230],{"class":597,"line":699},[595,1231,1232],{},"log.addHandler(LoggingHandler(logger_provider=provider))\n",[595,1234,1235],{"class":597,"line":705},[595,1236,800],{"emptyLinePlaceholder":799},[595,1238,1239],{"class":597,"line":711},[595,1240,1241],{},"@app.middleware(\"http\")\n",[595,1243,1244],{"class":597,"line":717},[595,1245,1246],{},"async def wide_event(request, call_next):\n",[595,1248,1249],{"class":597,"line":723},[595,1250,1251],{},"    started = time.perf_counter()\n",[595,1253,1254],{"class":597,"line":729},[595,1255,1256],{},"    response = await call_next(request)\n",[595,1258,1259],{"class":597,"line":735},[595,1260,1261],{},"    log.info(f\"{request.method} {request.url.path} {response.status_code}\", extra={\n",[595,1263,1264],{"class":597,"line":741},[595,1265,1266],{},"        \"method\": request.method,\n",[595,1268,1269],{"class":597,"line":1144},[595,1270,1271],{},"        \"path\": request.url.path,\n",[595,1273,1274],{"class":597,"line":1150},[595,1275,1276],{},"        \"status\": response.status_code,\n",[595,1278,1279],{"class":597,"line":1158},[595,1280,1281],{},"        \"durationMs\": round((time.perf_counter() - started) * 1000),\n",[595,1283,1284],{"class":597,"line":1166},[595,1285,1286],{},"        \"outcome\": \"failed\" if response.status_code >= 400 else \"succeeded\",\n",[595,1288,1289],{"class":597,"line":1174},[595,1290,1291],{},"    })\n",[595,1293,1295],{"class":597,"line":1294},22,[595,1296,1297],{},"    return response\n",[165,1299,1301],{"id":1300},"go","Go",[586,1303,1306],{"className":1304,"code":1305,"language":1300,"meta":591,"style":591},"language-go shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","type statusRecorder struct {\n    http.ResponseWriter\n    status int\n}\n\nfunc (r *statusRecorder) WriteHeader(code int) { r.status = code; r.ResponseWriter.WriteHeader(code) }\n\nvar logger = global.GetLoggerProvider().Logger(\"http\")\n\n\u002F\u002F drop-in: wrap your mux with wideEvent(mux)\n",[160,1307,1308,1313,1318,1323,1328,1332,1337,1341,1346,1350],{"__ignoreMap":591},[595,1309,1310],{"class":597,"line":598},[595,1311,1312],{},"type statusRecorder struct {\n",[595,1314,1315],{"class":597,"line":635},[595,1316,1317],{},"    http.ResponseWriter\n",[595,1319,1320],{"class":597,"line":641},[595,1321,1322],{},"    status int\n",[595,1324,1325],{"class":597,"line":647},[595,1326,1327],{},"}\n",[595,1329,1330],{"class":597,"line":653},[595,1331,800],{"emptyLinePlaceholder":799},[595,1333,1334],{"class":597,"line":681},[595,1335,1336],{},"func (r *statusRecorder) WriteHeader(code int) { r.status = code; r.ResponseWriter.WriteHeader(code) }\n",[595,1338,1339],{"class":597,"line":687},[595,1340,800],{"emptyLinePlaceholder":799},[595,1342,1343],{"class":597,"line":693},[595,1344,1345],{},"var logger = global.GetLoggerProvider().Logger(\"http\")\n",[595,1347,1348],{"class":597,"line":699},[595,1349,800],{"emptyLinePlaceholder":799},[595,1351,1352],{"class":597,"line":705},[595,1353,1354],{},"\u002F\u002F drop-in: wrap your mux with wideEvent(mux)\n",[586,1356,1358],{"className":1304,"code":1357,"language":1300,"meta":591,"style":591},"func wideEvent(next http.Handler) http.Handler {\n    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n        started := time.Now()\n        rec := &statusRecorder{ResponseWriter: w, status: 200}\n        next.ServeHTTP(rec, r)\n        var record log.Record\n        record.SetBody(log.StringValue(fmt.Sprintf(\"%s %s %d\", r.Method, r.URL.Path, rec.status)))\n        record.AddAttributes(\n            log.String(\"method\", r.Method),\n            log.String(\"path\", r.URL.Path),\n            log.Int(\"status\", rec.status),\n            log.Int64(\"durationMs\", time.Since(started).Milliseconds()),\n        )\n        logger.Emit(r.Context(), record)\n    })\n}\n",[160,1359,1360,1365,1370,1375,1380,1385,1390,1395,1400,1405,1410,1415,1420,1425,1430,1434],{"__ignoreMap":591},[595,1361,1362],{"class":597,"line":598},[595,1363,1364],{},"func wideEvent(next http.Handler) http.Handler {\n",[595,1366,1367],{"class":597,"line":635},[595,1368,1369],{},"    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n",[595,1371,1372],{"class":597,"line":641},[595,1373,1374],{},"        started := time.Now()\n",[595,1376,1377],{"class":597,"line":647},[595,1378,1379],{},"        rec := &statusRecorder{ResponseWriter: w, status: 200}\n",[595,1381,1382],{"class":597,"line":653},[595,1383,1384],{},"        next.ServeHTTP(rec, r)\n",[595,1386,1387],{"class":597,"line":681},[595,1388,1389],{},"        var record log.Record\n",[595,1391,1392],{"class":597,"line":687},[595,1393,1394],{},"        record.SetBody(log.StringValue(fmt.Sprintf(\"%s %s %d\", r.Method, r.URL.Path, rec.status)))\n",[595,1396,1397],{"class":597,"line":693},[595,1398,1399],{},"        record.AddAttributes(\n",[595,1401,1402],{"class":597,"line":699},[595,1403,1404],{},"            log.String(\"method\", r.Method),\n",[595,1406,1407],{"class":597,"line":705},[595,1408,1409],{},"            log.String(\"path\", r.URL.Path),\n",[595,1411,1412],{"class":597,"line":711},[595,1413,1414],{},"            log.Int(\"status\", rec.status),\n",[595,1416,1417],{"class":597,"line":717},[595,1418,1419],{},"            log.Int64(\"durationMs\", time.Since(started).Milliseconds()),\n",[595,1421,1422],{"class":597,"line":723},[595,1423,1424],{},"        )\n",[595,1426,1427],{"class":597,"line":729},[595,1428,1429],{},"        logger.Emit(r.Context(), record)\n",[595,1431,1432],{"class":597,"line":735},[595,1433,1291],{},[595,1435,1436],{"class":597,"line":741},[595,1437,1327],{},[156,1439,1440,1441,1443],{},"Every snippet reads the endpoint from ",[160,1442,201],{},", as the SDKs do.",[1445,1446,1447,1448,1455,1456,1458,1459,1462],"tip",{},"In Node, ",[1449,1450,1454],"a",{"href":1451,"rel":1452},"https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fevlog",[1453],"nofollow","evlog"," builds wide events for Express, Hono, Fastify, Elysia and Next.js. Point its OTLP drain at ",[160,1457,195],{}," with ",[160,1460,1461],{},"recordShape: 'compact'",". The Adonis and NestJS packages use it underneath.",[1464,1465,1466],"style",{},"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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}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 .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":591,"searchDepth":635,"depth":635,"links":1468},[1469,1470,1471,1472,1473,1474],{"id":167,"depth":635,"text":168},{"id":228,"depth":635,"text":229},{"id":583,"depth":635,"text":584},{"id":760,"depth":635,"text":761},{"id":1181,"depth":635,"text":1182},{"id":1300,"depth":635,"text":1301},"Vigie reads plain OpenTelemetry. Any language works, and a few attribute names turn a log record into a request or a task.","md",null,{},{"title":38,"description":1475},"ifsFY0Xzr6DBQzbSIO9u9TQGLJUCOYuOwZdm-fz1pAg",[1482,1484],{"title":34,"path":35,"stem":36,"description":1483,"children":-1},"Send a NestJS app's requests, errors, traces and background jobs to Vigie with one command.",{"title":48,"path":49,"stem":50,"description":1485,"children":-1},"Everything specific to your app lives in definitions\u002F, as typed TypeScript that reloads when you save and deploys with your app.",1795043962290]