@tracepanel/js 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,7 +31,7 @@ It runs while you develop, and everything stays on your machine.
31
31
  | **Background jobs** | BullMQ: each job a worker runs is a task, each job the app adds a step, and the jobs in flight are listed live. |
32
32
  | **Logs** | `console`, pino, winston and Nest's `Logger`, each line on the request or job that wrote it. |
33
33
  | **Errors** | Thrown in a handler, with your frames, their source and, on Node, their local variables. |
34
- | **Profiling** | Where a request's CPU time goes, and on request its memory and garbage collections, on Node. |
34
+ | **Profiling** | Where a request's CPU time goes, and its memory and garbage collections when you ask for them, on Node. |
35
35
  | **Tests** | Vitest 4.1 and later: a test fails when it makes an N+1 or duplicate queries. |
36
36
  | **Browser** | The badge and its panel on server-rendered pages, in Next.js through `<Tracepanel />` and in an SPA through the Vite plugin. The pages' views and clicks with their `fetch()` calls, linked to the API's traces. |
37
37
 
@@ -50,17 +50,14 @@ traces and serves the console.
50
50
  ## Setup
51
51
 
52
52
  Tracepanel is on unless `NODE_ENV` is `production`. `TRACEPANEL_ENABLED=0`
53
- turns it off and `TRACEPANEL_ENABLED=1` turns it on. It starts its agent on
54
- the first request. The agent keeps the traces in `.tracepanel/` in your
55
- project and serves the console. Open a page and click the badge in the
56
- corner.
53
+ turns it off and `TRACEPANEL_ENABLED=1` turns it on. The app's first request
54
+ starts the agent, which keeps the traces in `.tracepanel/` and serves the
55
+ console. Open a page and click the badge in the corner.
57
56
 
58
57
  ### Express
59
58
 
60
- Start the app with Tracepanel loaded before it, so OpenTelemetry can
61
- instrument its HTTP server, Express and its database driver, and add the
62
- middleware. It puts the badge on HTML pages and gives every response its
63
- trace id:
59
+ Start the app with Tracepanel loaded before it, and add the middleware. It
60
+ puts the badge on HTML pages and gives every response its trace id:
64
61
 
65
62
  ```bash
66
63
  node --import @tracepanel/js/register server.js
@@ -74,10 +71,9 @@ const app = express();
74
71
  app.use(tracepanel());
75
72
  ```
76
73
 
77
- The flag is how Tracepanel gets in before the app. An ES module's imports
78
- all load before any of its code runs, so `import "@tracepanel/js/register"` at
79
- the top of `server.js` comes too late for Express and the database driver.
80
- Without the flag, either let the CLI add it:
74
+ The flag loads Tracepanel before the app's imports, which `import
75
+ "@tracepanel/js/register"` in `server.js` can't do. Without the flag, let the
76
+ CLI add it:
81
77
 
82
78
  ```json
83
79
  { "scripts": { "dev": "tracepanel run node server.js" } }
@@ -91,12 +87,10 @@ import "@tracepanel/js/register";
91
87
  await import("./server.js");
92
88
  ```
93
89
 
94
- The agent starts by itself either way, on the app's first request.
95
-
96
90
  ### Fastify
97
91
 
98
92
  Load Tracepanel before the app as for Express, and register the plugin
99
- before the routes, so it sees each one as it is added:
93
+ before the routes:
100
94
 
101
95
  ```bash
102
96
  node --import @tracepanel/js/register server.js
@@ -111,11 +105,7 @@ await app.register(tracepanel());
111
105
  app.get("/books/:id", async (request) => findBook(request.params.id));
112
106
  ```
113
107
 
114
- Each request is named by its route (`GET /books/:id`), and its handler is a
115
- step of its own, with the line that added the route. HTML pages get the
116
- badge, sent whole or streamed. An error Fastify answers with a 500 is the
117
- request's error, with its local variables; one it answers below 500, such
118
- as a validation error or a `statusCode: 404`, is the response.
108
+ Each request is named by its route (`GET /books/:id`).
119
109
 
120
110
  ### Koa
121
111
 
@@ -139,10 +129,7 @@ router.get("/books/:id", async (ctx) => {
139
129
  app.use(router.routes());
140
130
  ```
