[{"data":1,"prerenderedAt":636},["ShallowReactive",2],{"docs-pages-en":3,"doc-en-node-database":154},[4,11,16,21,26,31,37,48,56,65,73,80,88,92,101,105,113,118,123,128,134,139,144,149],{"path":5,"title":6,"description":7,"order":8,"group":9,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Finstallation","Installation","Install CloseYourIt on your own server with one command.",1,"start",null,{"path":12,"title":13,"description":14,"order":15,"group":9,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fsettings","Settings","Every setting in the .env file, what it does and which ones you must never change.",2,{"path":17,"title":18,"description":19,"order":20,"group":9,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fdatabase","Database","What the database is, what is inside, how long data stays and how much room it takes.",3,{"path":22,"title":23,"description":24,"order":25,"group":9,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fupdates-and-backups","Updates and backups","Update to a new version, back up and restore the database, check the install.",4,{"path":27,"title":28,"description":29,"order":30,"group":9,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Ftroubleshooting","Troubleshooting","What to check when the install, the certificate, email or incoming data do not work.",5,{"path":32,"title":33,"description":34,"order":35,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fconnect-your-apps","Connect your apps","Every tool that sends data to CloseYourIt, and what each one collects.",6,"connect",{"path":38,"title":39,"description":40,"order":41,"group":10,"parent":42,"package":43,"note":44,"collects":45,"status":10},"\u002Fdocs\u002Fsdk-ruby","Ruby \u002F Rails","The closeyourit-ruby gem sends errors, logs, slow queries and job metrics from a Rails app.",7,"connect-your-apps","closeyourit-ruby","Errors, logs, slow queries and methods, background jobs.",{"errors":46,"logs":46,"performance":46,"visits":47,"servers":47},"full","none",{"path":49,"title":50,"description":51,"order":52,"group":10,"parent":42,"package":53,"note":54,"collects":55,"status":10},"\u002Fdocs\u002Fsdk-javascript","JavaScript","The @bussolabs\u002Fcloseyourit-js package works in the browser and on Node 20.16 or newer.",8,"@bussolabs\u002Fcloseyourit-js","Browser and Node, framework adapters and database queries from 0.13.0.",{"errors":46,"logs":46,"performance":46,"visits":46,"servers":47},{"path":57,"title":58,"description":59,"order":60,"group":10,"parent":42,"package":61,"note":62,"collects":63,"status":10},"\u002Fdocs\u002Fsdk-dart","Dart \u002F Flutter","The closeyourit package captures the errors of Flutter apps, even when the phone is offline.",9,"closeyourit","Public errors, logs and metrics from 0.9.3.",{"errors":46,"logs":64,"performance":64,"visits":47,"servers":47},"partial",{"path":66,"title":67,"description":68,"order":69,"group":10,"parent":42,"package":61,"note":70,"collects":71,"status":72},"\u002Fdocs\u002Fsdk-python","Python","The closeyourit package sends errors, logs and metrics from server-side Python applications.",10,"Server side. SQLAlchemy; Django query monitoring and FastAPI\u002FStarlette from 0.4.0.",{"errors":46,"logs":46,"performance":64,"visits":47,"servers":47},"pre_alpha",{"path":74,"title":75,"description":76,"order":77,"group":10,"parent":42,"package":75,"note":78,"collects":79,"status":10},"\u002Fdocs\u002Fsdk-sentry","Sentry SDK","Send errors with a compatible Sentry SDK; sessions and crashes have separate profiles.",11,"Compatible errors; sessions and crashes require a verified profile.",{"errors":46,"logs":47,"performance":47,"visits":47,"servers":47},{"path":81,"title":82,"description":83,"order":84,"group":10,"parent":42,"package":85,"note":86,"collects":87,"status":10},"\u002Fdocs\u002Fagent-server","Server agent","A small program on the server that sends the state of the machine every 60 seconds.",12,"closeyourit-agent","CPU, memory, disks, network, containers and services.",{"errors":47,"logs":64,"performance":47,"visits":47,"servers":46},{"path":89,"title":90,"description":91,"order":84,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fnuxt","Vue and Nuxt","Connect Nuxt browser errors and Nitro server errors without exposing a server token.",{"path":93,"title":94,"description":95,"order":96,"group":10,"parent":42,"package":97,"note":98,"collects":99,"status":100},"\u002Fdocs\u002Fagent-kubernetes","Kubernetes","A read-only observer of the cluster: one copy per cluster.",13,"closeyourit-kube","Machines, apps and error events of the cluster.",{"errors":47,"logs":47,"performance":47,"visits":47,"servers":46},"coming",{"path":102,"title":103,"description":104,"order":96,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fopentelemetry","OpenTelemetry","Send server traces, metrics and logs through the optional OTLP receiver.",{"path":106,"title":107,"description":108,"order":109,"group":10,"parent":42,"package":110,"note":111,"collects":112,"status":10},"\u002Fdocs\u002Fcli","cyi CLI","The closeyourit command, cyi for short: manage projects, errors and tickets from the terminal.",14,"@bussolabs\u002Fcloseyourit-cli","It collects no data: it drives CloseYourIt from the terminal.",{"errors":47,"logs":47,"performance":47,"visits":47,"servers":47},{"path":114,"title":115,"description":116,"order":117,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fhttp-api","HTTP API","Send errors, logs, metrics and page views with plain HTTP requests, without an SDK.",15,{"path":119,"title":120,"description":121,"order":122,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fgithub-app","GitHub","Connect GitHub repositories to tickets and releases with your own GitHub App.",16,{"path":124,"title":125,"description":126,"order":127,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fingest-gateway","Ingest gateway","Keep incoming errors, logs and metrics safe when the app is slow or restarting.",17,{"path":129,"title":130,"description":131,"order":132,"group":133,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fai","AI","Turn on assistant, analysis, dictation and smart search with a CloseYourIt AI key or your own provider.",18,"automation",{"path":135,"title":136,"description":137,"order":138,"group":133,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fautomator","Automator","Let tickets be worked automatically on your own Linux machine, with Claude Code, Codex or both.",19,{"path":140,"title":141,"description":142,"order":143,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fstack-coverage","Frameworks and stack coverage","Choose a published SDK or understand the limits of a locally tested integration.",20,{"path":145,"title":146,"description":147,"order":148,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fmonitoring","Traces, measurements and sessions","Explore the new signals, compare releases and recover original error locations.",21,{"path":150,"title":151,"description":152,"order":153,"group":36,"parent":10,"package":10,"note":10,"collects":10,"status":10},"\u002Fdocs\u002Fnode-database","Node databases","Monitor slow and repeated queries with pg, mysql2, Drizzle and Prisma PostgreSQL.",22,{"id":155,"title":151,"body":156,"collects":10,"description":152,"extension":631,"group":36,"meta":632,"navigation":249,"note":10,"order":153,"package":10,"parent":10,"path":150,"seo":633,"status":10,"stem":634,"__hash__":635},"docs_en\u002Fdocs\u002Fnode-database.md",{"type":157,"value":158,"toc":626},"minimark",[159,177,182,193,536,551,564,568,587,593,597,600,611,622],[160,161,162,163,167,168,172,173,176],"p",{},"The JavaScript SDK ",[164,165,166],"strong",{},"0.13.0"," ",[169,170,171],"code",{},"\u002Fdatabase"," entry observes application-owned pg and mysql2 instances. It emits native ",[169,174,175],{},"slow_query"," measurements and repeated-query verdicts; it does not create OpenTelemetry traces. It is disabled by default.",[178,179,181],"h2",{"id":180},"postgresql","PostgreSQL",[160,183,184,185,188,189,192],{},"Install ",[169,186,187],{},"@bussolabs\u002Fcloseyourit-js@^0.13.0"," and the ",[169,190,191],{},"pg"," driver compatible with your application. Supply connection settings and credentials only at runtime, on the server. This example runs a real query and closes resources afterward; in a server, install once at startup and close on shutdown.",[194,195,200],"pre",{"className":196,"code":197,"language":198,"meta":199,"style":199},"language-ts shiki shiki-themes github-light github-dark","import pg from 'pg'\nimport { Client } from '@bussolabs\u002Fcloseyourit-js'\nimport { DatabaseMonitoring } from '@bussolabs\u002Fcloseyourit-js\u002Fdatabase'\n\nconst client = new Client({\n  endpointUrl: process.env.CLOSEYOURIT_ENDPOINT_URL!,\n  projectId: process.env.CLOSEYOURIT_PROJECT_ID!,\n  token: process.env.CLOSEYOURIT_TOKEN,\n  environment: process.env.NODE_ENV,\n  release: process.env.APP_VERSION,\n})\nconst pool = new pg.Pool()\nconst monitoring = new DatabaseMonitoring(client, {\n  enabled: true,\n  slowQueryThresholdMs: 100,\n  repeatedQueryThreshold: 5,\n})\nmonitoring.instrumentPostgres(pool)\n\nawait client.runWithScope(() =>\n  monitoring.profile(async () => {\n    await pool.query('SELECT $1::integer AS value', [1])\n  }),\n)\n\nmonitoring.uninstall()\nawait client.close()\nawait pool.end()\n","ts","",[169,201,202,221,233,245,251,273,287,299,309,319,329,334,354,371,381,391,401,405,416,420,437,460,485,491,497,502,512,524],{"__ignoreMap":199},[203,204,206,210,214,217],"span",{"class":205,"line":8},"line",[203,207,209],{"class":208},"szBVR","import",[203,211,213],{"class":212},"sVt8B"," pg ",[203,215,216],{"class":208},"from",[203,218,220],{"class":219},"sZZnC"," 'pg'\n",[203,222,223,225,228,230],{"class":205,"line":15},[203,224,209],{"class":208},[203,226,227],{"class":212}," { Client } ",[203,229,216],{"class":208},[203,231,232],{"class":219}," '@bussolabs\u002Fcloseyourit-js'\n",[203,234,235,237,240,242],{"class":205,"line":20},[203,236,209],{"class":208},[203,238,239],{"class":212}," { DatabaseMonitoring } ",[203,241,216],{"class":208},[203,243,244],{"class":219}," '@bussolabs\u002Fcloseyourit-js\u002Fdatabase'\n",[203,246,247],{"class":205,"line":25},[203,248,250],{"emptyLinePlaceholder":249},true,"\n",[203,252,253,256,260,263,266,270],{"class":205,"line":30},[203,254,255],{"class":208},"const",[203,257,259],{"class":258},"sj4cs"," client",[203,261,262],{"class":208}," =",[203,264,265],{"class":208}," new",[203,267,269],{"class":268},"sScJk"," Client",[203,271,272],{"class":212},"({\n",[203,274,275,278,281,284],{"class":205,"line":35},[203,276,277],{"class":212},"  endpointUrl: process.env.",[203,279,280],{"class":258},"CLOSEYOURIT_ENDPOINT_URL",[203,282,283],{"class":208},"!",[203,285,286],{"class":212},",\n",[203,288,289,292,295,297],{"class":205,"line":41},[203,290,291],{"class":212},"  projectId: process.env.",[203,293,294],{"class":258},"CLOSEYOURIT_PROJECT_ID",[203,296,283],{"class":208},[203,298,286],{"class":212},[203,300,301,304,307],{"class":205,"line":52},[203,302,303],{"class":212},"  token: process.env.",[203,305,306],{"class":258},"CLOSEYOURIT_TOKEN",[203,308,286],{"class":212},[203,310,311,314,317],{"class":205,"line":60},[203,312,313],{"class":212},"  environment: process.env.",[203,315,316],{"class":258},"NODE_ENV",[203,318,286],{"class":212},[203,320,321,324,327],{"class":205,"line":69},[203,322,323],{"class":212},"  release: process.env.",[203,325,326],{"class":258},"APP_VERSION",[203,328,286],{"class":212},[203,330,331],{"class":205,"line":77},[203,332,333],{"class":212},"})\n",[203,335,336,338,341,343,345,348,351],{"class":205,"line":84},[203,337,255],{"class":208},[203,339,340],{"class":258}," pool",[203,342,262],{"class":208},[203,344,265],{"class":208},[203,346,347],{"class":212}," pg.",[203,349,350],{"class":268},"Pool",[203,352,353],{"class":212},"()\n",[203,355,356,358,361,363,365,368],{"class":205,"line":96},[203,357,255],{"class":208},[203,359,360],{"class":258}," monitoring",[203,362,262],{"class":208},[203,364,265],{"class":208},[203,366,367],{"class":268}," DatabaseMonitoring",[203,369,370],{"class":212},"(client, {\n",[203,372,373,376,379],{"class":205,"line":109},[203,374,375],{"class":212},"  enabled: ",[203,377,378],{"class":258},"true",[203,380,286],{"class":212},[203,382,383,386,389],{"class":205,"line":117},[203,384,385],{"class":212},"  slowQueryThresholdMs: ",[203,387,388],{"class":258},"100",[203,390,286],{"class":212},[203,392,393,396,399],{"class":205,"line":122},[203,394,395],{"class":212},"  repeatedQueryThreshold: ",[203,397,398],{"class":258},"5",[203,400,286],{"class":212},[203,402,403],{"class":205,"line":127},[203,404,333],{"class":212},[203,406,407,410,413],{"class":205,"line":132},[203,408,409],{"class":212},"monitoring.",[203,411,412],{"class":268},"instrumentPostgres",[203,414,415],{"class":212},"(pool)\n",[203,417,418],{"class":205,"line":138},[203,419,250],{"emptyLinePlaceholder":249},[203,421,422,425,428,431,434],{"class":205,"line":143},[203,423,424],{"class":208},"await",[203,426,427],{"class":212}," client.",[203,429,430],{"class":268},"runWithScope",[203,432,433],{"class":212},"(() ",[203,435,436],{"class":208},"=>\n",[203,438,439,442,445,448,451,454,457],{"class":205,"line":148},[203,440,441],{"class":212},"  monitoring.",[203,443,444],{"class":268},"profile",[203,446,447],{"class":212},"(",[203,449,450],{"class":208},"async",[203,452,453],{"class":212}," () ",[203,455,456],{"class":208},"=>",[203,458,459],{"class":212}," {\n",[203,461,462,465,468,471,473,476,479,482],{"class":205,"line":153},[203,463,464],{"class":208},"    await",[203,466,467],{"class":212}," pool.",[203,469,470],{"class":268},"query",[203,472,447],{"class":212},[203,474,475],{"class":219},"'SELECT $1::integer AS value'",[203,477,478],{"class":212},", [",[203,480,481],{"class":258},"1",[203,483,484],{"class":212},"])\n",[203,486,488],{"class":205,"line":487},23,[203,489,490],{"class":212},"  }),\n",[203,492,494],{"class":205,"line":493},24,[203,495,496],{"class":212},")\n",[203,498,500],{"class":205,"line":499},25,[203,501,250],{"emptyLinePlaceholder":249},[203,503,505,507,510],{"class":205,"line":504},26,[203,506,409],{"class":212},[203,508,509],{"class":268},"uninstall",[203,511,353],{"class":212},[203,513,515,517,519,522],{"class":205,"line":514},27,[203,516,424],{"class":208},[203,518,427],{"class":212},[203,520,521],{"class":268},"close",[203,523,353],{"class":212},[203,525,527,529,531,534],{"class":205,"line":526},28,[203,528,424],{"class":208},[203,530,467],{"class":212},[203,532,533],{"class":268},"end",[203,535,353],{"class":212},[160,537,538,539,542,543,546,547,550],{},"The default thresholds are ",[164,540,541],{},"100 ms"," and ",[164,544,545],{},"five repetitions",". The example query may not emit a measurement: it must exceed the threshold. For a controlled check, use ",[169,548,549],{},"slowQueryThresholdMs: 0",", then verify the stored record in the correct project.",[160,552,553,556,557,560,561,563],{},[169,554,555],{},"profile()"," bounds one request; concurrent requests do not share counts. Queries outside a profile can emit slow measurements but no repetition verdict. For callback or streaming HTTP requests, use ",[169,558,559],{},"monitoring.request(end => …)"," and call ",[169,562,533],{}," at response completion. Streaming database queries remain excluded.",[178,565,567],{"id":566},"mysql-and-orms","MySQL and ORMs",[160,569,570,571,574,575,578,579,582,583,586],{},"For a ",[169,572,573],{},"mysql2\u002Fpromise"," pool, call ",[169,576,577],{},"monitoring.instrumentMysql(pool, 'promise')","; use ",[169,580,581],{},"'callback'"," for callback APIs. With Drizzle, instrument the same pg\u002Fmysql2 pool passed to the ORM. With Prisma 7, instrument the explicit PostgreSQL pool passed to ",[169,584,585],{},"PrismaPg",".",[160,588,589,592],{},[164,590,591],{},"Prisma MySQL, internal engines, cursors and custom query objects are not covered."," Physical queries are counted once at the driver boundary. Repetition is evidence to investigate, not proof of a semantic ORM N+1 defect.",[178,594,596],{"id":595},"privacy-limits-and-removal","Privacy, limits and removal",[160,598,599],{},"Bindings and results are never sent. SQL identifiers are pseudonymous; that is not an anonymity guarantee against guessed names. Unrecognized syntax is omitted without changing the application's query.",[160,601,602,603,606,607,610],{},"Limits are ",[164,604,605],{},"256 instances, 64 concurrent profiles, 64 groups and 1,000 operations per profile",". Incomplete profiles do not produce aggregate verdicts. ",[169,608,609],{},"monitoring.getStats()"," exposes local omissions. Transport adds no durable offline queue or automatic retries.",[160,612,613,616,617,621],{},[169,614,615],{},"uninstall()"," restores only methods still owned by the adapter. Pools, transactions and SDK clients remain application-owned. Check disabled and removed behavior too; consult ",[618,619,620],"a",{"href":140},"observed combinations"," before extending support to other runtimes.",[623,624,625],"style",{},"html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}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":199,"searchDepth":15,"depth":15,"links":627},[628,629,630],{"id":180,"depth":15,"text":181},{"id":566,"depth":15,"text":567},{"id":595,"depth":15,"text":596},"md",{},{"title":151,"description":152},"docs\u002Fnode-database","wSEi18q58cljgX1bL8CZ0lARkWnmT14Y4W6TO0OGlfE",1791302513339]