[{"data":1,"prerenderedAt":3572},["ShallowReactive",2],{"\u002Fguides\u002Fopentelemetry-nestjs-navigation":3,"\u002Fguides\u002Fopentelemetry-nestjs":208},[4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,200,204],{"title":5,"path":6,"stem":7},"Guides","\u002Fguides","guides\u002Findex",{"title":9,"path":10,"stem":11},"OpenTelemetry Beego monitoring [otelbeego]","\u002Fguides\u002Fopentelemetry-beego","guides\u002Fopentelemetry-beego",{"title":13,"path":14,"stem":15},"OpenTelemetry Celery Instrumentation Guide","\u002Fguides\u002Fopentelemetry-celery","guides\u002Fopentelemetry-celery",{"title":17,"path":18,"stem":19},"Instrumenting Go database\u002Fsql with OpenTelemetry [otelsql]","\u002Fguides\u002Fopentelemetry-database-sql","guides\u002Fopentelemetry-database-sql",{"title":21,"path":22,"stem":23},"OpenTelemetry Django: Traces, Metrics and Database Monitoring","\u002Fguides\u002Fopentelemetry-django","guides\u002Fopentelemetry-django",{"title":25,"path":26,"stem":27},"OpenTelemetry Docker Monitoring with Collector and Docker Stats","\u002Fguides\u002Fopentelemetry-docker","guides\u002Fopentelemetry-docker",{"title":29,"path":30,"stem":31},"OpenTelemetry Echo by Labstack [otelecho]","\u002Fguides\u002Fopentelemetry-echo","guides\u002Fopentelemetry-echo",{"title":33,"path":34,"stem":35},"OpenTelemetry Go Ent monitoring [otelent]","\u002Fguides\u002Fopentelemetry-ent","guides\u002Fopentelemetry-ent",{"title":37,"path":38,"stem":39},"OpenTelemetry Express.js instrumentation","\u002Fguides\u002Fopentelemetry-express","guides\u002Fopentelemetry-express",{"title":41,"path":42,"stem":43},"OpenTelemetry Falcon Instrumentation and Monitoring","\u002Fguides\u002Fopentelemetry-falcon","guides\u002Fopentelemetry-falcon",{"title":45,"path":46,"stem":47},"OpenTelemetry FastAPI Instrumentation and Monitoring","\u002Fguides\u002Fopentelemetry-fastapi","guides\u002Fopentelemetry-fastapi",{"title":49,"path":50,"stem":51},"OpenTelemetry Filelog Receiver","\u002Fguides\u002Fopentelemetry-filelog-receiver","guides\u002Fopentelemetry-filelog-receiver",{"title":53,"path":54,"stem":55},"OpenTelemetry Flask Instrumentation and Monitoring","\u002Fguides\u002Fopentelemetry-flask","guides\u002Fopentelemetry-flask",{"title":57,"path":58,"stem":59},"OpenTelemetry Gin Monitoring [otelgin]","\u002Fguides\u002Fopentelemetry-gin","guides\u002Fopentelemetry-gin",{"title":61,"path":62,"stem":63},"OpenTelemetry Golang gRPC monitoring [otelgrpc]","\u002Fguides\u002Fopentelemetry-go-grpc","guides\u002Fopentelemetry-go-grpc",{"title":65,"path":66,"stem":67},"OpenTelemetry Go AWS Lambda Instrumentation","\u002Fguides\u002Fopentelemetry-go-lambda","guides\u002Fopentelemetry-go-lambda",{"title":69,"path":70,"stem":71},"OpenTelemetry Go-Zero monitoring [otelzero]","\u002Fguides\u002Fopentelemetry-go-zero","guides\u002Fopentelemetry-go-zero",{"title":73,"path":74,"stem":75},"OpenTelemetry Gorilla Mux monitoring [otelmux]","\u002Fguides\u002Fopentelemetry-gorilla-mux","guides\u002Fopentelemetry-gorilla-mux",{"title":77,"path":78,"stem":79},"OpenTelemetry GORM monitoring [otelgorm]","\u002Fguides\u002Fopentelemetry-gorm","guides\u002Fopentelemetry-gorm",{"title":81,"path":82,"stem":83},"OpenTelemetry HTTPcheck Receiver","\u002Fguides\u002Fopentelemetry-httpcheck","guides\u002Fopentelemetry-httpcheck",{"title":85,"path":86,"stem":87},"OpenTelemetry Kubernetes Events Receiver [k8seventsreceiver]","\u002Fguides\u002Fopentelemetry-k8seventsreceiver","guides\u002Fopentelemetry-k8seventsreceiver",{"title":89,"path":90,"stem":91},"Kafka Monitoring with OpenTelemetry Collector","\u002Fguides\u002Fopentelemetry-kafka","guides\u002Fopentelemetry-kafka",{"title":93,"path":94,"stem":95},"OpenTelemetry Integration for Laravel: Full Guide","\u002Fguides\u002Fopentelemetry-laravel","guides\u002Fopentelemetry-laravel",{"title":97,"path":98,"stem":99},"OpenTelemetry Log4j logs [Java]","\u002Fguides\u002Fopentelemetry-log4j","guides\u002Fopentelemetry-log4j",{"title":101,"path":102,"stem":103},"OpenTelemetry Logback logging [Java]","\u002Fguides\u002Fopentelemetry-logback","guides\u002Fopentelemetry-logback",{"title":105,"path":106,"stem":107},"OpenTelemetry Logrus logs [otellogrus]","\u002Fguides\u002Fopentelemetry-logrus","guides\u002Fopentelemetry-logrus",{"title":109,"path":110,"stem":111},"OpenTelemetry MySQL Monitoring [step by step]","\u002Fguides\u002Fopentelemetry-mysql","guides\u002Fopentelemetry-mysql",{"title":113,"path":114,"stem":115},"OpenTelemetry NestJS Instrumentation","\u002Fguides\u002Fopentelemetry-nestjs","guides\u002Fopentelemetry-nestjs",{"title":117,"path":118,"stem":119},"OpenTelemetry Go net\u002Fhttp Instrumentation [otelhttp]","\u002Fguides\u002Fopentelemetry-net-http","guides\u002Fopentelemetry-net-http",{"title":121,"path":122,"stem":123},"OpenTelemetry Next.js: Tracing for App Router and Pages Router","\u002Fguides\u002Fopentelemetry-nextjs","guides\u002Fopentelemetry-nextjs",{"title":125,"path":126,"stem":127},"OpenTelemetry NGINX Instrumentation","\u002Fguides\u002Fopentelemetry-nginx","guides\u002Fopentelemetry-nginx",{"title":129,"path":130,"stem":131},"OpenTelemetry Node.js AWS Lambda","\u002Fguides\u002Fopentelemetry-node-lambda","guides\u002Fopentelemetry-node-lambda",{"title":133,"path":134,"stem":135},"OpenTelemetry OpenAI Instrumentation","\u002Fguides\u002Fopentelemetry-openai","guides\u002Fopentelemetry-openai",{"title":137,"path":138,"stem":139},"OpenTelemetry Phoenix monitoring","\u002Fguides\u002Fopentelemetry-phoenix","guides\u002Fopentelemetry-phoenix",{"title":141,"path":142,"stem":143},"PHP-FPM Monitoring with OpenTelemetry: Metrics, Alerts, and Dashboards","\u002Fguides\u002Fopentelemetry-php-fpm","guides\u002Fopentelemetry-php-fpm",{"title":145,"path":146,"stem":147},"OpenTelemetry PostgreSQL Monitoring","\u002Fguides\u002Fopentelemetry-postgresql","guides\u002Fopentelemetry-postgresql",{"title":149,"path":150,"stem":151},"OpenTelemetry Pyramid: Instrumentation and Monitoring Guide","\u002Fguides\u002Fopentelemetry-pyramid","guides\u002Fopentelemetry-pyramid",{"title":153,"path":154,"stem":155},"OpenTelemetry Quarkus Instrumentation [Java]","\u002Fguides\u002Fopentelemetry-quarkus","guides\u002Fopentelemetry-quarkus",{"title":157,"path":158,"stem":159},"OpenTelemetry RabbitMQ Monitoring Guide","\u002Fguides\u002Fopentelemetry-rabbitmq","guides\u002Fopentelemetry-rabbitmq",{"title":161,"path":162,"stem":163},"RAG Pipeline Observability with OpenTelemetry","\u002Fguides\u002Fopentelemetry-rag-observability","guides\u002Fopentelemetry-rag-observability",{"title":165,"path":166,"stem":167},"Ruby on Rails Application Monitoring with OpenTelemetry","\u002Fguides\u002Fopentelemetry-rails","guides\u002Fopentelemetry-rails",{"title":169,"path":170,"stem":171},"Monitor Redis with OpenTelemetry Collector","\u002Fguides\u002Fopentelemetry-redis","guides\u002Fopentelemetry-redis",{"title":173,"path":174,"stem":175},"OpenTelemetry Sinatra monitoring","\u002Fguides\u002Fopentelemetry-sinatra","guides\u002Fopentelemetry-sinatra",{"title":177,"path":178,"stem":179},"OpenTelemetry Slim Framework: Instrumentation and Monitoring Guide","\u002Fguides\u002Fopentelemetry-slim","guides\u002Fopentelemetry-slim",{"title":181,"path":182,"stem":183},"OpenTelemetry Slog [otelslog]: Golang Bridge Setup & Examples","\u002Fguides\u002Fopentelemetry-slog","guides\u002Fopentelemetry-slog",{"title":185,"path":186,"stem":187},"OpenTelemetry Spring Boot: Java Agent, Starter, and Manual Instrumentation","\u002Fguides\u002Fopentelemetry-spring-boot","guides\u002Fopentelemetry-spring-boot",{"title":189,"path":190,"stem":191},"OpenTelemetry SQLAlchemy monitoring","\u002Fguides\u002Fopentelemetry-sqlalchemy","guides\u002Fopentelemetry-sqlalchemy",{"title":193,"path":194,"stem":195},"OpenTelemetry Integration for Symfony: Full Guide","\u002Fguides\u002Fopentelemetry-symfony","guides\u002Fopentelemetry-symfony",{"title":197,"path":198,"stem":199},"OpenTelemetry Syslog Receiver","\u002Fguides\u002Fopentelemetry-syslog-receiver","guides\u002Fopentelemetry-syslog-receiver",{"title":201,"path":202,"stem":203},"OpenTelemetry Tomcat: Instrumentation and Monitoring Guide","\u002Fguides\u002Fopentelemetry-tomcat","guides\u002Fopentelemetry-tomcat",{"title":205,"path":206,"stem":207},"OpenTelemetry Zap [otelzap]: Golang Logging Bridge Setup & Examples","\u002Fguides\u002Fopentelemetry-zap","guides\u002Fopentelemetry-zap",{"page":209,"surround":3567},{"id":210,"title":113,"author":211,"author_site":212,"body":213,"date":3554,"description":3555,"extension":3556,"image":3557,"meta":3558,"navigation":370,"path":114,"seo":3565,"stem":115,"__hash__":3566},"guides\u002Fguides\u002Fopentelemetry-nestjs.md","abandurchin",null,{"type":214,"value":215,"toc":3525},"minimark",[216,229,234,317,323,437,440,447,498,502,505,508,512,530,543,553,557,560,598,601,618,622,628,746,753,772,775,791,794,798,805,808,919,936,939,942,948,1549,1563,1567,1574,1584,1627,1634,1698,1714,1718,1725,1749,1759,1882,1887,1893,1935,1938,1942,1945,2292,2302,2306,2309,2313,2325,2339,2435,2448,2452,2459,2473,2553,2557,2572,2575,2612,2692,2695,2699,2702,2755,2765,2771,2775,2779,2782,2807,2821,2826,2928,2932,2939,2996,3007,3011,3021,3096,3099,3187,3191,3214,3231,3245,3259,3280,3284,3296,3303,3306,3309,3329,3333,3354,3380,3403,3418,3439,3457,3475,3479,3482,3521],[217,218,219,220,224,225,228],"p",{},"OpenTelemetry NestJS instrumentation is a set of OpenTelemetry packages that automatically patches HTTP, Express, and NestJS-core layers at startup to collect traces, metrics, and logs. You configure a ",[221,222,223],"code",{},"NodeSDK"," once, load it before NestJS bootstraps via ",[221,226,227],{},"--require",", and gain full visibility into request latency, controller execution, database queries, and downstream service calls — without touching your business logic.",[230,231,233],"h2",{"id":232},"quick-start","Quick Start",[235,236,237,253],"table",{},[238,239,240],"thead",{},[241,242,243,247,250],"tr",{},[244,245,246],"th",{},"Step",[244,248,249],{},"Action",[244,251,252],{},"Detail",[254,255,256,270,290,306],"tbody",{},[241,257,258,262,265],{},[259,260,261],"td",{},"1. Install",[259,263,264],{},"Add OpenTelemetry packages",[259,266,267],{},[221,268,269],{},"npm install @opentelemetry\u002Fsdk-node @opentelemetry\u002Fauto-instrumentations-node",[241,271,272,275,281],{},[259,273,274],{},"2. Configure",[259,276,277,278],{},"Create ",[221,279,280],{},"src\u002Fotel.ts",[259,282,283,284,289],{},"See ",[285,286,288],"a",{"href":287},"#usage","Usage"," section below",[241,291,292,295,301],{},[259,293,294],{},"3. Run",[259,296,297,298,300],{},"Load with ",[221,299,227],{}," flag",[259,302,303],{},[221,304,305],{},"node --require .\u002Fdist\u002Fotel.js dist\u002Fmain.js",[241,307,308,311,314],{},[259,309,310],{},"4. Verify",[259,312,313],{},"Check traces in your backend",[259,315,316],{},"Spans appear automatically",[217,318,319],{},[320,321,322],"strong",{},"Minimal working example:",[324,325,330],"pre",{"className":326,"code":327,"language":328,"meta":329,"style":329},"language-typescript shiki shiki-themes github-light","import { NodeSDK } from '@opentelemetry\u002Fsdk-node'\nimport { getNodeAutoInstrumentations } from '@opentelemetry\u002Fauto-instrumentations-node'\n\nconst sdk = new NodeSDK({\n  serviceName: 'my-nestjs-app',\n  instrumentations: [getNodeAutoInstrumentations()],\n})\nsdk.start()\n","typescript","",[221,331,332,352,365,372,395,407,419,425],{"__ignoreMap":329},[333,334,337,341,345,348],"span",{"class":335,"line":336},"line",1,[333,338,340],{"class":339},"sD7c4","import",[333,342,344],{"class":343},"sgsFI"," { NodeSDK } ",[333,346,347],{"class":339},"from",[333,349,351],{"class":350},"sYBdl"," '@opentelemetry\u002Fsdk-node'\n",[333,353,355,357,360,362],{"class":335,"line":354},2,[333,356,340],{"class":339},[333,358,359],{"class":343}," { getNodeAutoInstrumentations } ",[333,361,347],{"class":339},[333,363,364],{"class":350}," '@opentelemetry\u002Fauto-instrumentations-node'\n",[333,366,368],{"class":335,"line":367},3,[333,369,371],{"emptyLinePlaceholder":370},true,"\n",[333,373,375,378,382,385,388,392],{"class":335,"line":374},4,[333,376,377],{"class":339},"const",[333,379,381],{"class":380},"sYu0t"," sdk",[333,383,384],{"class":339}," =",[333,386,387],{"class":339}," new",[333,389,391],{"class":390},"s7eDp"," NodeSDK",[333,393,394],{"class":343},"({\n",[333,396,398,401,404],{"class":335,"line":397},5,[333,399,400],{"class":343},"  serviceName: ",[333,402,403],{"class":350},"'my-nestjs-app'",[333,405,406],{"class":343},",\n",[333,408,410,413,416],{"class":335,"line":409},6,[333,411,412],{"class":343},"  instrumentations: [",[333,414,415],{"class":390},"getNodeAutoInstrumentations",[333,417,418],{"class":343},"()],\n",[333,420,422],{"class":335,"line":421},7,[333,423,424],{"class":343},"})\n",[333,426,428,431,434],{"class":335,"line":427},8,[333,429,430],{"class":343},"sdk.",[333,432,433],{"class":390},"start",[333,435,436],{"class":343},"()\n",[217,438,439],{},"This configuration automatically instruments NestJS controllers, HTTP requests, and common Node.js libraries without modifying your application code.",[217,441,442,443,446],{},"If ",[221,444,445],{},"getNodeAutoInstrumentations()"," generates too much noise (filesystem events in particular), disable specific instrumentations selectively:",[324,448,450],{"className":326,"code":449,"language":328,"meta":329,"style":329},"getNodeAutoInstrumentations({\n  \u002F\u002F fs instrumentation is very noisy — disable unless you need it\n  '@opentelemetry\u002Finstrumentation-fs': { enabled: false },\n  \u002F\u002F dns instrumentation rarely adds value in most apps\n  '@opentelemetry\u002Finstrumentation-dns': { enabled: false },\n})\n",[221,451,452,458,464,478,483,494],{"__ignoreMap":329},[333,453,454,456],{"class":335,"line":336},[333,455,415],{"class":390},[333,457,394],{"class":343},[333,459,460],{"class":335,"line":354},[333,461,463],{"class":462},"sAwPA","  \u002F\u002F fs instrumentation is very noisy — disable unless you need it\n",[333,465,466,469,472,475],{"class":335,"line":367},[333,467,468],{"class":350},"  '@opentelemetry\u002Finstrumentation-fs'",[333,470,471],{"class":343},": { enabled: ",[333,473,474],{"class":380},"false",[333,476,477],{"class":343}," },\n",[333,479,480],{"class":335,"line":374},[333,481,482],{"class":462},"  \u002F\u002F dns instrumentation rarely adds value in most apps\n",[333,484,485,488,490,492],{"class":335,"line":397},[333,486,487],{"class":350},"  '@opentelemetry\u002Finstrumentation-dns'",[333,489,471],{"class":343},[333,491,474],{"class":380},[333,493,477],{"class":343},[333,495,496],{"class":335,"line":409},[333,497,424],{"class":343},[230,499,501],{"id":500},"what-is-nestjs","What is NestJS?",[217,503,504],{},"NestJS is a progressive Node.js framework for building efficient and scalable server-side applications. It is written in TypeScript and combines elements of Object-Oriented Programming, Functional Programming, and Functional Reactive Programming.",[217,506,507],{},"NestJS uses decorators and a module system inspired by Angular, making it a popular choice for teams building enterprise-grade REST APIs, GraphQL services, and microservices on Node.js.",[230,509,511],{"id":510},"what-is-opentelemetry","What is OpenTelemetry?",[217,513,514,515,519,520,524,525,529],{},"OpenTelemetry is an open-source observability framework that standardizes the collection, processing, and export of telemetry data from applications. It supports ",[285,516,518],{"href":517},"\u002Fopentelemetry\u002Fdistributed-tracing","distributed tracing",", ",[285,521,523],{"href":522},"\u002Fopentelemetry\u002Fmetrics","metrics",", and ",[285,526,528],{"href":527},"\u002Fopentelemetry\u002Flogs","logs"," across multiple languages and platforms.",[217,531,532,533,537,538,542],{},"OpenTelemetry enables developers to instrument their code and export telemetry to any ",[285,534,536],{"href":535},"\u002Fblog\u002Fopentelemetry-backend","OpenTelemetry backend"," for analysis and visualization. The ",[285,539,541],{"href":540},"\u002Fopentelemetry\u002Farchitecture","OpenTelemetry architecture"," follows a modular design with SDKs, APIs, and exporters as its core components.",[217,544,545,547,548,552],{},[320,546,233],{},": For fastest setup without code changes, see the ",[285,549,551],{"href":550},"\u002Fget\u002Fopentelemetry-js\u002Fzero-code","Node.js zero-code instrumentation guide",".",[230,554,556],{"id":555},"prerequisites","Prerequisites",[217,558,559],{},"Before instrumenting, make sure your environment meets these requirements:",[235,561,562,572],{},[238,563,564],{},[241,565,566,569],{},[244,567,568],{},"Requirement",[244,570,571],{},"Version",[254,573,574,582,590],{},[241,575,576,579],{},[259,577,578],{},"Node.js",[259,580,581],{},"18.19.0+ (Node.js 20+ required for NestJS 11+)",[241,583,584,587],{},[259,585,586],{},"NestJS",[259,588,589],{},"8+",[241,591,592,595],{},[259,593,594],{},"TypeScript",[259,596,597],{},"4.7+",[217,599,600],{},"Node.js 18 reached end-of-life in March 2025. For new projects, use Node.js 20 or 22.",[602,603,604],"blockquote",{},[217,605,606,609,610,613,614,617],{},[320,607,608],{},"Note",": The examples in this guide use Uptrace as the OpenTelemetry backend. You can use any OTLP-compatible backend — replace ",[221,611,612],{},"OTEL_EXPORTER_OTLP_ENDPOINT"," and ",[221,615,616],{},"OTEL_EXPORTER_OTLP_HEADERS"," with your backend's endpoint and credentials.",[230,619,621],{"id":620},"zero-code-instrumentation","Zero-code instrumentation",[217,623,624,625,627],{},"If you want traces without touching your application code, use environment variables with the ",[221,626,227],{}," flag:",[324,629,633],{"className":630,"code":631,"language":632,"meta":329,"style":329},"language-shell shiki shiki-themes github-light","export OTEL_SERVICE_NAME=my-nestjs-app\nexport OTEL_TRACES_EXPORTER=otlp\nexport OTEL_METRICS_EXPORTER=otlp\nexport OTEL_EXPORTER_OTLP_ENDPOINT=https:\u002F\u002Fapi.uptrace.dev # endpoint is embedded in DSN\nexport OTEL_EXPORTER_OTLP_HEADERS=uptrace-dsn=https:\u002F\u002F\u003Csecret>@api.uptrace.dev\nexport OTEL_EXPORTER_OTLP_COMPRESSION=gzip\n\nnode --require @opentelemetry\u002Fauto-instrumentations-node\u002Fregister dist\u002Fmain.js\n","shell",[221,634,635,649,661,672,687,716,728,732],{"__ignoreMap":329},[333,636,637,640,643,646],{"class":335,"line":336},[333,638,639],{"class":339},"export",[333,641,642],{"class":343}," OTEL_SERVICE_NAME",[333,644,645],{"class":339},"=",[333,647,648],{"class":343},"my-nestjs-app\n",[333,650,651,653,656,658],{"class":335,"line":354},[333,652,639],{"class":339},[333,654,655],{"class":343}," OTEL_TRACES_EXPORTER",[333,657,645],{"class":339},[333,659,660],{"class":343},"otlp\n",[333,662,663,665,668,670],{"class":335,"line":367},[333,664,639],{"class":339},[333,666,667],{"class":343}," OTEL_METRICS_EXPORTER",[333,669,645],{"class":339},[333,671,660],{"class":343},[333,673,674,676,679,681,684],{"class":335,"line":374},[333,675,639],{"class":339},[333,677,678],{"class":343}," OTEL_EXPORTER_OTLP_ENDPOINT",[333,680,645],{"class":339},[333,682,683],{"class":343},"https:\u002F\u002Fapi.uptrace.dev ",[333,685,686],{"class":462},"# endpoint is embedded in DSN\n",[333,688,689,691,694,696,699,701,704,707,710,713],{"class":335,"line":397},[333,690,639],{"class":339},[333,692,693],{"class":343}," OTEL_EXPORTER_OTLP_HEADERS",[333,695,645],{"class":339},[333,697,698],{"class":343},"uptrace-dsn",[333,700,645],{"class":339},[333,702,703],{"class":343},"https:\u002F\u002F",[333,705,706],{"class":339},"\u003C",[333,708,709],{"class":343},"secret",[333,711,712],{"class":339},">",[333,714,715],{"class":343},"@api.uptrace.dev\n",[333,717,718,720,723,725],{"class":335,"line":409},[333,719,639],{"class":339},[333,721,722],{"class":343}," OTEL_EXPORTER_OTLP_COMPRESSION",[333,724,645],{"class":339},[333,726,727],{"class":343},"gzip\n",[333,729,730],{"class":335,"line":421},[333,731,371],{"emptyLinePlaceholder":370},[333,733,734,737,740,743],{"class":335,"line":427},[333,735,736],{"class":390},"node",[333,738,739],{"class":380}," --require",[333,741,742],{"class":350}," @opentelemetry\u002Fauto-instrumentations-node\u002Fregister",[333,744,745],{"class":350}," dist\u002Fmain.js\n",[217,747,748,749,752],{},"Or via ",[221,750,751],{},"NODE_OPTIONS"," in your Docker or CI environment:",[324,754,756],{"className":630,"code":755,"language":632,"meta":329,"style":329},"NODE_OPTIONS=\"--require @opentelemetry\u002Fauto-instrumentations-node\u002Fregister\" node dist\u002Fmain.js\n",[221,757,758],{"__ignoreMap":329},[333,759,760,762,764,767,770],{"class":335,"line":336},[333,761,751],{"class":343},[333,763,645],{"class":339},[333,765,766],{"class":350},"\"--require @opentelemetry\u002Fauto-instrumentations-node\u002Fregister\"",[333,768,769],{"class":390}," node",[333,771,745],{"class":350},[217,773,774],{},"This approach requires only one package:",[324,776,778],{"className":630,"code":777,"language":632,"meta":329,"style":329},"npm install @opentelemetry\u002Fauto-instrumentations-node\n",[221,779,780],{"__ignoreMap":329},[333,781,782,785,788],{"class":335,"line":336},[333,783,784],{"class":390},"npm",[333,786,787],{"class":350}," install",[333,789,790],{"class":350}," @opentelemetry\u002Fauto-instrumentations-node\n",[217,792,793],{},"For production setups that need custom processors, sampling logic, or explicit instrumentation control, use the code-based approach below.",[230,795,797],{"id":796},"nestjs-instrumentation","NestJS instrumentation",[217,799,800,801,804],{},"NestJS runs on top of Express (or Fastify), so you need to install instrumentations for both the framework layer and the HTTP transport layer. The ",[221,802,803],{},"@opentelemetry\u002Finstrumentation-nestjs-core"," package instruments NestJS-specific components: controllers, guards, interceptors, and pipes.",[217,806,807],{},"Install the required packages:",[324,809,811],{"className":630,"code":810,"language":632,"meta":329,"style":329},"# Using npm\nnpm install @opentelemetry\u002Fsdk-node \\\n  @opentelemetry\u002Fapi \\\n  @opentelemetry\u002Fauto-instrumentations-node \\\n  @opentelemetry\u002Finstrumentation-nestjs-core \\\n  @opentelemetry\u002Finstrumentation-http \\\n  @opentelemetry\u002Finstrumentation-express\n\n# Using yarn\nyarn add @opentelemetry\u002Fsdk-node \\\n  @opentelemetry\u002Fapi \\\n  @opentelemetry\u002Fauto-instrumentations-node \\\n  @opentelemetry\u002Finstrumentation-nestjs-core \\\n  @opentelemetry\u002Finstrumentation-http \\\n  @opentelemetry\u002Finstrumentation-express\n",[221,812,813,818,830,837,844,851,858,863,867,873,886,893,900,907,914],{"__ignoreMap":329},[333,814,815],{"class":335,"line":336},[333,816,817],{"class":462},"# Using npm\n",[333,819,820,822,824,827],{"class":335,"line":354},[333,821,784],{"class":390},[333,823,787],{"class":350},[333,825,826],{"class":350}," @opentelemetry\u002Fsdk-node",[333,828,829],{"class":380}," \\\n",[333,831,832,835],{"class":335,"line":367},[333,833,834],{"class":350},"  @opentelemetry\u002Fapi",[333,836,829],{"class":380},[333,838,839,842],{"class":335,"line":374},[333,840,841],{"class":350},"  @opentelemetry\u002Fauto-instrumentations-node",[333,843,829],{"class":380},[333,845,846,849],{"class":335,"line":397},[333,847,848],{"class":350},"  @opentelemetry\u002Finstrumentation-nestjs-core",[333,850,829],{"class":380},[333,852,853,856],{"class":335,"line":409},[333,854,855],{"class":350},"  @opentelemetry\u002Finstrumentation-http",[333,857,829],{"class":380},[333,859,860],{"class":335,"line":421},[333,861,862],{"class":350},"  @opentelemetry\u002Finstrumentation-express\n",[333,864,865],{"class":335,"line":427},[333,866,371],{"emptyLinePlaceholder":370},[333,868,870],{"class":335,"line":869},9,[333,871,872],{"class":462},"# Using yarn\n",[333,874,876,879,882,884],{"class":335,"line":875},10,[333,877,878],{"class":390},"yarn",[333,880,881],{"class":350}," add",[333,883,826],{"class":350},[333,885,829],{"class":380},[333,887,889,891],{"class":335,"line":888},11,[333,890,834],{"class":350},[333,892,829],{"class":380},[333,894,896,898],{"class":335,"line":895},12,[333,897,841],{"class":350},[333,899,829],{"class":380},[333,901,903,905],{"class":335,"line":902},13,[333,904,848],{"class":350},[333,906,829],{"class":380},[333,908,910,912],{"class":335,"line":909},14,[333,911,855],{"class":350},[333,913,829],{"class":380},[333,915,917],{"class":335,"line":916},15,[333,918,862],{"class":350},[217,920,921,922,925,926,519,929,524,932,935],{},"If you prefer minimal explicit dependencies over the full ",[221,923,924],{},"auto-instrumentations-node"," bundle, you can install only what you need. The three packages above — ",[221,927,928],{},"instrumentation-nestjs-core",[221,930,931],{},"instrumentation-http",[221,933,934],{},"instrumentation-express"," — cover the vast majority of production use cases.",[230,937,288],{"id":938},"usage",[217,940,941],{},"After installing OpenTelemetry, configure the SDK to export data to an observability backend.",[217,943,944,945,947],{},"Create a dedicated file ",[221,946,280],{},":",[324,949,951],{"className":326,"code":950,"language":328,"meta":329,"style":329},"import { BatchSpanProcessor } from '@opentelemetry\u002Fsdk-trace-base'\nimport { resourceFromAttributes } from '@opentelemetry\u002Fresources'\nimport { NodeSDK } from '@opentelemetry\u002Fsdk-node'\nimport { OTLPTraceExporter } from '@opentelemetry\u002Fexporter-trace-otlp-http'\nimport { PeriodicExportingMetricReader } from '@opentelemetry\u002Fsdk-metrics'\nimport { OTLPMetricExporter } from '@opentelemetry\u002Fexporter-metrics-otlp-http'\nimport { HttpInstrumentation } from '@opentelemetry\u002Finstrumentation-http'\nimport { ExpressInstrumentation } from '@opentelemetry\u002Finstrumentation-express'\nimport { NestInstrumentation } from '@opentelemetry\u002Finstrumentation-nestjs-core'\n\nconst dsn = process.env.UPTRACE_DSN\nconsole.log('using dsn:', dsn)\n\nconst traceExporter = new OTLPTraceExporter({\n  url: 'https:\u002F\u002Fapi.uptrace.dev\u002Fv1\u002Ftraces',\n  headers: { 'uptrace-dsn': dsn },\n  compression: 'gzip' as any,\n})\n\nconst sdk = new NodeSDK({\n  spanProcessor: new BatchSpanProcessor(traceExporter, {\n    maxExportBatchSize: 1000,\n    maxQueueSize: 1000,\n  }),\n  resource: resourceFromAttributes({\n    'service.name': 'my-nestjs-app',\n    'service.version': '1.0.0',\n    'deployment.environment': process.env.NODE_ENV || 'development',\n  }),\n  metricReader: new PeriodicExportingMetricReader({\n    exporter: new OTLPMetricExporter({\n      url: 'https:\u002F\u002Fapi.uptrace.dev\u002Fv1\u002Fmetrics',\n      headers: { 'uptrace-dsn': dsn },\n    }),\n    exportIntervalMillis: 15000,\n  }),\n  instrumentations: [\n    new HttpInstrumentation(),\n    new ExpressInstrumentation(),\n    new NestInstrumentation(),\n  ],\n})\n\nsdk.start()\n\nprocess.on('SIGTERM', () => {\n  sdk\n    .shutdown()\n    .then(() => console.log('OpenTelemetry SDK shut down'))\n    .catch((err) => console.error('Error shutting down SDK', err))\n    .finally(() => process.exit(0))\n})\n",[221,952,953,965,977,987,999,1011,1023,1035,1047,1059,1063,1078,1095,1099,1115,1125,1137,1154,1159,1164,1179,1194,1205,1215,1221,1232,1245,1258,1278,1283,1296,1309,1320,1330,1336,1347,1352,1358,1370,1380,1390,1396,1401,1406,1415,1420,1443,1449,1460,1486,1519,1544],{"__ignoreMap":329},[333,954,955,957,960,962],{"class":335,"line":336},[333,956,340],{"class":339},[333,958,959],{"class":343}," { BatchSpanProcessor } ",[333,961,347],{"class":339},[333,963,964],{"class":350}," '@opentelemetry\u002Fsdk-trace-base'\n",[333,966,967,969,972,974],{"class":335,"line":354},[333,968,340],{"class":339},[333,970,971],{"class":343}," { resourceFromAttributes } ",[333,973,347],{"class":339},[333,975,976],{"class":350}," '@opentelemetry\u002Fresources'\n",[333,978,979,981,983,985],{"class":335,"line":367},[333,980,340],{"class":339},[333,982,344],{"class":343},[333,984,347],{"class":339},[333,986,351],{"class":350},[333,988,989,991,994,996],{"class":335,"line":374},[333,990,340],{"class":339},[333,992,993],{"class":343}," { OTLPTraceExporter } ",[333,995,347],{"class":339},[333,997,998],{"class":350}," '@opentelemetry\u002Fexporter-trace-otlp-http'\n",[333,1000,1001,1003,1006,1008],{"class":335,"line":397},[333,1002,340],{"class":339},[333,1004,1005],{"class":343}," { PeriodicExportingMetricReader } ",[333,1007,347],{"class":339},[333,1009,1010],{"class":350}," '@opentelemetry\u002Fsdk-metrics'\n",[333,1012,1013,1015,1018,1020],{"class":335,"line":409},[333,1014,340],{"class":339},[333,1016,1017],{"class":343}," { OTLPMetricExporter } ",[333,1019,347],{"class":339},[333,1021,1022],{"class":350}," '@opentelemetry\u002Fexporter-metrics-otlp-http'\n",[333,1024,1025,1027,1030,1032],{"class":335,"line":421},[333,1026,340],{"class":339},[333,1028,1029],{"class":343}," { HttpInstrumentation } ",[333,1031,347],{"class":339},[333,1033,1034],{"class":350}," '@opentelemetry\u002Finstrumentation-http'\n",[333,1036,1037,1039,1042,1044],{"class":335,"line":427},[333,1038,340],{"class":339},[333,1040,1041],{"class":343}," { ExpressInstrumentation } ",[333,1043,347],{"class":339},[333,1045,1046],{"class":350}," '@opentelemetry\u002Finstrumentation-express'\n",[333,1048,1049,1051,1054,1056],{"class":335,"line":869},[333,1050,340],{"class":339},[333,1052,1053],{"class":343}," { NestInstrumentation } ",[333,1055,347],{"class":339},[333,1057,1058],{"class":350}," '@opentelemetry\u002Finstrumentation-nestjs-core'\n",[333,1060,1061],{"class":335,"line":875},[333,1062,371],{"emptyLinePlaceholder":370},[333,1064,1065,1067,1070,1072,1075],{"class":335,"line":888},[333,1066,377],{"class":339},[333,1068,1069],{"class":380}," dsn",[333,1071,384],{"class":339},[333,1073,1074],{"class":343}," process.env.",[333,1076,1077],{"class":380},"UPTRACE_DSN\n",[333,1079,1080,1083,1086,1089,1092],{"class":335,"line":895},[333,1081,1082],{"class":343},"console.",[333,1084,1085],{"class":390},"log",[333,1087,1088],{"class":343},"(",[333,1090,1091],{"class":350},"'using dsn:'",[333,1093,1094],{"class":343},", dsn)\n",[333,1096,1097],{"class":335,"line":902},[333,1098,371],{"emptyLinePlaceholder":370},[333,1100,1101,1103,1106,1108,1110,1113],{"class":335,"line":909},[333,1102,377],{"class":339},[333,1104,1105],{"class":380}," traceExporter",[333,1107,384],{"class":339},[333,1109,387],{"class":339},[333,1111,1112],{"class":390}," OTLPTraceExporter",[333,1114,394],{"class":343},[333,1116,1117,1120,1123],{"class":335,"line":916},[333,1118,1119],{"class":343},"  url: ",[333,1121,1122],{"class":350},"'https:\u002F\u002Fapi.uptrace.dev\u002Fv1\u002Ftraces'",[333,1124,406],{"class":343},[333,1126,1128,1131,1134],{"class":335,"line":1127},16,[333,1129,1130],{"class":343},"  headers: { ",[333,1132,1133],{"class":350},"'uptrace-dsn'",[333,1135,1136],{"class":343},": dsn },\n",[333,1138,1140,1143,1146,1149,1152],{"class":335,"line":1139},17,[333,1141,1142],{"class":343},"  compression: ",[333,1144,1145],{"class":350},"'gzip'",[333,1147,1148],{"class":339}," as",[333,1150,1151],{"class":380}," any",[333,1153,406],{"class":343},[333,1155,1157],{"class":335,"line":1156},18,[333,1158,424],{"class":343},[333,1160,1162],{"class":335,"line":1161},19,[333,1163,371],{"emptyLinePlaceholder":370},[333,1165,1167,1169,1171,1173,1175,1177],{"class":335,"line":1166},20,[333,1168,377],{"class":339},[333,1170,381],{"class":380},[333,1172,384],{"class":339},[333,1174,387],{"class":339},[333,1176,391],{"class":390},[333,1178,394],{"class":343},[333,1180,1182,1185,1188,1191],{"class":335,"line":1181},21,[333,1183,1184],{"class":343},"  spanProcessor: ",[333,1186,1187],{"class":339},"new",[333,1189,1190],{"class":390}," BatchSpanProcessor",[333,1192,1193],{"class":343},"(traceExporter, {\n",[333,1195,1197,1200,1203],{"class":335,"line":1196},22,[333,1198,1199],{"class":343},"    maxExportBatchSize: ",[333,1201,1202],{"class":380},"1000",[333,1204,406],{"class":343},[333,1206,1208,1211,1213],{"class":335,"line":1207},23,[333,1209,1210],{"class":343},"    maxQueueSize: ",[333,1212,1202],{"class":380},[333,1214,406],{"class":343},[333,1216,1218],{"class":335,"line":1217},24,[333,1219,1220],{"class":343},"  }),\n",[333,1222,1224,1227,1230],{"class":335,"line":1223},25,[333,1225,1226],{"class":343},"  resource: ",[333,1228,1229],{"class":390},"resourceFromAttributes",[333,1231,394],{"class":343},[333,1233,1235,1238,1241,1243],{"class":335,"line":1234},26,[333,1236,1237],{"class":350},"    'service.name'",[333,1239,1240],{"class":343},": ",[333,1242,403],{"class":350},[333,1244,406],{"class":343},[333,1246,1248,1251,1253,1256],{"class":335,"line":1247},27,[333,1249,1250],{"class":350},"    'service.version'",[333,1252,1240],{"class":343},[333,1254,1255],{"class":350},"'1.0.0'",[333,1257,406],{"class":343},[333,1259,1261,1264,1267,1270,1273,1276],{"class":335,"line":1260},28,[333,1262,1263],{"class":350},"    'deployment.environment'",[333,1265,1266],{"class":343},": process.env.",[333,1268,1269],{"class":380},"NODE_ENV",[333,1271,1272],{"class":339}," ||",[333,1274,1275],{"class":350}," 'development'",[333,1277,406],{"class":343},[333,1279,1281],{"class":335,"line":1280},29,[333,1282,1220],{"class":343},[333,1284,1286,1289,1291,1294],{"class":335,"line":1285},30,[333,1287,1288],{"class":343},"  metricReader: ",[333,1290,1187],{"class":339},[333,1292,1293],{"class":390}," PeriodicExportingMetricReader",[333,1295,394],{"class":343},[333,1297,1299,1302,1304,1307],{"class":335,"line":1298},31,[333,1300,1301],{"class":343},"    exporter: ",[333,1303,1187],{"class":339},[333,1305,1306],{"class":390}," OTLPMetricExporter",[333,1308,394],{"class":343},[333,1310,1312,1315,1318],{"class":335,"line":1311},32,[333,1313,1314],{"class":343},"      url: ",[333,1316,1317],{"class":350},"'https:\u002F\u002Fapi.uptrace.dev\u002Fv1\u002Fmetrics'",[333,1319,406],{"class":343},[333,1321,1323,1326,1328],{"class":335,"line":1322},33,[333,1324,1325],{"class":343},"      headers: { ",[333,1327,1133],{"class":350},[333,1329,1136],{"class":343},[333,1331,1333],{"class":335,"line":1332},34,[333,1334,1335],{"class":343},"    }),\n",[333,1337,1339,1342,1345],{"class":335,"line":1338},35,[333,1340,1341],{"class":343},"    exportIntervalMillis: ",[333,1343,1344],{"class":380},"15000",[333,1346,406],{"class":343},[333,1348,1350],{"class":335,"line":1349},36,[333,1351,1220],{"class":343},[333,1353,1355],{"class":335,"line":1354},37,[333,1356,1357],{"class":343},"  instrumentations: [\n",[333,1359,1361,1364,1367],{"class":335,"line":1360},38,[333,1362,1363],{"class":339},"    new",[333,1365,1366],{"class":390}," HttpInstrumentation",[333,1368,1369],{"class":343},"(),\n",[333,1371,1373,1375,1378],{"class":335,"line":1372},39,[333,1374,1363],{"class":339},[333,1376,1377],{"class":390}," ExpressInstrumentation",[333,1379,1369],{"class":343},[333,1381,1383,1385,1388],{"class":335,"line":1382},40,[333,1384,1363],{"class":339},[333,1386,1387],{"class":390}," NestInstrumentation",[333,1389,1369],{"class":343},[333,1391,1393],{"class":335,"line":1392},41,[333,1394,1395],{"class":343},"  ],\n",[333,1397,1399],{"class":335,"line":1398},42,[333,1400,424],{"class":343},[333,1402,1404],{"class":335,"line":1403},43,[333,1405,371],{"emptyLinePlaceholder":370},[333,1407,1409,1411,1413],{"class":335,"line":1408},44,[333,1410,430],{"class":343},[333,1412,433],{"class":390},[333,1414,436],{"class":343},[333,1416,1418],{"class":335,"line":1417},45,[333,1419,371],{"emptyLinePlaceholder":370},[333,1421,1423,1426,1429,1431,1434,1437,1440],{"class":335,"line":1422},46,[333,1424,1425],{"class":343},"process.",[333,1427,1428],{"class":390},"on",[333,1430,1088],{"class":343},[333,1432,1433],{"class":350},"'SIGTERM'",[333,1435,1436],{"class":343},", () ",[333,1438,1439],{"class":339},"=>",[333,1441,1442],{"class":343}," {\n",[333,1444,1446],{"class":335,"line":1445},47,[333,1447,1448],{"class":343},"  sdk\n",[333,1450,1452,1455,1458],{"class":335,"line":1451},48,[333,1453,1454],{"class":343},"    .",[333,1456,1457],{"class":390},"shutdown",[333,1459,436],{"class":343},[333,1461,1463,1465,1468,1471,1473,1476,1478,1480,1483],{"class":335,"line":1462},49,[333,1464,1454],{"class":343},[333,1466,1467],{"class":390},"then",[333,1469,1470],{"class":343},"(() ",[333,1472,1439],{"class":339},[333,1474,1475],{"class":343}," console.",[333,1477,1085],{"class":390},[333,1479,1088],{"class":343},[333,1481,1482],{"class":350},"'OpenTelemetry SDK shut down'",[333,1484,1485],{"class":343},"))\n",[333,1487,1489,1491,1494,1497,1501,1504,1506,1508,1511,1513,1516],{"class":335,"line":1488},50,[333,1490,1454],{"class":343},[333,1492,1493],{"class":390},"catch",[333,1495,1496],{"class":343},"((",[333,1498,1500],{"class":1499},"sqxcx","err",[333,1502,1503],{"class":343},") ",[333,1505,1439],{"class":339},[333,1507,1475],{"class":343},[333,1509,1510],{"class":390},"error",[333,1512,1088],{"class":343},[333,1514,1515],{"class":350},"'Error shutting down SDK'",[333,1517,1518],{"class":343},", err))\n",[333,1520,1522,1524,1527,1529,1531,1534,1537,1539,1542],{"class":335,"line":1521},51,[333,1523,1454],{"class":343},[333,1525,1526],{"class":390},"finally",[333,1528,1470],{"class":343},[333,1530,1439],{"class":339},[333,1532,1533],{"class":343}," process.",[333,1535,1536],{"class":390},"exit",[333,1538,1088],{"class":343},[333,1540,1541],{"class":380},"0",[333,1543,1485],{"class":343},[333,1545,1547],{"class":335,"line":1546},52,[333,1548,424],{"class":343},[602,1550,1551],{},[217,1552,1553,1556,1557,1559,1560,1562],{},[320,1554,1555],{},"Note on Examples",": This guide uses Uptrace as the OpenTelemetry backend in code examples. OpenTelemetry is vendor-neutral and works with any OTLP-compatible backend — Jaeger, Grafana Cloud, Honeycomb, and others. Replace ",[221,1558,612],{}," and the ",[221,1561,698],{}," header with your backend's endpoint and auth headers.",[230,1564,1566],{"id":1565},"critical-initialization-order","Critical: Initialization Order",[217,1568,1569,1570,1573],{},"The most common issue when setting up OpenTelemetry in NestJS is ",[320,1571,1572],{},"initialization order",". The SDK must be started before NestJS imports any modules — otherwise, auto-instrumentation patches won't apply and you'll see incomplete or missing traces.",[217,1575,1576,1577,1580,1581,1583],{},"The correct approach is to load ",[221,1578,1579],{},"otel.ts"," via the ",[221,1582,227],{}," flag before the application entry point:",[324,1585,1587],{"className":630,"code":1586,"language":632,"meta":329,"style":329},"# Development (ts-node)\nts-node --require .\u002Fsrc\u002Fotel.ts src\u002Fmain.ts\n\n# Production (compiled)\nnode --require .\u002Fdist\u002Fotel.js dist\u002Fmain.js\n",[221,1588,1589,1594,1607,1611,1616],{"__ignoreMap":329},[333,1590,1591],{"class":335,"line":336},[333,1592,1593],{"class":462},"# Development (ts-node)\n",[333,1595,1596,1599,1601,1604],{"class":335,"line":354},[333,1597,1598],{"class":390},"ts-node",[333,1600,739],{"class":380},[333,1602,1603],{"class":350}," .\u002Fsrc\u002Fotel.ts",[333,1605,1606],{"class":350}," src\u002Fmain.ts\n",[333,1608,1609],{"class":335,"line":367},[333,1610,371],{"emptyLinePlaceholder":370},[333,1612,1613],{"class":335,"line":374},[333,1614,1615],{"class":462},"# Production (compiled)\n",[333,1617,1618,1620,1622,1625],{"class":335,"line":397},[333,1619,736],{"class":390},[333,1621,739],{"class":380},[333,1623,1624],{"class":350}," .\u002Fdist\u002Fotel.js",[333,1626,745],{"class":350},[217,1628,1629,1630,1633],{},"Update your ",[221,1631,1632],{},"package.json"," scripts:",[324,1635,1639],{"className":1636,"code":1637,"language":1638,"meta":329,"style":329},"language-json shiki shiki-themes github-light","{\n  \"scripts\": {\n    \"start\": \"node --require .\u002Fdist\u002Fotel.js dist\u002Fmain.js\",\n    \"start:dev\": \"ts-node --require .\u002Fsrc\u002Fotel.ts src\u002Fmain.ts\",\n    \"start:debug\": \"node --inspect --require ts-node\u002Fregister --require .\u002Fsrc\u002Fotel.ts src\u002Fmain.ts\"\n  }\n}\n","json",[221,1640,1641,1646,1654,1666,1678,1688,1693],{"__ignoreMap":329},[333,1642,1643],{"class":335,"line":336},[333,1644,1645],{"class":343},"{\n",[333,1647,1648,1651],{"class":335,"line":354},[333,1649,1650],{"class":380},"  \"scripts\"",[333,1652,1653],{"class":343},": {\n",[333,1655,1656,1659,1661,1664],{"class":335,"line":367},[333,1657,1658],{"class":380},"    \"start\"",[333,1660,1240],{"class":343},[333,1662,1663],{"class":350},"\"node --require .\u002Fdist\u002Fotel.js dist\u002Fmain.js\"",[333,1665,406],{"class":343},[333,1667,1668,1671,1673,1676],{"class":335,"line":374},[333,1669,1670],{"class":380},"    \"start:dev\"",[333,1672,1240],{"class":343},[333,1674,1675],{"class":350},"\"ts-node --require .\u002Fsrc\u002Fotel.ts src\u002Fmain.ts\"",[333,1677,406],{"class":343},[333,1679,1680,1683,1685],{"class":335,"line":397},[333,1681,1682],{"class":380},"    \"start:debug\"",[333,1684,1240],{"class":343},[333,1686,1687],{"class":350},"\"node --inspect --require ts-node\u002Fregister --require .\u002Fsrc\u002Fotel.ts src\u002Fmain.ts\"\n",[333,1689,1690],{"class":335,"line":409},[333,1691,1692],{"class":343},"  }\n",[333,1694,1695],{"class":335,"line":421},[333,1696,1697],{"class":343},"}\n",[217,1699,1700,1703,1704,1706,1707,1710,1711,1713],{},[320,1701,1702],{},"Do not"," import ",[221,1705,1579],{}," at the top of ",[221,1708,1709],{},"main.ts",". While it may appear to work in development, it causes race conditions during module resolution and breaks instrumentation for lazily-loaded NestJS modules. The ",[221,1712,227],{}," flag guarantees the SDK initializes before any application code runs.",[230,1715,1717],{"id":1716},"instrumentation-options","Instrumentation Options",[217,1719,1720,1721,1724],{},"The ",[221,1722,1723],{},"NestInstrumentation"," class supports configuration options for customizing behavior:",[235,1726,1727,1737],{},[238,1728,1729],{},[241,1730,1731,1734],{},[244,1732,1733],{},"Option",[244,1735,1736],{},"Description",[254,1738,1739],{},[241,1740,1741,1746],{},[259,1742,1743],{},[221,1744,1745],{},"enabled",[259,1747,1748],{},"Enable or disable the instrumentation entirely",[217,1750,1720,1751,1754,1755,1758],{},[221,1752,1753],{},"HttpInstrumentation"," layer provides the main filtering options. Use ",[221,1756,1757],{},"ignoreIncomingRequestHook"," to exclude health check endpoints from traces:",[324,1760,1762],{"className":326,"code":1761,"language":328,"meta":329,"style":329},"import { HttpInstrumentation } from '@opentelemetry\u002Finstrumentation-http'\n\nconst httpInstrumentation = new HttpInstrumentation({\n  ignoreIncomingRequestHook: (request) => {\n    const ignorePatterns = ['\u002Fhealth', '\u002Fready', '\u002Fmetrics', '\u002Ffavicon.ico']\n    return ignorePatterns.some((pattern) => request.url?.includes(pattern))\n  },\n})\n",[221,1763,1764,1774,1778,1793,1810,1844,1873,1878],{"__ignoreMap":329},[333,1765,1766,1768,1770,1772],{"class":335,"line":336},[333,1767,340],{"class":339},[333,1769,1029],{"class":343},[333,1771,347],{"class":339},[333,1773,1034],{"class":350},[333,1775,1776],{"class":335,"line":354},[333,1777,371],{"emptyLinePlaceholder":370},[333,1779,1780,1782,1785,1787,1789,1791],{"class":335,"line":367},[333,1781,377],{"class":339},[333,1783,1784],{"class":380}," httpInstrumentation",[333,1786,384],{"class":339},[333,1788,387],{"class":339},[333,1790,1366],{"class":390},[333,1792,394],{"class":343},[333,1794,1795,1798,1801,1804,1806,1808],{"class":335,"line":374},[333,1796,1797],{"class":390},"  ignoreIncomingRequestHook",[333,1799,1800],{"class":343},": (",[333,1802,1803],{"class":1499},"request",[333,1805,1503],{"class":343},[333,1807,1439],{"class":339},[333,1809,1442],{"class":343},[333,1811,1812,1815,1818,1820,1823,1826,1828,1831,1833,1836,1838,1841],{"class":335,"line":397},[333,1813,1814],{"class":339},"    const",[333,1816,1817],{"class":380}," ignorePatterns",[333,1819,384],{"class":339},[333,1821,1822],{"class":343}," [",[333,1824,1825],{"class":350},"'\u002Fhealth'",[333,1827,519],{"class":343},[333,1829,1830],{"class":350},"'\u002Fready'",[333,1832,519],{"class":343},[333,1834,1835],{"class":350},"'\u002Fmetrics'",[333,1837,519],{"class":343},[333,1839,1840],{"class":350},"'\u002Ffavicon.ico'",[333,1842,1843],{"class":343},"]\n",[333,1845,1846,1849,1852,1855,1857,1860,1862,1864,1867,1870],{"class":335,"line":409},[333,1847,1848],{"class":339},"    return",[333,1850,1851],{"class":343}," ignorePatterns.",[333,1853,1854],{"class":390},"some",[333,1856,1496],{"class":343},[333,1858,1859],{"class":1499},"pattern",[333,1861,1503],{"class":343},[333,1863,1439],{"class":339},[333,1865,1866],{"class":343}," request.url?.",[333,1868,1869],{"class":390},"includes",[333,1871,1872],{"class":343},"(pattern))\n",[333,1874,1875],{"class":335,"line":421},[333,1876,1877],{"class":343},"  },\n",[333,1879,1880],{"class":335,"line":427},[333,1881,424],{"class":343},[1883,1884,1886],"h3",{"id":1885},"semconv-migration","Semconv migration",[217,1888,1889,1890,1892],{},"Starting with ",[221,1891,803],{}," v0.52.0, you can opt into the stable HTTP semantic conventions (v1.23.0) using an environment variable:",[324,1894,1896],{"className":630,"code":1895,"language":632,"meta":329,"style":329},"# Use stable HTTP semconv (recommended for new projects)\nexport OTEL_SEMCONV_STABILITY_OPT_IN=http\n\n# Use both old and new semconv (for gradual migration)\nexport OTEL_SEMCONV_STABILITY_OPT_IN=http\u002Fdup\n",[221,1897,1898,1903,1915,1919,1924],{"__ignoreMap":329},[333,1899,1900],{"class":335,"line":336},[333,1901,1902],{"class":462},"# Use stable HTTP semconv (recommended for new projects)\n",[333,1904,1905,1907,1910,1912],{"class":335,"line":354},[333,1906,639],{"class":339},[333,1908,1909],{"class":343}," OTEL_SEMCONV_STABILITY_OPT_IN",[333,1911,645],{"class":339},[333,1913,1914],{"class":343},"http\n",[333,1916,1917],{"class":335,"line":367},[333,1918,371],{"emptyLinePlaceholder":370},[333,1920,1921],{"class":335,"line":374},[333,1922,1923],{"class":462},"# Use both old and new semconv (for gradual migration)\n",[333,1925,1926,1928,1930,1932],{"class":335,"line":397},[333,1927,639],{"class":339},[333,1929,1909],{"class":343},[333,1931,645],{"class":339},[333,1933,1934],{"class":343},"http\u002Fdup\n",[217,1936,1937],{},"Without this variable set, the instrumentation defaults to the older v1.7.0 conventions.",[230,1939,1941],{"id":1940},"custom-spans","Custom Spans",[217,1943,1944],{},"In addition to automatic instrumentation, you can create custom spans to trace specific operations inside your services:",[324,1946,1948],{"className":326,"code":1947,"language":328,"meta":329,"style":329},"import { Injectable } from '@nestjs\u002Fcommon'\nimport { trace, SpanStatusCode } from '@opentelemetry\u002Fapi'\n\nconst tracer = trace.getTracer('my-nestjs-app')\n\n@Injectable()\nexport class OrderService {\n  async processOrder(orderId: string): Promise\u003COrder> {\n    return tracer.startActiveSpan('process-order', async (span) => {\n      try {\n        span.setAttribute('order.id', orderId)\n\n        const order = await this.orderRepository.findOne(orderId)\n        span.setAttribute('order.status', order.status)\n\n        const result = await this.fulfillmentService.fulfill(order)\n        span.setAttribute('order.fulfilled', true)\n\n        return result\n      } catch (error) {\n        span.recordException(error)\n        span.setStatus({ code: SpanStatusCode.ERROR, message: error.message })\n        throw error\n      } finally {\n        span.end()\n      }\n    })\n  }\n}\n",[221,1949,1950,1962,1974,1978,2000,2004,2014,2026,2060,2091,2098,2114,2118,2143,2157,2161,2183,2201,2205,2213,2223,2233,2249,2257,2265,2274,2279,2284,2288],{"__ignoreMap":329},[333,1951,1952,1954,1957,1959],{"class":335,"line":336},[333,1953,340],{"class":339},[333,1955,1956],{"class":343}," { Injectable } ",[333,1958,347],{"class":339},[333,1960,1961],{"class":350}," '@nestjs\u002Fcommon'\n",[333,1963,1964,1966,1969,1971],{"class":335,"line":354},[333,1965,340],{"class":339},[333,1967,1968],{"class":343}," { trace, SpanStatusCode } ",[333,1970,347],{"class":339},[333,1972,1973],{"class":350}," '@opentelemetry\u002Fapi'\n",[333,1975,1976],{"class":335,"line":367},[333,1977,371],{"emptyLinePlaceholder":370},[333,1979,1980,1982,1985,1987,1990,1993,1995,1997],{"class":335,"line":374},[333,1981,377],{"class":339},[333,1983,1984],{"class":380}," tracer",[333,1986,384],{"class":339},[333,1988,1989],{"class":343}," trace.",[333,1991,1992],{"class":390},"getTracer",[333,1994,1088],{"class":343},[333,1996,403],{"class":350},[333,1998,1999],{"class":343},")\n",[333,2001,2002],{"class":335,"line":397},[333,2003,371],{"emptyLinePlaceholder":370},[333,2005,2006,2009,2012],{"class":335,"line":409},[333,2007,2008],{"class":343},"@",[333,2010,2011],{"class":390},"Injectable",[333,2013,436],{"class":343},[333,2015,2016,2018,2021,2024],{"class":335,"line":421},[333,2017,639],{"class":339},[333,2019,2020],{"class":339}," class",[333,2022,2023],{"class":390}," OrderService",[333,2025,1442],{"class":343},[333,2027,2028,2031,2034,2036,2039,2041,2044,2047,2049,2052,2054,2057],{"class":335,"line":427},[333,2029,2030],{"class":339},"  async",[333,2032,2033],{"class":390}," processOrder",[333,2035,1088],{"class":343},[333,2037,2038],{"class":1499},"orderId",[333,2040,947],{"class":339},[333,2042,2043],{"class":380}," string",[333,2045,2046],{"class":343},")",[333,2048,947],{"class":339},[333,2050,2051],{"class":390}," Promise",[333,2053,706],{"class":343},[333,2055,2056],{"class":390},"Order",[333,2058,2059],{"class":343},"> {\n",[333,2061,2062,2064,2067,2070,2072,2075,2077,2080,2083,2085,2087,2089],{"class":335,"line":869},[333,2063,1848],{"class":339},[333,2065,2066],{"class":343}," tracer.",[333,2068,2069],{"class":390},"startActiveSpan",[333,2071,1088],{"class":343},[333,2073,2074],{"class":350},"'process-order'",[333,2076,519],{"class":343},[333,2078,2079],{"class":339},"async",[333,2081,2082],{"class":343}," (",[333,2084,333],{"class":1499},[333,2086,1503],{"class":343},[333,2088,1439],{"class":339},[333,2090,1442],{"class":343},[333,2092,2093,2096],{"class":335,"line":875},[333,2094,2095],{"class":339},"      try",[333,2097,1442],{"class":343},[333,2099,2100,2103,2106,2108,2111],{"class":335,"line":888},[333,2101,2102],{"class":343},"        span.",[333,2104,2105],{"class":390},"setAttribute",[333,2107,1088],{"class":343},[333,2109,2110],{"class":350},"'order.id'",[333,2112,2113],{"class":343},", orderId)\n",[333,2115,2116],{"class":335,"line":895},[333,2117,371],{"emptyLinePlaceholder":370},[333,2119,2120,2123,2126,2128,2131,2134,2137,2140],{"class":335,"line":902},[333,2121,2122],{"class":339},"        const",[333,2124,2125],{"class":380}," order",[333,2127,384],{"class":339},[333,2129,2130],{"class":339}," await",[333,2132,2133],{"class":380}," this",[333,2135,2136],{"class":343},".orderRepository.",[333,2138,2139],{"class":390},"findOne",[333,2141,2142],{"class":343},"(orderId)\n",[333,2144,2145,2147,2149,2151,2154],{"class":335,"line":909},[333,2146,2102],{"class":343},[333,2148,2105],{"class":390},[333,2150,1088],{"class":343},[333,2152,2153],{"class":350},"'order.status'",[333,2155,2156],{"class":343},", order.status)\n",[333,2158,2159],{"class":335,"line":916},[333,2160,371],{"emptyLinePlaceholder":370},[333,2162,2163,2165,2168,2170,2172,2174,2177,2180],{"class":335,"line":1127},[333,2164,2122],{"class":339},[333,2166,2167],{"class":380}," result",[333,2169,384],{"class":339},[333,2171,2130],{"class":339},[333,2173,2133],{"class":380},[333,2175,2176],{"class":343},".fulfillmentService.",[333,2178,2179],{"class":390},"fulfill",[333,2181,2182],{"class":343},"(order)\n",[333,2184,2185,2187,2189,2191,2194,2196,2199],{"class":335,"line":1139},[333,2186,2102],{"class":343},[333,2188,2105],{"class":390},[333,2190,1088],{"class":343},[333,2192,2193],{"class":350},"'order.fulfilled'",[333,2195,519],{"class":343},[333,2197,2198],{"class":380},"true",[333,2200,1999],{"class":343},[333,2202,2203],{"class":335,"line":1156},[333,2204,371],{"emptyLinePlaceholder":370},[333,2206,2207,2210],{"class":335,"line":1161},[333,2208,2209],{"class":339},"        return",[333,2211,2212],{"class":343}," result\n",[333,2214,2215,2218,2220],{"class":335,"line":1166},[333,2216,2217],{"class":343},"      } ",[333,2219,1493],{"class":339},[333,2221,2222],{"class":343}," (error) {\n",[333,2224,2225,2227,2230],{"class":335,"line":1181},[333,2226,2102],{"class":343},[333,2228,2229],{"class":390},"recordException",[333,2231,2232],{"class":343},"(error)\n",[333,2234,2235,2237,2240,2243,2246],{"class":335,"line":1196},[333,2236,2102],{"class":343},[333,2238,2239],{"class":390},"setStatus",[333,2241,2242],{"class":343},"({ code: SpanStatusCode.",[333,2244,2245],{"class":380},"ERROR",[333,2247,2248],{"class":343},", message: error.message })\n",[333,2250,2251,2254],{"class":335,"line":1207},[333,2252,2253],{"class":339},"        throw",[333,2255,2256],{"class":343}," error\n",[333,2258,2259,2261,2263],{"class":335,"line":1217},[333,2260,2217],{"class":343},[333,2262,1526],{"class":339},[333,2264,1442],{"class":343},[333,2266,2267,2269,2272],{"class":335,"line":1223},[333,2268,2102],{"class":343},[333,2270,2271],{"class":390},"end",[333,2273,436],{"class":343},[333,2275,2276],{"class":335,"line":1234},[333,2277,2278],{"class":343},"      }\n",[333,2280,2281],{"class":335,"line":1247},[333,2282,2283],{"class":343},"    })\n",[333,2285,2286],{"class":335,"line":1260},[333,2287,1692],{"class":343},[333,2289,2290],{"class":335,"line":1280},[333,2291,1697],{"class":343},[217,2293,2294,2295,2297,2298,2301],{},"Use ",[221,2296,2069],{}," instead of ",[221,2299,2300],{},"startSpan"," when you need child spans to be automatically associated with the parent — it sets the span as active in the current context, so any downstream instrumentation (database calls, HTTP requests) will attach to it automatically.",[230,2303,2305],{"id":2304},"database-instrumentation","Database Instrumentation",[217,2307,2308],{},"OpenTelemetry provides span-level visibility into every database query through dedicated instrumentation packages.",[1883,2310,2312],{"id":2311},"typeorm","TypeORM",[217,2314,2315,2317,2318,613,2321,2324],{},[221,2316,445],{}," does not currently include TypeORM instrumentation. It still captures lower-level database spans for drivers such as ",[221,2319,2320],{},"pg",[221,2322,2323],{},"mysql",", but if you want ORM-level TypeORM spans you need to install the package explicitly:",[324,2326,2328],{"className":630,"code":2327,"language":632,"meta":329,"style":329},"npm install @opentelemetry\u002Finstrumentation-typeorm\n",[221,2329,2330],{"__ignoreMap":329},[333,2331,2332,2334,2336],{"class":335,"line":336},[333,2333,784],{"class":390},[333,2335,787],{"class":350},[333,2337,2338],{"class":350}," @opentelemetry\u002Finstrumentation-typeorm\n",[324,2340,2342],{"className":326,"code":2341,"language":328,"meta":329,"style":329},"import { TypeormInstrumentation } from '@opentelemetry\u002Finstrumentation-typeorm'\n\nconst sdk = new NodeSDK({\n  instrumentations: [\n    new HttpInstrumentation(),\n    new ExpressInstrumentation(),\n    new NestInstrumentation(),\n    new TypeormInstrumentation({\n      enhancedDatabaseReporting: true, \u002F\u002F include query params in span attributes\n    }),\n  ],\n})\n",[221,2343,2344,2356,2360,2374,2378,2386,2394,2402,2411,2423,2427,2431],{"__ignoreMap":329},[333,2345,2346,2348,2351,2353],{"class":335,"line":336},[333,2347,340],{"class":339},[333,2349,2350],{"class":343}," { TypeormInstrumentation } ",[333,2352,347],{"class":339},[333,2354,2355],{"class":350}," '@opentelemetry\u002Finstrumentation-typeorm'\n",[333,2357,2358],{"class":335,"line":354},[333,2359,371],{"emptyLinePlaceholder":370},[333,2361,2362,2364,2366,2368,2370,2372],{"class":335,"line":367},[333,2363,377],{"class":339},[333,2365,381],{"class":380},[333,2367,384],{"class":339},[333,2369,387],{"class":339},[333,2371,391],{"class":390},[333,2373,394],{"class":343},[333,2375,2376],{"class":335,"line":374},[333,2377,1357],{"class":343},[333,2379,2380,2382,2384],{"class":335,"line":397},[333,2381,1363],{"class":339},[333,2383,1366],{"class":390},[333,2385,1369],{"class":343},[333,2387,2388,2390,2392],{"class":335,"line":409},[333,2389,1363],{"class":339},[333,2391,1377],{"class":390},[333,2393,1369],{"class":343},[333,2395,2396,2398,2400],{"class":335,"line":421},[333,2397,1363],{"class":339},[333,2399,1387],{"class":390},[333,2401,1369],{"class":343},[333,2403,2404,2406,2409],{"class":335,"line":427},[333,2405,1363],{"class":339},[333,2407,2408],{"class":390}," TypeormInstrumentation",[333,2410,394],{"class":343},[333,2412,2413,2416,2418,2420],{"class":335,"line":869},[333,2414,2415],{"class":343},"      enhancedDatabaseReporting: ",[333,2417,2198],{"class":380},[333,2419,519],{"class":343},[333,2421,2422],{"class":462},"\u002F\u002F include query params in span attributes\n",[333,2424,2425],{"class":335,"line":875},[333,2426,1335],{"class":343},[333,2428,2429],{"class":335,"line":888},[333,2430,1395],{"class":343},[333,2432,2433],{"class":335,"line":895},[333,2434,424],{"class":343},[217,2436,2437,2438,519,2441,524,2444,2447],{},"Each query produces a span with ",[221,2439,2440],{},"db.system.name",[221,2442,2443],{},"db.query.text",[221,2445,2446],{},"db.operation.name"," attributes.",[1883,2449,2451],{"id":2450},"prisma","Prisma",[217,2453,2454,2455,2458],{},"Use the official ",[221,2456,2457],{},"@prisma\u002Finstrumentation"," package:",[324,2460,2462],{"className":630,"code":2461,"language":632,"meta":329,"style":329},"npm install @prisma\u002Finstrumentation\n",[221,2463,2464],{"__ignoreMap":329},[333,2465,2466,2468,2470],{"class":335,"line":336},[333,2467,784],{"class":390},[333,2469,787],{"class":350},[333,2471,2472],{"class":350}," @prisma\u002Finstrumentation\n",[324,2474,2476],{"className":326,"code":2475,"language":328,"meta":329,"style":329},"import { PrismaInstrumentation } from '@prisma\u002Finstrumentation'\n\nconst sdk = new NodeSDK({\n  instrumentations: [\n    new HttpInstrumentation(),\n    new ExpressInstrumentation(),\n    new NestInstrumentation(),\n    new PrismaInstrumentation(),\n  ],\n})\n",[221,2477,2478,2490,2494,2508,2512,2520,2528,2536,2545,2549],{"__ignoreMap":329},[333,2479,2480,2482,2485,2487],{"class":335,"line":336},[333,2481,340],{"class":339},[333,2483,2484],{"class":343}," { PrismaInstrumentation } ",[333,2486,347],{"class":339},[333,2488,2489],{"class":350}," '@prisma\u002Finstrumentation'\n",[333,2491,2492],{"class":335,"line":354},[333,2493,371],{"emptyLinePlaceholder":370},[333,2495,2496,2498,2500,2502,2504,2506],{"class":335,"line":367},[333,2497,377],{"class":339},[333,2499,381],{"class":380},[333,2501,384],{"class":339},[333,2503,387],{"class":339},[333,2505,391],{"class":390},[333,2507,394],{"class":343},[333,2509,2510],{"class":335,"line":374},[333,2511,1357],{"class":343},[333,2513,2514,2516,2518],{"class":335,"line":397},[333,2515,1363],{"class":339},[333,2517,1366],{"class":390},[333,2519,1369],{"class":343},[333,2521,2522,2524,2526],{"class":335,"line":409},[333,2523,1363],{"class":339},[333,2525,1377],{"class":390},[333,2527,1369],{"class":343},[333,2529,2530,2532,2534],{"class":335,"line":421},[333,2531,1363],{"class":339},[333,2533,1387],{"class":390},[333,2535,1369],{"class":343},[333,2537,2538,2540,2543],{"class":335,"line":427},[333,2539,1363],{"class":339},[333,2541,2542],{"class":390}," PrismaInstrumentation",[333,2544,1369],{"class":343},[333,2546,2547],{"class":335,"line":869},[333,2548,1395],{"class":343},[333,2550,2551],{"class":335,"line":875},[333,2552,424],{"class":343},[230,2554,2556],{"id":2555},"distributed-tracing-and-context-propagation","Distributed Tracing and Context Propagation",[217,2558,2559,2560,2564,2565,2567,2568,2571],{},"When NestJS is part of a microservices architecture, ",[285,2561,2563],{"href":2562},"\u002Fopentelemetry\u002Fcontext-propagation","context propagation"," carries trace context across service boundaries automatically. ",[221,2566,1753],{}," injects W3C ",[221,2569,2570],{},"traceparent"," headers into every outgoing HTTP request and extracts them from incoming requests — no manual code required.",[217,2573,2574],{},"For NestJS microservices using gRPC, Kafka, or RabbitMQ, add the corresponding instrumentation package:",[324,2576,2578],{"className":630,"code":2577,"language":632,"meta":329,"style":329},"# gRPC\nnpm install @opentelemetry\u002Finstrumentation-grpc\n\n# Kafka (kafkajs)\nnpm install @opentelemetry\u002Finstrumentation-kafkajs\n",[221,2579,2580,2585,2594,2598,2603],{"__ignoreMap":329},[333,2581,2582],{"class":335,"line":336},[333,2583,2584],{"class":462},"# gRPC\n",[333,2586,2587,2589,2591],{"class":335,"line":354},[333,2588,784],{"class":390},[333,2590,787],{"class":350},[333,2592,2593],{"class":350}," @opentelemetry\u002Finstrumentation-grpc\n",[333,2595,2596],{"class":335,"line":367},[333,2597,371],{"emptyLinePlaceholder":370},[333,2599,2600],{"class":335,"line":374},[333,2601,2602],{"class":462},"# Kafka (kafkajs)\n",[333,2604,2605,2607,2609],{"class":335,"line":397},[333,2606,784],{"class":390},[333,2608,787],{"class":350},[333,2610,2611],{"class":350}," @opentelemetry\u002Finstrumentation-kafkajs\n",[324,2613,2615],{"className":326,"code":2614,"language":328,"meta":329,"style":329},"import { GrpcInstrumentation } from '@opentelemetry\u002Finstrumentation-grpc'\n\nconst sdk = new NodeSDK({\n  instrumentations: [\n    new HttpInstrumentation(),\n    new ExpressInstrumentation(),\n    new NestInstrumentation(),\n    new GrpcInstrumentation(),\n  ],\n})\n",[221,2616,2617,2629,2633,2647,2651,2659,2667,2675,2684,2688],{"__ignoreMap":329},[333,2618,2619,2621,2624,2626],{"class":335,"line":336},[333,2620,340],{"class":339},[333,2622,2623],{"class":343}," { GrpcInstrumentation } ",[333,2625,347],{"class":339},[333,2627,2628],{"class":350}," '@opentelemetry\u002Finstrumentation-grpc'\n",[333,2630,2631],{"class":335,"line":354},[333,2632,371],{"emptyLinePlaceholder":370},[333,2634,2635,2637,2639,2641,2643,2645],{"class":335,"line":367},[333,2636,377],{"class":339},[333,2638,381],{"class":380},[333,2640,384],{"class":339},[333,2642,387],{"class":339},[333,2644,391],{"class":390},[333,2646,394],{"class":343},[333,2648,2649],{"class":335,"line":374},[333,2650,1357],{"class":343},[333,2652,2653,2655,2657],{"class":335,"line":397},[333,2654,1363],{"class":339},[333,2656,1366],{"class":390},[333,2658,1369],{"class":343},[333,2660,2661,2663,2665],{"class":335,"line":409},[333,2662,1363],{"class":339},[333,2664,1377],{"class":390},[333,2666,1369],{"class":343},[333,2668,2669,2671,2673],{"class":335,"line":421},[333,2670,1363],{"class":339},[333,2672,1387],{"class":390},[333,2674,1369],{"class":343},[333,2676,2677,2679,2682],{"class":335,"line":427},[333,2678,1363],{"class":339},[333,2680,2681],{"class":390}," GrpcInstrumentation",[333,2683,1369],{"class":343},[333,2685,2686],{"class":335,"line":869},[333,2687,1395],{"class":343},[333,2689,2690],{"class":335,"line":875},[333,2691,424],{"class":343},[217,2693,2694],{},"With context propagation in place, a single trace links spans from the API gateway through NestJS controllers, downstream microservices, and database queries into one end-to-end view.",[230,2696,2698],{"id":2697},"http-metrics","HTTP Metrics",[217,2700,2701],{},"OpenTelemetry automatically collects HTTP server metrics when metrics export is configured:",[235,2703,2704,2713],{},[238,2705,2706],{},[241,2707,2708,2711],{},[244,2709,2710],{},"Metric",[244,2712,1736],{},[254,2714,2715,2725,2735,2745],{},[241,2716,2717,2722],{},[259,2718,2719],{},[221,2720,2721],{},"http.server.request.duration",[259,2723,2724],{},"Duration of HTTP server requests (histogram)",[241,2726,2727,2732],{},[259,2728,2729],{},[221,2730,2731],{},"http.server.request.body.size",[259,2733,2734],{},"Size of HTTP server request bodies",[241,2736,2737,2742],{},[259,2738,2739],{},[221,2740,2741],{},"http.server.response.body.size",[259,2743,2744],{},"Size of HTTP server response bodies",[241,2746,2747,2752],{},[259,2748,2749],{},[221,2750,2751],{},"http.server.active_requests",[259,2753,2754],{},"Number of concurrent active requests",[217,2756,2757,2758,2760,2761,2764],{},"These metrics are emitted by ",[221,2759,1753],{}," and available in your backend as soon as the ",[221,2762,2763],{},"PeriodicExportingMetricReader"," is configured. In Uptrace, they appear in the built-in HTTP dashboard under the service name.",[217,2766,2767,2768,552],{},"For custom business metrics (counters, gauges, histograms), see the ",[285,2769,2770],{"href":522},"OpenTelemetry Metrics guide",[230,2772,2774],{"id":2773},"production-configuration","Production Configuration",[1883,2776,2778],{"id":2777},"sampling","Sampling",[217,2780,2781],{},"At full request volume, exporting 100% of traces is expensive. Configure a ratio-based sampler via environment variables — no code changes required:",[324,2783,2785],{"className":630,"code":2784,"language":632,"meta":329,"style":329},"OTEL_TRACES_SAMPLER=parentbased_traceidratio\nOTEL_TRACES_SAMPLER_ARG=0.1\n",[221,2786,2787,2797],{"__ignoreMap":329},[333,2788,2789,2792,2794],{"class":335,"line":336},[333,2790,2791],{"class":343},"OTEL_TRACES_SAMPLER",[333,2793,645],{"class":339},[333,2795,2796],{"class":350},"parentbased_traceidratio\n",[333,2798,2799,2802,2804],{"class":335,"line":354},[333,2800,2801],{"class":343},"OTEL_TRACES_SAMPLER_ARG",[333,2803,645],{"class":339},[333,2805,2806],{"class":350},"0.1\n",[217,2808,2809,2812,2813,2816,2817,552],{},[221,2810,2811],{},"parentbased_traceidratio"," at ",[221,2814,2815],{},"0.1"," samples 10% of new root traces while respecting the sampling decision of upstream services. Adjust the ratio based on your request volume and cost. For a full explanation of sampler types, see the ",[285,2818,2820],{"href":2819},"\u002Fopentelemetry\u002Fsampling","OpenTelemetry Sampling guide",[217,2822,2823,2824,947],{},"Or configure the sampler inline in ",[221,2825,1579],{},[324,2827,2829],{"className":326,"code":2828,"language":328,"meta":329,"style":329},"import { TraceIdRatioBasedSampler, ParentBasedSampler } from '@opentelemetry\u002Fsdk-trace-base'\n\nconst sdk = new NodeSDK({\n  sampler: new ParentBasedSampler({\n    root: new TraceIdRatioBasedSampler(\n      process.env.NODE_ENV === 'production' ? 0.1 : 1.0\n    ),\n  }),\n  \u002F\u002F ... rest of config\n})\n",[221,2830,2831,2842,2846,2860,2872,2885,2910,2915,2919,2924],{"__ignoreMap":329},[333,2832,2833,2835,2838,2840],{"class":335,"line":336},[333,2834,340],{"class":339},[333,2836,2837],{"class":343}," { TraceIdRatioBasedSampler, ParentBasedSampler } ",[333,2839,347],{"class":339},[333,2841,964],{"class":350},[333,2843,2844],{"class":335,"line":354},[333,2845,371],{"emptyLinePlaceholder":370},[333,2847,2848,2850,2852,2854,2856,2858],{"class":335,"line":367},[333,2849,377],{"class":339},[333,2851,381],{"class":380},[333,2853,384],{"class":339},[333,2855,387],{"class":339},[333,2857,391],{"class":390},[333,2859,394],{"class":343},[333,2861,2862,2865,2867,2870],{"class":335,"line":374},[333,2863,2864],{"class":343},"  sampler: ",[333,2866,1187],{"class":339},[333,2868,2869],{"class":390}," ParentBasedSampler",[333,2871,394],{"class":343},[333,2873,2874,2877,2879,2882],{"class":335,"line":397},[333,2875,2876],{"class":343},"    root: ",[333,2878,1187],{"class":339},[333,2880,2881],{"class":390}," TraceIdRatioBasedSampler",[333,2883,2884],{"class":343},"(\n",[333,2886,2887,2890,2892,2895,2898,2901,2904,2907],{"class":335,"line":409},[333,2888,2889],{"class":343},"      process.env.",[333,2891,1269],{"class":380},[333,2893,2894],{"class":339}," ===",[333,2896,2897],{"class":350}," 'production'",[333,2899,2900],{"class":339}," ?",[333,2902,2903],{"class":380}," 0.1",[333,2905,2906],{"class":339}," :",[333,2908,2909],{"class":380}," 1.0\n",[333,2911,2912],{"class":335,"line":421},[333,2913,2914],{"class":343},"    ),\n",[333,2916,2917],{"class":335,"line":427},[333,2918,1220],{"class":343},[333,2920,2921],{"class":335,"line":869},[333,2922,2923],{"class":462},"  \u002F\u002F ... rest of config\n",[333,2925,2926],{"class":335,"line":875},[333,2927,424],{"class":343},[1883,2929,2931],{"id":2930},"batch-processor-tuning","Batch processor tuning",[217,2933,2934,2935,2938],{},"For high-throughput services, tune the ",[221,2936,2937],{},"BatchSpanProcessor"," to avoid queue overflow:",[324,2940,2942],{"className":326,"code":2941,"language":328,"meta":329,"style":329},"new BatchSpanProcessor(traceExporter, {\n  maxExportBatchSize: 512,\n  maxQueueSize: 2048,\n  scheduledDelayMillis: 5000,\n  exportTimeoutMillis: 30000,\n})\n",[221,2943,2944,2952,2962,2972,2982,2992],{"__ignoreMap":329},[333,2945,2946,2948,2950],{"class":335,"line":336},[333,2947,1187],{"class":339},[333,2949,1190],{"class":390},[333,2951,1193],{"class":343},[333,2953,2954,2957,2960],{"class":335,"line":354},[333,2955,2956],{"class":343},"  maxExportBatchSize: ",[333,2958,2959],{"class":380},"512",[333,2961,406],{"class":343},[333,2963,2964,2967,2970],{"class":335,"line":367},[333,2965,2966],{"class":343},"  maxQueueSize: ",[333,2968,2969],{"class":380},"2048",[333,2971,406],{"class":343},[333,2973,2974,2977,2980],{"class":335,"line":374},[333,2975,2976],{"class":343},"  scheduledDelayMillis: ",[333,2978,2979],{"class":380},"5000",[333,2981,406],{"class":343},[333,2983,2984,2987,2990],{"class":335,"line":397},[333,2985,2986],{"class":343},"  exportTimeoutMillis: ",[333,2988,2989],{"class":380},"30000",[333,2991,406],{"class":343},[333,2993,2994],{"class":335,"line":409},[333,2995,424],{"class":343},[217,2997,2998,2999,3002,3003,3006],{},"Increase ",[221,3000,3001],{},"maxQueueSize"," if you see ",[221,3004,3005],{},"BatchSpanProcessor queue size limit reached"," in logs — this means spans are being dropped.",[230,3008,3010],{"id":3009},"deploying-with-docker","Deploying with Docker",[217,3012,3013,3014,3016,3017,3020],{},"Use the ",[221,3015,227],{}," flag in your Dockerfile ",[221,3018,3019],{},"CMD"," to ensure the SDK initializes before NestJS:",[324,3022,3026],{"className":3023,"code":3024,"language":3025,"meta":329,"style":329},"language-dockerfile shiki shiki-themes github-light","FROM node:22-alpine AS builder\nWORKDIR \u002Fapp\nCOPY package*.json .\u002F\nRUN npm ci\nCOPY . .\nRUN npm run build\n\nFROM node:22-alpine AS runner\nWORKDIR \u002Fapp\nENV NODE_ENV=production\nCOPY --from=builder \u002Fapp\u002Fnode_modules .\u002Fnode_modules\nCOPY --from=builder \u002Fapp\u002Fdist .\u002Fdist\nEXPOSE 3000\nCMD [\"node\", \"--require\", \".\u002Fdist\u002Fotel.js\", \"dist\u002Fmain.js\"]\n","dockerfile",[221,3027,3028,3033,3038,3043,3048,3053,3058,3062,3067,3071,3076,3081,3086,3091],{"__ignoreMap":329},[333,3029,3030],{"class":335,"line":336},[333,3031,3032],{},"FROM node:22-alpine AS builder\n",[333,3034,3035],{"class":335,"line":354},[333,3036,3037],{},"WORKDIR \u002Fapp\n",[333,3039,3040],{"class":335,"line":367},[333,3041,3042],{},"COPY package*.json .\u002F\n",[333,3044,3045],{"class":335,"line":374},[333,3046,3047],{},"RUN npm ci\n",[333,3049,3050],{"class":335,"line":397},[333,3051,3052],{},"COPY . .\n",[333,3054,3055],{"class":335,"line":409},[333,3056,3057],{},"RUN npm run build\n",[333,3059,3060],{"class":335,"line":421},[333,3061,371],{"emptyLinePlaceholder":370},[333,3063,3064],{"class":335,"line":427},[333,3065,3066],{},"FROM node:22-alpine AS runner\n",[333,3068,3069],{"class":335,"line":869},[333,3070,3037],{},[333,3072,3073],{"class":335,"line":875},[333,3074,3075],{},"ENV NODE_ENV=production\n",[333,3077,3078],{"class":335,"line":888},[333,3079,3080],{},"COPY --from=builder \u002Fapp\u002Fnode_modules .\u002Fnode_modules\n",[333,3082,3083],{"class":335,"line":895},[333,3084,3085],{},"COPY --from=builder \u002Fapp\u002Fdist .\u002Fdist\n",[333,3087,3088],{"class":335,"line":902},[333,3089,3090],{},"EXPOSE 3000\n",[333,3092,3093],{"class":335,"line":909},[333,3094,3095],{},"CMD [\"node\", \"--require\", \".\u002Fdist\u002Fotel.js\", \"dist\u002Fmain.js\"]\n",[217,3097,3098],{},"Pass backend credentials at runtime so they stay out of the image:",[324,3100,3104],{"className":3101,"code":3102,"language":3103,"meta":329,"style":329},"language-yaml shiki shiki-themes github-light","# docker-compose.yml\nservices:\n  api:\n    build: .\n    environment:\n      - UPTRACE_DSN=https:\u002F\u002F\u003Csecret>@api.uptrace.dev\n      - NODE_ENV=production\n      - OTEL_TRACES_SAMPLER=parentbased_traceidratio\n      - OTEL_TRACES_SAMPLER_ARG=0.1\n    ports:\n      - '3000:3000'\n","yaml",[221,3105,3106,3111,3120,3127,3137,3144,3152,3159,3166,3173,3180],{"__ignoreMap":329},[333,3107,3108],{"class":335,"line":336},[333,3109,3110],{"class":462},"# docker-compose.yml\n",[333,3112,3113,3117],{"class":335,"line":354},[333,3114,3116],{"class":3115},"shJU0","services",[333,3118,3119],{"class":343},":\n",[333,3121,3122,3125],{"class":335,"line":367},[333,3123,3124],{"class":3115},"  api",[333,3126,3119],{"class":343},[333,3128,3129,3132,3134],{"class":335,"line":374},[333,3130,3131],{"class":3115},"    build",[333,3133,1240],{"class":343},[333,3135,3136],{"class":380},".\n",[333,3138,3139,3142],{"class":335,"line":397},[333,3140,3141],{"class":3115},"    environment",[333,3143,3119],{"class":343},[333,3145,3146,3149],{"class":335,"line":409},[333,3147,3148],{"class":343},"      - ",[333,3150,3151],{"class":350},"UPTRACE_DSN=https:\u002F\u002F\u003Csecret>@api.uptrace.dev\n",[333,3153,3154,3156],{"class":335,"line":421},[333,3155,3148],{"class":343},[333,3157,3158],{"class":350},"NODE_ENV=production\n",[333,3160,3161,3163],{"class":335,"line":427},[333,3162,3148],{"class":343},[333,3164,3165],{"class":350},"OTEL_TRACES_SAMPLER=parentbased_traceidratio\n",[333,3167,3168,3170],{"class":335,"line":869},[333,3169,3148],{"class":343},[333,3171,3172],{"class":350},"OTEL_TRACES_SAMPLER_ARG=0.1\n",[333,3174,3175,3178],{"class":335,"line":875},[333,3176,3177],{"class":3115},"    ports",[333,3179,3119],{"class":343},[333,3181,3182,3184],{"class":335,"line":888},[333,3183,3148],{"class":343},[333,3185,3186],{"class":350},"'3000:3000'\n",[230,3188,3190],{"id":3189},"troubleshooting","Troubleshooting",[217,3192,3193,3196,3199,3200,3203,3204,3206,3207,3209,3210,3213],{},[320,3194,3195],{},"No traces appearing",[3197,3198],"br",{},"\nConfirm you are using ",[221,3201,3202],{},"--require .\u002Fdist\u002Fotel.js"," and not importing ",[221,3205,1579],{}," from inside ",[221,3208,1709],{},". Add ",[221,3211,3212],{},"OTEL_LOG_LEVEL=debug"," to see SDK startup logs and verify the exporter endpoint is reachable.",[217,3215,3216,3219,3221,3223,3224,3227,3228,3230],{},[320,3217,3218],{},"Missing spans for controllers",[3197,3220],{},[221,3222,803],{}," must be listed in the ",[221,3225,3226],{},"instrumentations"," array. If you use ",[221,3229,445],{},", it is included automatically. Confirm the package version is ≥ 0.40.0.",[217,3232,3233,3236,3238,3239,3241,3242,3244],{},[320,3234,3235],{},"Incomplete traces across services",[3197,3237],{},"\nIf child spans from downstream services appear as separate traces, context propagation is broken. Verify both services have ",[221,3240,1753],{}," configured and that the upstream service injects ",[221,3243,2570],{}," headers into outgoing requests.",[217,3246,3247,3250,3252,3253,3255,3256,3258],{},[320,3248,3249],{},"High memory usage",[3197,3251],{},"\nReduce ",[221,3254,3001],{}," in ",[221,3257,2937],{}," or lower the sampling rate. The default queue holds up to 2048 spans in memory; at high request volumes this can accumulate if the exporter is slow.",[217,3260,3261,3264,3266,3269,3270,3272,3273,3276,3277,3279],{},[320,3262,3263],{},"Fastify adapter",[3197,3265],{},[221,3267,3268],{},"@opentelemetry\u002Finstrumentation-fastify"," was removed from ",[221,3271,924],{}," in March 2026. Use ",[221,3274,3275],{},"@fastify\u002Fotel"," — the official Fastify OpenTelemetry plugin — instead. ",[221,3278,803],{}," works with both adapters.",[230,3281,3283],{"id":3282},"what-is-uptrace","What is Uptrace?",[217,3285,3286,3287,3291,3292,552],{},"Uptrace is an ",[285,3288,3290],{"href":3289},"\u002Fopentelemetry\u002Fapm","OpenTelemetry APM"," that supports distributed tracing, metrics, and logs. You can use it to monitor applications and troubleshoot issues. For Node.js instrumentation, see the ",[285,3293,3295],{"href":3294},"\u002Fget\u002Fopentelemetry-js","OpenTelemetry JavaScript guide",[217,3297,3298],{},[3299,3300],"img",{"alt":3301,"src":3302},"Uptrace Overview","\u002Fhome\u002Fscreenshots\u002Fapm.png",[217,3304,3305],{},"Uptrace comes with an intuitive query builder, rich dashboards, alerting rules with notifications, and integrations for most languages and frameworks.",[217,3307,3308],{},"Uptrace can process billions of spans and metrics on a single server and allows you to monitor your applications at 10x lower cost.",[217,3310,3311,3312,3318,3319,3323,3324,552],{},"In just a few minutes, you can try Uptrace by visiting the ",[285,3313,3317],{"href":3314,"rel":3315},"https:\u002F\u002Fplay.uptrace.dev\u002F",[3316],"nofollow","cloud demo"," (no login required) or running it locally with ",[285,3320,3322],{"href":3321},"\u002Fget\u002Fhosted\u002Fdocker","Docker",". The source code is available on ",[285,3325,3328],{"href":3326,"rel":3327},"https:\u002F\u002Fgithub.com\u002Fuptrace\u002Fuptrace",[3316],"GitHub",[230,3330,3332],{"id":3331},"faq","FAQ",[217,3334,3335,3341,3343,3344,3347,3348,613,3351,552],{},[320,3336,3337,3338,3340],{},"What does ",[221,3339,803],{}," instrument?",[3197,3342],{},"\nIt instruments NestJS-specific application layers: the ",[221,3345,3346],{},"NestFactory.create"," bootstrap call, controller method handlers, and the full request context lifecycle. For HTTP transport (request\u002Fresponse, status codes, headers), you still need ",[221,3349,3350],{},"@opentelemetry\u002Finstrumentation-http",[221,3352,3353],{},"@opentelemetry\u002Finstrumentation-express",[217,3355,3356,3359,3361,3362,3365,3366,3368,3369,3372,3373,3375,3376,3379],{},[320,3357,3358],{},"Why are my traces missing or incomplete?",[3197,3360],{},"\nThe most likely cause is initialization order. OpenTelemetry must be loaded before NestJS bootstraps. Move your ",[221,3363,3364],{},"sdk.start()"," call to a separate ",[221,3367,1579],{}," file and load it with ",[221,3370,3371],{},"--require .\u002Fotel.js"," instead of importing it at the top of ",[221,3374,1709],{},". See the ",[285,3377,1566],{"href":3378},"#critical-initialization-order"," section for details.",[217,3381,3382,3385,3387,3388,3390,3391,3393,3394,3396,3397,3399,3400,3402],{},[320,3383,3384],{},"Does this work with NestJS on Fastify?",[3197,3386],{},"\nYes, but replace ",[221,3389,3353],{}," with ",[221,3392,3275],{}," — the official Fastify OpenTelemetry plugin. The ",[221,3395,3268],{}," package was removed from ",[221,3398,924],{}," in March 2026. The ",[221,3401,803],{}," package works with both adapters.",[217,3404,3405,3408,3410,3411,519,3414,3417],{},[320,3406,3407],{},"Does OpenTelemetry work with NestJS microservices?",[3197,3409],{},"\nYes. OpenTelemetry instruments the transport layer, so gRPC, Kafka, RabbitMQ, and Redis-based microservices are covered by their respective instrumentation packages (",[221,3412,3413],{},"@opentelemetry\u002Finstrumentation-grpc",[221,3415,3416],{},"@opentelemetry\u002Finstrumentation-kafkajs",", etc.). Context propagation across microservice boundaries works automatically as long as the receiving service also runs OTel instrumentation.",[217,3419,3420,3423,3425,3426,3429,3430,3432,3433,3435,3436,3438],{},[320,3421,3422],{},"How do I trace TypeORM or Prisma database queries?",[3197,3424],{},"\nUse ",[221,3427,3428],{},"@opentelemetry\u002Finstrumentation-typeorm"," for TypeORM or ",[221,3431,2457],{}," for Prisma. Both can be added to the ",[221,3434,3226],{}," array in your SDK configuration. ",[221,3437,445],{}," does not currently include TypeORM, so install it explicitly if you want ORM-level spans.",[217,3440,3441,3444,3446,3447,3449,3450,613,3453,3456],{},[320,3442,3443],{},"What is the performance overhead of OpenTelemetry in production?",[3197,3445],{},"\nWith ",[221,3448,2937],{}," and a reasonable sampling rate, the overhead is typically under 3-5% for most NestJS applications. The batch processor buffers spans in memory and exports them asynchronously, minimizing impact on request latency. For high-traffic services, configure head-based sampling using ",[221,3451,3452],{},"OTEL_TRACES_SAMPLER=parentbased_traceidratio",[221,3454,3455],{},"OTEL_TRACES_SAMPLER_ARG=0.1"," to sample 10% of traces.",[217,3458,3459,3462,3464,3465,3468,3469,613,3472,2447],{},[320,3460,3461],{},"Can I use OpenTelemetry with NestJS and GraphQL?",[3197,3463],{},"\nYes. Add ",[221,3466,3467],{},"@opentelemetry\u002Finstrumentation-graphql"," to your SDK configuration. It traces resolver execution, query parsing, and validation. Each GraphQL operation appears as a span with ",[221,3470,3471],{},"graphql.operation.type",[221,3473,3474],{},"graphql.operation.name",[230,3476,3478],{"id":3477},"whats-next","What's Next?",[217,3480,3481],{},"With NestJS instrumented, connect it to the rest of your stack for end-to-end visibility:",[3483,3484,3485,3495,3504,3512],"ul",{},[3486,3487,3488,1240,3491,3494],"li",{},[320,3489,3490],{},"Express services",[285,3492,3493],{"href":38},"OpenTelemetry Express guide"," for other Node.js services in the same stack",[3486,3496,3497,1240,3500,3503],{},[320,3498,3499],{},"Frontend",[285,3501,3502],{"href":3294},"OpenTelemetry JavaScript"," browser instrumentation to track sessions end-to-end",[3486,3505,3506,1240,3508,3511],{},[320,3507,2778],{},[285,3509,3510],{"href":2819},"OpenTelemetry Sampling"," for production cost control",[3486,3513,3514,1240,3517,3520],{},[320,3515,3516],{},"Context propagation",[285,3518,3519],{"href":2562},"OpenTelemetry context propagation"," for microservice architectures",[3522,3523,3524],"style",{},"html pre.shiki code .sD7c4, html code.shiki .sD7c4{--shiki-default:#D73A49}html pre.shiki code .sgsFI, html code.shiki .sgsFI{--shiki-default:#24292E}html pre.shiki code .sYBdl, html code.shiki .sYBdl{--shiki-default:#032F62}html pre.shiki code .sYu0t, html code.shiki .sYu0t{--shiki-default:#005CC5}html pre.shiki code .s7eDp, html code.shiki .s7eDp{--shiki-default:#6F42C1}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 pre.shiki code .sAwPA, html code.shiki .sAwPA{--shiki-default:#6A737D}html pre.shiki code .sqxcx, html code.shiki .sqxcx{--shiki-default:#E36209}html pre.shiki code .shJU0, html code.shiki .shJU0{--shiki-default:#22863A}",{"title":329,"searchDepth":374,"depth":354,"links":3526},[3527,3528,3529,3530,3531,3532,3533,3534,3535,3538,3539,3543,3544,3545,3549,3550,3551,3552,3553],{"id":232,"depth":354,"text":233},{"id":500,"depth":354,"text":501},{"id":510,"depth":354,"text":511},{"id":555,"depth":354,"text":556},{"id":620,"depth":354,"text":621},{"id":796,"depth":354,"text":797},{"id":938,"depth":354,"text":288},{"id":1565,"depth":354,"text":1566},{"id":1716,"depth":354,"text":1717,"children":3536},[3537],{"id":1885,"depth":367,"text":1886},{"id":1940,"depth":354,"text":1941},{"id":2304,"depth":354,"text":2305,"children":3540},[3541,3542],{"id":2311,"depth":367,"text":2312},{"id":2450,"depth":367,"text":2451},{"id":2555,"depth":354,"text":2556},{"id":2697,"depth":354,"text":2698},{"id":2773,"depth":354,"text":2774,"children":3546},[3547,3548],{"id":2777,"depth":367,"text":2778},{"id":2930,"depth":367,"text":2931},{"id":3009,"depth":354,"text":3010},{"id":3189,"depth":354,"text":3190},{"id":3282,"depth":354,"text":3283},{"id":3331,"depth":354,"text":3332},{"id":3477,"depth":354,"text":3478},"2026-04-22","Instrument a NestJS application with OpenTelemetry — auto-instrumentation, custom spans, distributed tracing, and exporting traces and metrics to Uptrace.","md","\u002Fguides\u002Fopentelemetry-nestjs\u002Fcover.webp",{"keyword_difficulty":3559,"readingTime":3560},"medium",{"text":3561,"minutes":3562,"time":3563,"words":3564},"11 min read",10.745,644700,2149,{"title":113,"description":3555},"cTnfL3vWo0LRdz7NfgQqioNu9lmzjf3oXtSfQpwvuRw",[3568,3570],{"title":109,"path":110,"stem":111,"description":3569,"children":-1},"Monitor your MySQL database using OpenTelemetry Collector mysql receiver and SDK instrumentation. Track query performance, connections, buffer pool usage, and replication lag.",{"title":117,"path":118,"stem":119,"description":3571,"children":-1},"OpenTelemetry otelhttp instrumentation guide for Go net\u002Fhttp applications. Learn HTTP server and client setup with distributed tracing and metrics collection.",1778588614241]