[{"data":1,"prerenderedAt":729},["ShallowReactive",2],{"figure-telemetry":3,"menu-audits":6,"menu-decisions":7,"menu-projects":23,"menu-workflows":99,"project-tab-workflows":116,"project-readme-observability":136},{"value":4,"alert":5},"18%",false,[],[8,11,14,17,20],{"label":9,"to":10},"0041 The visitor view becomes its own app, and the portal reads only as a developer platform","\u002Fdecisions\u002F0041-personal-site-splits-from-developer-portal",{"label":12,"to":13},"0040 Visitors land on the front page and toggle to the developer view","\u002Fdecisions\u002F0040-developer-portal-visitor-structure",{"label":15,"to":16},"0039 The developer portal is redesigned for visitors, from a twelve-site benchmark","\u002Fdecisions\u002F0039-developer-portal-benchmark",{"label":18,"to":19},"0038 Marina Roustan's discovery","\u002Fdecisions\u002F0038-marina-roustan-discovery",{"label":21,"to":22},"0013 New linters: the robustness gap is tsconfig and enforcement, not plugins","\u002Fdecisions\u002F0013-linter-coverage",[24,29,60,83],{"labelKey":25,"icon":26,"to":27,"badge":28},"app.menu.allProjects","i-lucide-layers","\u002Fprojects","11",{"labelKey":30,"icon":31,"to":32,"badge":33,"children":34},"app.menu.kinds.apps","i-lucide-app-window","\u002Fprojects?kind=apps","5",[35,40,45,50,55],{"label":36,"icon":31,"to":37,"badge":38,"coverage":39},"developer-portal","\u002Fprojects\u002Fdeveloper-portal","94%",94.37,{"label":41,"icon":31,"to":42,"badge":43,"coverage":44},"huella-legal","\u002Fprojects\u002Fhuella-legal","97%",97.48,{"label":46,"icon":31,"to":47,"badge":48,"coverage":49},"marina-roustan","\u002Fprojects\u002Fmarina-roustan","100%",100,{"label":51,"icon":31,"to":52,"badge":53,"coverage":54},"portfolio","\u002Fprojects\u002Fportfolio","91%",91.31,{"label":56,"icon":31,"to":57,"badge":58,"coverage":59},"wp-editor","\u002Fprojects\u002Fwp-editor","50%",49.89,{"labelKey":61,"icon":62,"to":63,"badge":64,"children":65},"app.menu.kinds.packages","i-lucide-package","\u002Fprojects?kind=packages","4",[66,71,75,80],{"label":67,"icon":62,"to":68,"badge":69,"coverage":70},"configs","\u002Fprojects\u002Fconfigs","76%",75.7,{"label":72,"icon":62,"to":73,"badge":48,"coverage":74},"content","\u002Fprojects\u002Fcontent",99.58,{"label":76,"icon":62,"to":77,"badge":78,"coverage":79},"i18n","\u002Fprojects\u002Fi18n","99%",99.08,{"label":81,"icon":62,"to":82,"badge":48,"coverage":49},"observability","\u002Fprojects\u002Fobservability",{"labelKey":84,"icon":85,"to":86,"badge":87,"children":88},"app.menu.kinds.infrastructure","i-lucide-server","\u002Fprojects?kind=infrastructure","2",[89,94],{"label":90,"icon":85,"to":91,"badge":92,"coverage":93},"scripts","\u002Fprojects\u002Fscripts","79%",78.6,{"label":95,"icon":85,"to":96,"badge":97,"coverage":98},"translations","\u002Fprojects\u002Ftranslations","93%",93.33,[100,103,106,109,112],{"label":101,"to":102},"Huella Legal","\u002Fworkflows\u002Fhuella-legal",{"label":104,"to":105},"Marina Roustan","\u002Fworkflows\u002Fmarina-roustan",{"label":107,"to":108},"Developer portal front door","\u002Fworkflows\u002Fdeveloper-portal-front-door",{"label":110,"to":111},"Huella Legal editorial","\u002Fworkflows\u002Fhuella-legal-editorial",{"labelKey":113,"icon":114,"to":115},"app.menu.newProject","i-lucide-plus","\u002Fworkflows\u002Fnew",{"developer-portal":117,"huella-legal":123,"marina-roustan":132},[118],{"id":119,"title":107,"to":108,"percent":120,"done":121,"left":122},"developer-portal-front-door",94,15,1,[124,128],{"id":125,"title":110,"to":111,"percent":126,"done":126,"left":127},"huella-legal-editorial",0,11,{"id":41,"title":101,"to":102,"percent":129,"done":130,"left":131},91,43,4,[133],{"id":46,"title":104,"to":105,"percent":134,"done":127,"left":135},27,30,{"id":137,"title":138,"body":139,"description":149,"extension":722,"kind":723,"meta":724,"navigation":200,"path":725,"seo":726,"stem":727,"url":723,"verdict":723,"__hash__":728},"docs\u002Fpackages\u002Fobservability\u002FREADME.md","📦 @joinery\u002Fobservability",{"type":140,"value":141,"toc":717},"minimark",[142,146,150,352,497,525,530,553,589,597,601,667,671,713],[143,144,138],"h1",{"id":145},"joineryobservability",[147,148,149],"p",{},"Thin wrappers over Grafana Faro (browser) and the OpenTelemetry SDK (Node), so every app starts\ntelemetry the same way. Both land in Grafana Cloud's Tempo, so a browser span and the server span it\ncaused share a trace.",[151,152,157],"pre",{"className":153,"code":154,"language":155,"meta":156,"style":156},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","import { startWebTelemetry } from \"@joinery\u002Fobservability\";\n\nconst faro = startWebTelemetry({\n    url: \"\u003Cfaro-collector-url>\",\n    app: { name: \"@joinery\u002Fhuella-legal\", version: \"1.0.0\", environment: \"production\" },\n});\n\nfaro.api.pushError(new Error(\"boom\"));\n","ts","",[158,159,160,195,202,224,243,297,308,313],"code",{"__ignoreMap":156},[161,162,164,168,172,176,179,182,185,189,192],"span",{"class":163,"line":122},"line",[161,165,167],{"class":166},"s7zQu","import",[161,169,171],{"class":170},"sMK4o"," {",[161,173,175],{"class":174},"sTEyZ"," startWebTelemetry",[161,177,178],{"class":170}," }",[161,180,181],{"class":166}," from",[161,183,184],{"class":170}," \"",[161,186,188],{"class":187},"sfazB","@joinery\u002Fobservability",[161,190,191],{"class":170},"\"",[161,193,194],{"class":170},";\n",[161,196,198],{"class":163,"line":197},2,[161,199,201],{"emptyLinePlaceholder":200},true,"\n",[161,203,205,209,212,215,218,221],{"class":163,"line":204},3,[161,206,208],{"class":207},"spNyl","const",[161,210,211],{"class":174}," faro ",[161,213,214],{"class":170},"=",[161,216,175],{"class":217},"s2Zo4",[161,219,220],{"class":174},"(",[161,222,223],{"class":170},"{\n",[161,225,226,230,233,235,238,240],{"class":163,"line":131},[161,227,229],{"class":228},"swJcz","    url",[161,231,232],{"class":170},":",[161,234,184],{"class":170},[161,236,237],{"class":187},"\u003Cfaro-collector-url>",[161,239,191],{"class":170},[161,241,242],{"class":170},",\n",[161,244,246,249,251,253,256,258,260,263,265,268,271,273,275,278,280,282,285,287,289,292,294],{"class":163,"line":245},5,[161,247,248],{"class":228},"    app",[161,250,232],{"class":170},[161,252,171],{"class":170},[161,254,255],{"class":228}," name",[161,257,232],{"class":170},[161,259,184],{"class":170},[161,261,262],{"class":187},"@joinery\u002Fhuella-legal",[161,264,191],{"class":170},[161,266,267],{"class":170},",",[161,269,270],{"class":228}," version",[161,272,232],{"class":170},[161,274,184],{"class":170},[161,276,277],{"class":187},"1.0.0",[161,279,191],{"class":170},[161,281,267],{"class":170},[161,283,284],{"class":228}," environment",[161,286,232],{"class":170},[161,288,184],{"class":170},[161,290,291],{"class":187},"production",[161,293,191],{"class":170},[161,295,296],{"class":170}," },\n",[161,298,300,303,306],{"class":163,"line":299},6,[161,301,302],{"class":170},"}",[161,304,305],{"class":174},")",[161,307,194],{"class":170},[161,309,311],{"class":163,"line":310},7,[161,312,201],{"emptyLinePlaceholder":200},[161,314,316,319,322,325,327,330,332,335,338,340,342,345,347,350],{"class":163,"line":315},8,[161,317,318],{"class":174},"faro",[161,320,321],{"class":170},".",[161,323,324],{"class":174},"api",[161,326,321],{"class":170},[161,328,329],{"class":217},"pushError",[161,331,220],{"class":174},[161,333,334],{"class":170},"new",[161,336,337],{"class":217}," Error",[161,339,220],{"class":174},[161,341,191],{"class":170},[161,343,344],{"class":187},"boom",[161,346,191],{"class":170},[161,348,349],{"class":174},"))",[161,351,194],{"class":170},[151,353,355],{"className":153,"code":354,"language":155,"meta":156,"style":156},"import { startNodeTelemetry } from \"@joinery\u002Fobservability\u002Fnode\";\n\nconst provider = startNodeTelemetry({\n    url: \"\u003Cotlp-gateway-url>\",\n    instanceId: \"123456\",\n    token: \"glc_…\",\n    app: { name: \"@joinery\u002Fhuella-legal\", version: \"1.0.0\", environment: \"production\" },\n});\n",[158,356,357,379,383,398,413,429,445,489],{"__ignoreMap":156},[161,358,359,361,363,366,368,370,372,375,377],{"class":163,"line":122},[161,360,167],{"class":166},[161,362,171],{"class":170},[161,364,365],{"class":174}," startNodeTelemetry",[161,367,178],{"class":170},[161,369,181],{"class":166},[161,371,184],{"class":170},[161,373,374],{"class":187},"@joinery\u002Fobservability\u002Fnode",[161,376,191],{"class":170},[161,378,194],{"class":170},[161,380,381],{"class":163,"line":197},[161,382,201],{"emptyLinePlaceholder":200},[161,384,385,387,390,392,394,396],{"class":163,"line":204},[161,386,208],{"class":207},[161,388,389],{"class":174}," provider ",[161,391,214],{"class":170},[161,393,365],{"class":217},[161,395,220],{"class":174},[161,397,223],{"class":170},[161,399,400,402,404,406,409,411],{"class":163,"line":131},[161,401,229],{"class":228},[161,403,232],{"class":170},[161,405,184],{"class":170},[161,407,408],{"class":187},"\u003Cotlp-gateway-url>",[161,410,191],{"class":170},[161,412,242],{"class":170},[161,414,415,418,420,422,425,427],{"class":163,"line":245},[161,416,417],{"class":228},"    instanceId",[161,419,232],{"class":170},[161,421,184],{"class":170},[161,423,424],{"class":187},"123456",[161,426,191],{"class":170},[161,428,242],{"class":170},[161,430,431,434,436,438,441,443],{"class":163,"line":299},[161,432,433],{"class":228},"    token",[161,435,232],{"class":170},[161,437,184],{"class":170},[161,439,440],{"class":187},"glc_…",[161,442,191],{"class":170},[161,444,242],{"class":170},[161,446,447,449,451,453,455,457,459,461,463,465,467,469,471,473,475,477,479,481,483,485,487],{"class":163,"line":310},[161,448,248],{"class":228},[161,450,232],{"class":170},[161,452,171],{"class":170},[161,454,255],{"class":228},[161,456,232],{"class":170},[161,458,184],{"class":170},[161,460,262],{"class":187},[161,462,191],{"class":170},[161,464,267],{"class":170},[161,466,270],{"class":228},[161,468,232],{"class":170},[161,470,184],{"class":170},[161,472,277],{"class":187},[161,474,191],{"class":170},[161,476,267],{"class":170},[161,478,284],{"class":228},[161,480,232],{"class":170},[161,482,184],{"class":170},[161,484,291],{"class":187},[161,486,191],{"class":170},[161,488,296],{"class":170},[161,490,491,493,495],{"class":163,"line":315},[161,492,302],{"class":170},[161,494,305],{"class":174},[161,496,194],{"class":170},[147,498,499,500,507,508,514,515,518,519,524],{},"That's the whole package: ",[501,502,504],"a",{"href":503},"repo:packages\u002Fobservability\u002Fsrc\u002Findex.ts",[158,505,506],{},"src\u002Findex.ts"," and ",[501,509,511],{"href":510},"repo:packages\u002Fobservability\u002Fsrc\u002Fnode.ts",[158,512,513],{},"src\u002Fnode.ts",". The\ntwo entries must never import each other — one needs ",[158,516,517],{},"window",", the other Node built-ins.\n",[501,520,522],{"href":521},"\u002Fwiki\u002Fapps\u002Fhuella-legal\u002Freadme#observability",[158,523,262],{}," is the worked example.",[526,527,529],"h2",{"id":528},"what-you-get-for-free","What you get for free",[147,531,532,536,537,540,541,544,545,548,549,552],{},[533,534,535],"strong",{},"Browser."," ",[158,538,539],{},"getWebInstrumentations()"," covers errors, unhandled rejections, web vitals, console and\nsession tracking. ",[158,542,543],{},"TracingInstrumentation"," adds fetch\u002FXHR spans and registers a global OpenTelemetry\ntracer provider, so a caller that wants manual spans can install ",[158,546,547],{},"@opentelemetry\u002Fapi"," and use\n",[158,550,551],{},"trace.getTracer()"," without this package being involved.",[147,554,555,558,559,562,563,566,567,570,571,507,574,577,578,581,582,585,586,588],{},[533,556,557],{},"Server."," Outbound ",[158,560,561],{},"fetch"," spans (via undici) and ",[158,564,565],{},"traceparent"," propagation in both directions —\nan incoming header continues the browser's trace, an outgoing request carries ours. Every span is\nstamped with ",[158,568,569],{},"service.name",", ",[158,572,573],{},"service.version",[158,575,576],{},"deployment.environment.name"," from ",[158,579,580],{},"app",".\n",[158,583,584],{},"provider.register()"," installs the W3C propagator and the async context manager, so a caller can\n",[158,587,551],{}," and open its own spans without this package being involved.",[147,590,591,592,596],{},"The inbound span is ",[593,594,595],"em",{},"not"," included — see the gotcha below.",[526,598,600],{"id":599},"gotchas","Gotchas",[602,603,604,618,639,652,658],"ul",{},[605,606,607,610,611,613,614,617],"li",{},[533,608,609],{},"Browser only for the default entry."," Faro touches ",[158,612,517],{}," while initializing, so it must not\nrun during SSR — in Nuxt that means a ",[158,615,616],{},".client"," plugin.",[605,619,620,536,623,626,627,630,631,634,635,638],{},[533,621,622],{},"No inbound span. The caller opens it.",[158,624,625],{},"HttpInstrumentation"," can't patch ",[158,628,629],{},"node:http"," under ESM\nwithout a preload, and Nitro imports it before any plugin runs. Without a request span, outbound\nfetches become root traces — ",[501,632,41],{"href":633},"repo:apps\u002Fhuella-legal\u002Fserver\u002Fplugins\u002Fobservability.ts","\nwraps ",[158,636,637],{},"nitroApp.h3App.handler"," to open one.",[605,640,641,647,648,651],{},[533,642,643,646],{},[158,644,645],{},"app.version"," is the caller's to supply."," Telemetry stamped ",[158,649,650],{},"0.0.0"," cannot be attributed to a\nrelease.",[605,653,654,657],{},[533,655,656],{},"Stack traces arrive minified."," No app uploads source maps yet.",[605,659,660,663,664,666],{},[533,661,662],{},"The first page load's server trace stands alone",": a document navigation carries no\n",[158,665,565],{},". Everything fetched afterwards joins up.",[526,668,670],{"id":669},"known-gaps","Known gaps",[672,673,674,687],"table",{},[675,676,677],"thead",{},[678,679,680,684],"tr",{},[681,682,683],"th",{},"Gap",[681,685,686],{},"Note",[688,689,690,702],"tbody",{},[678,691,692,696],{},[693,694,695],"td",{},"Cross-origin propagation",[693,697,698,699],{},"Today every browser request is same-origin. Calling another origin needs Faro's ",[158,700,701],{},"propagateTraceHeaderCorsUrls",[678,703,704,707],{},[693,705,706],{},"No metrics",[693,708,709,710],{},"RED metrics can be derived from spans in Grafana; runtime metrics need a ",[158,711,712],{},"MeterProvider",[714,715,716],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .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 .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":156,"searchDepth":197,"depth":197,"links":718},[719,720,721],{"id":528,"depth":197,"text":529},{"id":599,"depth":197,"text":600},{"id":669,"depth":197,"text":670},"md",null,{},"\u002Fpackages\u002Fobservability\u002Freadme",{"title":138,"description":149},"packages\u002Fobservability\u002FREADME","-_RoSxXWJvECZfpfnlbBJmnPeVpn37EM85HWsub-M1M",1795478396021]