141
131
 
142
- Each `@koa/router` route's handler is a step named by its route, and so is
143
- the request, nested routers' prefixes included. The badge goes on HTML pages,
144
- and on the answer Koa gives an error. `ctx.throw(404)` is the response, not
145
- an error.
132
+ Each request is named by its `@koa/router` route.
146
133
 
147
134
  ### Hono
148
135
 
@@ -164,21 +151,14 @@ app.get("/books/:id", async (c) => c.json(await findBook(c.req.param("id"))));
164
151
  serve({ fetch: app.fetch });
165
152
  ```
166
153
 
167
- Each request is named by its route, a sub-app's base path included, and its
168
- handler is a step of its own. HTML pages get the badge, and the request's
169
- body goes into its trace as far as the handler read it. An `HTTPException`
170
- below 500, or what `app.onError` answers below 500, is the response.
171
-
172
154
  On Bun, add the same middleware and serve the app with `serve()` from
173
- `@tracepanel/js/bun` (see Bun below), which puts the badge on the response.
155
+ `@tracepanel/js/bun` (see Bun below).
174
156
 
175
157
  ### NestJS
176
158
 
177
159
  Nest runs on Express: load Tracepanel the same way and add the same
178
160
  middleware in `main.ts`. Each request's handler is its controller method,
179
- such as `BooksController.list`, and the Nest `Logger`'s records go to the
180
- request's trace. An `HttpException` that answers below 500 is the response,
181
- not an error.
161
+ such as `BooksController.list`.
182
162
 
183
163
  ```bash
184
164
  node --import @tracepanel/js/register dist/main.js
@@ -196,8 +176,9 @@ await app.listen(3000);
196
176
 
197
177
  ### GraphQL
198
178
 
199
- Add the plugin of your GraphQL server; load Tracepanel and its framework's
200
- middleware as above. GraphQL Yoga, on Express or any other server:
179
+ Add the plugin of your GraphQL server, and load Tracepanel and its
180
+ framework's middleware as above. GraphQL Yoga, on Express or any other
181
+ server:
201
182
 
202
183
  ```js
203
184
  import { createYoga } from "graphql-yoga";
@@ -216,21 +197,13 @@ import { tracepanelApolloPlugin } from "@tracepanel/js/graphql";
216
197
  const server = new ApolloServer({ typeDefs, resolvers, plugins: [tracepanelApolloPlugin()] });
217
198
  ```
218
199
 
219
- Each request is named after its operation, such as `GraphQL query Books`, so
220
- traffic groups by operation rather than `POST /graphql`, and the console's
221
- GraphQL page lists them. The operation is a step with its parse and validate
222
- phases, and each of your resolvers is a step, such as `Book.author`, with
223
- the queries and calls it makes under it: an N+1 shows which field runs it.
224
- Fields without a resolver of their own are left out. An exception a resolver
225
- throws is the request's error though the client gets it with a 200; a
226
- `GraphQLError` you answer with, and a client's syntax or validation error,
227
- are not. The variables are in the request's body, their secrets masked.
200
+ Each request is named after its operation, such as `GraphQL query Books`,
201
+ and each of your resolvers is a step with its queries and calls under it.
228
202
 
229
203
  ### Next.js
230
204
 
231
- Next.js starts its own server: Tracepanel goes in from the instrumentation
232
- hook, and Next.js makes each request's root span itself. Keep the package out
233
- of the bundles, and put the badge in the root layout:
205
+ Tracepanel goes in from the instrumentation hook. Keep the package out of the
206
+ bundles, and put the badge in the root layout:
234
207
 
235
208
  ```ts
236
209
  // instrumentation.ts
@@ -261,26 +234,17 @@ export default function RootLayout({ children }) {
261
234
  }
262
235
  ```
263
236
 
264
- A request's handler is its page or route handler, named by its route
265
- (`/api/books/[id]`).
266
-
267
- In development the app's server also serves the console at `/__tracepanel__/`
268
- on its own origin, for this machine only, and the badge loads from there.
269
- `<Tracepanel />` records the pages in the browser too, as the Vite plugin
270
- does (see below). It takes the same options:
237
+ In development the app's server serves the console at `/__tracepanel__/`.
238
+ `<Tracepanel />` also records the pages in the browser, and takes the Vite
239
+ plugin's options (see below). `browser={false}` leaves the recording out:
271
240
 
272
241
  ```tsx
273
242
  <Tracepanel browser={{ service: "shop-web", propagateTo: ["http://127.0.0.1:8000"] }} />
274
243
  ```
275
244
 
276
- The recording is inline in `<head>`, so it wraps `fetch` before the app's
277
- scripts run, even a client that keeps `fetch` from when it is made
278
- (`openapi-fetch`). `browser={false}` leaves it out.
279
-
280
245
  ### Nuxt
281
246
 
282
- Add the module and start `nuxt dev` with Tracepanel loaded, so it hooks the
283
- database driver as Nitro loads it:
247
+ Add the module and start `nuxt dev` with Tracepanel loaded:
284
248
 
285
249
  ```ts
286
250
  // nuxt.config.ts
@@ -291,15 +255,11 @@ export default defineNuxtConfig({ modules: ["@tracepanel/js/nuxt"] });
291
255
  NODE_OPTIONS=--import=@tracepanel/js/register nuxt dev
292
256
  ```
293
257
 
294
- The module names each request by its route (`/api/books/:id`), puts the
295
- badge on server-rendered pages, and records the errors h3 answers with a 500.
296
-
297
258
  ### Bun
298
259
 
299
260
  `serve()` is `Bun.serve` with each route traced under its pattern, and
300
261
  `withTracepanel()` wraps any fetch handler, such as Elysia's `handle`. A Hono
301
- app is `serve({ fetch: app.fetch })`, with its `tracepanel()` middleware (see
302
- Hono above) naming its routes:
262
+ app is `serve({ fetch: app.fetch })`, with its `tracepanel()` middleware:
303
263
 
304
264
  ```bash
305
265
  bun --preload @tracepanel/js/register server.ts
@@ -317,10 +277,9 @@ serve({
317
277
 
318
278
  ### An SPA on Vite
319
279
 
320
- A single-page app on Vite's dev server gets the badge from the plugin, whatever
321
- serves its API: an app Tracepanel traces, in Node or in Python. It puts the
322
- widget into `index.html` and serves the backend's console on Vite's origin,
323
- from the backend project's `.tracepanel/`:
280
+ A single-page app on Vite's dev server gets the badge from the plugin,
281
+ whatever serves its API, in Node or in Python. It serves the backend's
282
+ console on Vite's origin, from the backend project's `.tracepanel/`:
324
283
 
325
284
  ```ts
326
285
  // vite.config.ts
@@ -329,47 +288,24 @@ import { tracepanel } from "@tracepanel/js/vite";
329
288
  export default { plugins: [tracepanel({ dir: "../backend" })] };
330
289
  ```
331
290
 
332
- When the page loads before the API's first request, the plugin starts the
333
- backend's agent itself, as the SDK would. The console answers this machine
334
- only, even with Vite on the network (`vite --host`): its traces and what it
335
- lets a local caller do, such as switching the user, are the developer's.
336
-
337
- An API on another origin exposes the trace's headers to the page on its CORS
338
- responses, so the badge lists each call the app makes. A backend that serves
339
- its own console (Django, FastAPI) is named with `console`:
291
+ A backend that serves its own console (Django, FastAPI) is named with
292
+ `console`:
340
293
 
341
294
  ```ts
342
295
  tracepanel({ console: "http://localhost:8000/__tracepanel__/" });
343
296
  ```
344
297
 
345
- The plugin also records the pages in the browser. Each view (the page's load,
346
- or a route change) is a trace, and so is each action on it: a click or a
347
- submit that called the API, named after the control (`click "Save"`), or
348
- background calls nobody started. Each has its calls, its errors and its
349
- console, with the line that logged each record, and lasts until its last
350
- call answered. The console lists them in Pages, the page's view first and
351
- its actions under it, and the badge's panel lists each action over the
352
- requests it made.
353
-
354
- A call to the page's own origin carries a W3C `traceparent`, so the console
355
- links it to the API's trace. While the panel's Profile toggle is on, the
356
- same calls carry `X-Tracepanel-Profile` (`1`, or `memory`), so an API on
357
- another origin, which never gets the toggle's cookie, profiles the request
358
- too, and so does each app it calls in turn. `propagateTo` names other
359
- origins, whose CORS must allow both headers (`cors()` and
360
- `allow_headers=["*"]` do):
298
+ The plugin also records the pages in the browser: each view and each click
299
+ or submit is a trace, with its API calls, errors and console output.
300
+ `propagateTo` names the API origins to link to the page's traces. Their CORS
301
+ must allow the `traceparent` and `X-Tracepanel-Profile` headers:
361
302
 
362
303
  ```ts
363
304
  tracepanel({ dir: "../backend", browser: { service: "shop-web", propagateTo: ["http://127.0.0.1:8000"] } });
364
305
  ```
365
306
 
366
- `browser: false` leaves the recording out. Vite's own client logs (its
367
- connection, hot reload) stay out of the pages' traces.
368
-
369
- Without Vite, call `record()` from `@tracepanel/js/browser` in the page, with the
370
- console on the page's origin (`api`, `/__tracepanel__/` by default).
371
- `ignoreSources` takes the path prefixes of scripts whose console isn't the
372
- page's, such as a dev server's client.
307
+ `browser: false` leaves the recording out. Without Vite, call `record()` from
308
+ `@tracepanel/js/browser` in the page.
373
309
 
374
310
  ## What it looks like
375
311
 
@@ -388,84 +324,28 @@ the line that ran it and the fix:
388
324
 
389
325
  ## What it records
390
326
 
391
- - HTTP requests, with the route and the handler that served them, and what
392
- each one carried: its headers, query and cookies, the body as far as the
393
- app read it, and the response's headers. Values under names such as
394
- `password`, `token`, `session` or `csrf` are masked, and they never leave
395
- your machine. A body is what the app read, up to 16 KB: in Express and
396
- Nest what a body parser read (`req.body`, an upload's files by name and
397
- size); in Next.js, Nuxt and under `withTracepanel()` the bytes the app's
398
- own reads took from the request's stream, a copy of their start kept as
399
- they pass. JSON and forms have their secrets masked, text is cut at
400
- 16 KB, and binary bodies are left out. A multipart form keeps its fields
401
- and its files by name and size, never their contents, however large the
402
- upload. JSON or a URL-encoded form past 16 KB is left out, since its
403
- secrets can't be masked from a part of it. A body the app never reads is
404
- not recorded, and Tracepanel never reads it or waits for it.
405
- - The request's session as the handler left it: express-session's or
406
- cookie-session's `req.session` in Express and Nest, and in Nuxt the
407
- sessions h3's `useSession()` read (nuxt-auth-utils' among them). Each
408
- value is text, masked under a sensitive name and below one, and
409
- nuxt-auth-utils' `secure` data always is. Next.js and Bun have no
410
- session of their own, and a sealed cookie (iron-session, Auth.js) takes
411
- the app's secret to read, so none is recorded there: `setUser()` names
412
- the signed-in user instead.
413
- - A form's POST that redirects to another page: the panel on that page
414
- lists the POST before it.
415
- - SQL from `pg` and `mysql2` (and so Drizzle, Knex, Sequelize, TypeORM and
416
- Prisma's driver adapters), and from SQLite through `better-sqlite3`,
417
- Node's `node:sqlite` and `libsql`, with the line of your code that ran each
418
- statement. A statement no code of yours made, such as a session store's,
419
- names the library code that asked for it, past the driver and the ORM;
420
- so do Redis and MongoDB commands. Prisma's operations show as steps.
421
- - Transactions: BEGIN … COMMIT (or ROLLBACK) on a `pg` client, a `mysql2`
422
- connection or a SQLite database, and better-sqlite3's `db.transaction()`,
423
- with its statements and the calls made inside it, and its savepoints.
424
- - The console's EXPLAIN of a SQLite query (EXPLAIN QUERY PLAN) runs on the
425
- app's own connection, so a database in memory has a plan too.
426
- - Redis commands (`ioredis`, `redis`) and MongoDB commands, with their own
427
- N+1 and duplicates.
428
- - Outgoing HTTP calls: `fetch()`, and `node:http` clients such as axios, on
429
- Node and on Bun.
430
- - BullMQ: each job a worker runs is a task, each job the app adds a step.
431
- While a job is in flight, the console's Tasks page lists it under Now:
432
- queued, running in its worker, or waiting for its next attempt, and the
433
- workers that run them.
434
- - Logs made during a request: `console` calls, Nest's `Logger`, and pino's
435
- and winston's loggers, with their fields and the error they carry.
436
- - Errors thrown in a handler, with your frames, their source and their
437
- local variables. Node's inspector reads the variables as the error is
438
- thrown, in your own frames only, while a request runs; a value under a
439
- name such as `password` or `token` is masked, and a long one is cut. A
440
- caller waiting on an `await` has none. Each error read costs about a
441
- millisecond, at most 50 a second; a process under a debugger
442
- (`--inspect`) is left alone.
443
- - Where a request's time goes in code, for the console's flame graph, when
444
- it asks: the panel's Profile toggle, or an `X-Tracepanel-Profile: 1`
445
- header. V8's profiler samples the whole process, and one event loop runs
446
- every request at once, so a profile keeps the samples taken while its
447
- request was the only one running, and counts the rest
448
- (`tracepanel.dropped_samples`). Time spent waiting on I/O is not in it.
449
- Every profile counts the garbage collector's runs and their pauses.
450
- A request profiled because it asked asks the same of the apps it calls:
451
- each call that carries a `traceparent` (fetch, node:http, axios, got)
452
- carries `X-Tracepanel-Profile` too, so the panel's toggle profiles the
453
- whole chain. `TRACEPANEL_PROFILE=1` asks nothing of them: each app's own
454
- setting decides.
455
- - A profile's memory too, when asked: `X-Tracepanel-Profile: memory`, the
456
- `tracepanel_profile=memory` cookie (the panel's Profile toggle offers
457
- it), or `TRACEPANEL_PROFILE_MEMORY=1`. V8's sampling heap profiler takes
458
- about one allocation in every 32 KB with its stack: the profile shows the
459
- heap's peak above where the request started, what V8 allocated in all
460
- (on Node 26), and the 50 sites whose allocations still lived at its end.
461
- The heap is the whole process's, so a request that ran beside others says
462
- so. It costs: code runs about 15% slower while it is sampled, and reading
463
- the sampler's profile makes V8 collect the whole heap once at the end of
464
- each such request, after its response, which stops the process for a few
465
- milliseconds on a small heap and over 100 ms on a heap of a few hundred
466
- MB. Leave it off when you measure time. Not on Bun.
467
- - The caller's trace, when a request carries a W3C `traceparent`: the agent
468
- links the two.
327
+ - HTTP requests: route, handler, headers, query, cookies and the body the app
328
+ read, secrets masked.
329
+ - The session as the handler left it: express-session, cookie-session, h3's
330
+ `useSession()`.
331
+ - A form's POST that redirects, listed on the next page's panel.
332
+ - SQL from `pg` and `mysql2`, and so Drizzle, Knex, Sequelize, TypeORM and
333
+ Prisma.
334
+ - SQLite from `better-sqlite3`, `node:sqlite` and `libsql`.
335
+ - The line of your code that ran each query.
336
+ - Transactions and their savepoints, with the statements inside them.
337
+ - Redis commands from `ioredis` and `redis`, and MongoDB commands.
338
+ - Outgoing HTTP calls from `fetch()` and `node:http` clients such as axios.
339
+ - BullMQ jobs as tasks, and the jobs in flight.
340
+ - Logs from `console`, pino, winston and Nest's `Logger`, with their fields.
341
+ - Errors thrown in a handler, with your frames, their source and local
342
+ variables.
343
+ - Where a request's CPU time and memory go, when you ask for a profile, on
344
+ Node.
345
+ - The caller's trace, when a request carries a W3C `traceparent`.
346
+
347
+ What each integration records, and its limits, are in
348
+ [Integrations](https://tracepanel.dev/docs/javascript/integrations).
469
349
 
470
350
  ## Your own steps and traces
471
351
 
@@ -500,7 +380,7 @@ export default defineConfig({
500
380
  Each test runs as a trace named after the test, with its queries in it. A
501
381
  request the test makes of a server it started (supertest, `fetch()`) is a
502
382
  trace of its own, linked to the test's in the console. Work in `beforeAll` is
503
- outside every test's trace; `beforeEach` and `afterEach` run inside it.
383
+ outside every test's trace. `beforeEach` and `afterEach` run inside it.
504
384
 
505
385
  When the test passes, the agent looks at its traces. An issue of a kind in
506
386
  `failOn` (`n+1` and `duplicates` by default) fails the test with the issue,
@@ -551,9 +431,9 @@ setUser({ id: customer.id, username: customer.email });
551
431
 
552
432
  Call `setUser()` where the app knows who is signed in, such as its auth
553
433
  middleware. The request's trace gets `user.id`, and `user.username` and
554
- `user.email` when given, as the Python SDK records them. `setUser(null)`
555
- marks a request nobody signed in to. The username and email stay on your
556
- machine. Outside a trace it does nothing.
434
+ `user.email` when given. `setUser(null)` marks a request nobody signed in
435
+ to. The username and email stay on your machine. Outside a trace it does
436
+ nothing.
557
437
 
558
438
  ## Settings
559
439
 
package/dist/sql.d.ts CHANGED
@@ -1,4 +1,5 @@
1
+ /** The statement on one line, a line comment (`-- a note`) closed so the line it ended still reads as SQL. */
1
2
  export declare function statement(sql: string): string;
2
3
  export declare function fingerprint(sql: string): string;
3
- /** `SELECT category`: the verb and the table, its schema and quotes left out. */
4
- export declare function spanName(sql: string): string;
4
+ /** `SELECT category`: the verb and the table, its schema and quotes left out, its comments too. */
5
+ export declare function spanName(commented: string): string;
package/dist/sql.js CHANGED
@@ -1,6 +1,9 @@
1
1
  // A statement's span name, its one-line form, and its fingerprint, which the agent groups queries (and finds N+1
2
2
  // queries) by: the same rules in every Tracepanel SDK.
3
3
  const WHITESPACE = /\s+/g;
4
+ // A comment (`-- a note` to the line's end, `/* sqlcommenter's tags */`), or a string or quoted name, whose `--` and
5
+ // `/*` are its text: matched so a comment is told from a string that looks like one.
6
+ const COMMENT = /(--[^\n]*)|(\/\*[\s\S]*?\*\/)|'(?:[^']|'')*'|"(?:[^"]|"")*"|`[^`]*`/g;
4
7
  const IN_LIST = /\bIN \((?:%s|\?|\$\d+)(?:, ?(?:%s|\?|\$\d+))*\)/gi;
5
8
  // One part of a table's name, bare or quoted: "standard SQL", `MySQL`, [SQL Server].
6
9
  const PART = String.raw `(?:"[^"]+"|\`[^\`]+\`|\[[^\]]+\]|[\w$]+)`;
@@ -8,14 +11,26 @@ const PART = String.raw `(?:"[^"]+"|\`[^\`]+\`|\[[^\]]+\]|[\w$]+)`;
8
11
  const TABLE = new RegExp(String.raw `\b(?:FROM|INTO|UPDATE|JOIN)\s+(${PART}(?:\s*\.\s*${PART})*)`, "i");
9
12
  const PARTS = new RegExp(PART, "g");
10
13
  const COUNT = /^\s*SELECT\s+COUNT\(/i;
14
+ /** The statement on one line, a line comment (`-- a note`) closed so the line it ended still reads as SQL. */
11
15
  export function statement(sql) {
12
- return sql.replace(WHITESPACE, " ").trim();
16
+ const closed = sql.includes("--")
17
+ ? sql.replace(COMMENT, (found, line) => line === undefined ? found : `/* ${line.slice(2).trim().replaceAll("*/", "* /")} */`)
18
+ : sql;
19
+ return closed.replace(WHITESPACE, " ").trim();
20
+ }
21
+ /** The one-line statement without its comments (an ORM's or sqlcommenter's tags, a note): what names and groups it. */
22
+ function uncommented(sql) {
23
+ if (!sql.includes("--") && !sql.includes("/*")) {
24
+ return statement(sql);
25
+ }
26
+ return statement(sql.replace(COMMENT, (found, line, block) => line === undefined && block === undefined ? found : " "));
13
27
  }
14
28
  export function fingerprint(sql) {
15
- return statement(sql).replace(IN_LIST, "IN (...)");
29
+ return uncommented(sql).replace(IN_LIST, "IN (...)");
16
30
  }
17
- /** `SELECT category`: the verb and the table, its schema and quotes left out. */
18
- export function spanName(sql) {
31
+ /** `SELECT category`: the verb and the table, its schema and quotes left out, its comments too. */
32
+ export function spanName(commented) {
33
+ const sql = uncommented(commented);
19
34
  const verb = COUNT.test(sql) ? "SELECT COUNT" : (sql.trim().split(/\s+/)[0] ?? "SQL").toUpperCase() || "SQL";
20
35
  const name = TABLE.exec(sql)?.[1];
21
36
  const table = name
package/dist/sql.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"sql.js","sourceRoot":"","sources":["../src/sql.ts"],"names":[],"mappings":"AAAA,iHAAiH;AACjH,uDAAuD;AAEvD,MAAM,UAAU,GAAG,MAAM,CAAC;AAC1B,MAAM,OAAO,GAAG,mDAAmD,CAAC;AACpE,qFAAqF;AACrF,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAA,0CAA0C,CAAC;AAClE,gHAAgH;AAChH,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,kCAAkC,IAAI,cAAc,IAAI,KAAK,EAAE,GAAG,CAAC,CAAC;AACvG,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACpC,MAAM,KAAK,GAAG,uBAAuB,CAAC;AAEtC,MAAM,UAAU,SAAS,CAAC,GAAW;IACnC,OAAO,GAAG,CAAC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,GAAW;IACrC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACrD,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAA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IAC7G,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,KAAK,GAAG,IAAI;QAChB,EAAE,KAAK,CAAC,KAAK,CAAC;QACd,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;QACR,EAAE,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IACnC,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3C,CAAC"}
package/dist/vite.js CHANGED
@@ -11,7 +11,7 @@
11
11
  // Only this machine reaches the console here, whatever address Vite listens on (`vite --host` for a phone): the
12
12
  // backend sees the proxy's own address, so its own local-only checks (switching the user) would let anyone through.
13
13
  import { existsSync, readFileSync } from "node:fs";
14
- import { dirname, join, resolve } from "node:path";
14
+ import { dirname, isAbsolute, join, resolve } from "node:path";
15
15
  import { Starter } from "./agent.js";
16
16
  import { answeredHere, forward, PREFIX } from "./proxy.js";
17
17
  /** The console's address: given, or what the project's agent wrote in .tracepanel/console.addr. */
@@ -19,13 +19,17 @@ function consoleAddress(options, root) {
19
19
  const given = options.console ?? process.env.TRACEPANEL_CONSOLE;
20
20
  if (given)
21
21
  return given;
22
+ const store = process.env.TRACEPANEL_DIR ?? ".tracepanel";
23
+ // A store given by its absolute path is the one: no folder to look up from.
24
+ if (isAbsolute(store))
25
+ return read(join(store, "console.addr"));
22
26
  const starts = options.dir ? [resolve(root, options.dir)] : [root];
23
27
  for (const start of starts) {
24
28
  let folder = start;
25
29
  for (;;) {
26
- const file = join(folder, process.env.TRACEPANEL_DIR ?? ".tracepanel", "console.addr");
30
+ const file = join(folder, store, "console.addr");
27
31
  if (existsSync(file))
28
- return readFileSync(file, "utf8").trim() || undefined;
32
+ return read(file);
29
33
  const parent = dirname(folder);
30
34
  if (parent === folder)
31
35
  break;
@@ -34,6 +38,10 @@ function consoleAddress(options, root) {
34
38
  }
35
39
  return undefined;
36
40
  }
41
+ /** An address file's address, if it has one. */
42
+ function read(file) {
43
+ return existsSync(file) ? readFileSync(file, "utf8").trim() || undefined : undefined;
44
+ }
37
45
  /**
38
46
  * Where the backend project keeps its store, for an agent the plugin starts itself: its `dir`, else Vite's root. None
39
47
  * when the console is given (a backend that serves its own, as Django does, starts its agent itself).
package/dist/vite.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,EAAE;AACF,sBAAsB;AACtB,sDAAsD;AACtD,qEAAqE;AACrE,EAAE;AACF,8GAA8G;AAC9G,kHAAkH;AAClH,uFAAuF;AACvF,EAAE;AACF,gHAAgH;AAChH,oHAAoH;AAEpH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAiC3D,mGAAmG;AACnG,SAAS,cAAc,CAAC,OAA8B,EAAE,IAAY;IAClE,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;IAChE,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACnE,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,MAAM,GAAG,KAAK,CAAC;QACnB,SAAS,CAAC;YACR,MAAM,IAAI,GAAG,IAAI,CA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AAE,QAAQ;gBACb,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,MAAM,eAAe,EAAE,qBAAqB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE;gBACpF,QAAQ,EAAE,cAAuB;aAClC,CAAC;YACF,IAAI,OAAO,CAAC,OAAO,KAAK,KAAK;gBAAE,OAAO,CAAC,MAAM,CAAC,CAAC;YAC/C,qGAAqG;YACrG,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;YAClG,MAAM,SAAS,GAAG;gBAChB,GAAG,EAAE,QAAQ;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,QAAQ,EAAE,2BAA2B,MAAM,uBAAuB,QAAQ,IAAI;gBAC9E,QAAQ,EAAE,cAAuB;aAClC,CAAC;YACF,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC7B,CAAC;KACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracepanel/js",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Traces and logs for Node.js and Bun apps (Express, Fastify, Koa, Hono, NestJS, Next.js, Nuxt, Bun.serve, GraphQL Yoga, Apollo Server): every request with its SQL, logs and errors, N+1 queries found",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -98,7 +98,7 @@
98
98
  "@opentelemetry/sdk-trace-base": "^2.12.0",
99
99
  "@opentelemetry/sdk-trace-node": "^2.12.0",
100
100
  "@prisma/instrumentation": "^7.10.0",
101
- "@tracepanel/agent": "~0.8.0",
101
+ "@tracepanel/agent": "~0.9.0",
102
102
  "import-in-the-middle": "^3.5.2"
103
103
  },
104
104
  "peerDependencies": {