autotel-drizzle 0.0.41 → 0.0.42
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 +4 -4
- package/dist/drizzle.d.cts.map +1 -1
- package/dist/drizzle.d.ts.map +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +10 -11
- package/skills/autotel-drizzle/SKILL.md +6 -6
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ If you are pinned to an older Drizzle (for example 0.38.x):
|
|
|
11
11
|
|
|
12
12
|
- npm/pnpm will warn on install but the package will still resolve; the public callable surface (`instrumentDrizzleClient`, `instrumentDrizzle`) targets shapes that exist on 0.45+ and may misbehave on older versions.
|
|
13
13
|
- Either upgrade Drizzle, or skip this package and emit spans manually around your queries with `span()` from `autotel` (see the [autotel README](../autotel#span)).
|
|
14
|
-
- A backport is not currently planned
|
|
14
|
+
- A backport is not currently planned: track the version in `package.json`.
|
|
15
15
|
|
|
16
16
|
## Philosophy
|
|
17
17
|
|
|
@@ -136,9 +136,9 @@ instrumentDrizzleClient(db, {
|
|
|
136
136
|
|
|
137
137
|
## See also
|
|
138
138
|
|
|
139
|
-
- [autotel](../autotel)
|
|
140
|
-
- [autotel-cloudflare](../autotel-cloudflare)
|
|
141
|
-
- [autotel-edge](../autotel-edge)
|
|
139
|
+
- [autotel](../autotel): Node SDK that this package builds on
|
|
140
|
+
- [autotel-cloudflare](../autotel-cloudflare): instrument D1 directly when running Drizzle on Workers
|
|
141
|
+
- [autotel-edge](../autotel-edge): vendor-agnostic edge foundation
|
|
142
142
|
|
|
143
143
|
## License
|
|
144
144
|
|
package/dist/drizzle.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle.d.cts","names":[],"sources":["../src/drizzle/index.ts"],"mappings":";cAgBM
|
|
1
|
+
{"version":3,"file":"drizzle.d.cts","names":[],"sources":["../src/drizzle/index.ts"],"mappings":";cAgBM;KAUD,oBAAoB;UAIf;GACP;GACA;;UAGO,0BAA0B;EAClC,QAAQ;EACR,UAAU;;UAGF,2BAA2B;EACnC,QAAQ;EACR,UAAU;EACV,eAAe;EACf,cAAc;;UAGN,sBAAsB;EAC9B,UAAU;EACV,UAAU;EACV;IACE,UAAU;KACT;;;UAIY;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;iBAkac,kBAAkB,gBAAgB,mBAChD,QAAQ,SACR,SAAS,0BACR;iBA6Ba,wBAAwB,YAAY,eAClD,IAAI,KACJ,SAAS,0BACR"}
|
package/dist/drizzle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drizzle.d.ts","names":[],"sources":["../src/drizzle/index.ts"],"mappings":";cAgBM
|
|
1
|
+
{"version":3,"file":"drizzle.d.ts","names":[],"sources":["../src/drizzle/index.ts"],"mappings":";cAgBM;KAUD,oBAAoB;UAIf;GACP;GACA;;UAGO,0BAA0B;EAClC,QAAQ;EACR,UAAU;;UAGF,2BAA2B;EACnC,QAAQ;EACR,UAAU;EACV,eAAe;EACf,cAAc;;UAGN,sBAAsB;EAC9B,UAAU;EACV,UAAU;EACV;IACE,UAAU;KACT;;;UAIY;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;iBAkac,kBAAkB,gBAAgB,mBAChD,QAAQ,SACR,SAAS,0BACR;iBA6Ba,wBAAwB,YAAY,eAClD,IAAI,KACJ,SAAS,0BACR"}
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/common/constants.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/common/constants.ts"],"mappings":";;;;;;cAMa;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cAcA;cACA;cAwBA;cACA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/common/constants.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/common/constants.ts"],"mappings":";;;;;;cAMa;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cACA;cAcA;cACA;cAwBA;cACA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA;cAEA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "autotel-drizzle",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.42",
|
|
4
4
|
"description": "OpenTelemetry instrumentation for Drizzle ORM",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/drizzle.js",
|
|
@@ -34,23 +34,23 @@
|
|
|
34
34
|
"license": "Apache-2.0",
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@opentelemetry/api": "^1.9.1",
|
|
37
|
-
"@opentelemetry/instrumentation": "^0.
|
|
38
|
-
"@opentelemetry/semantic-conventions": "^1.
|
|
39
|
-
"autotel": "
|
|
37
|
+
"@opentelemetry/instrumentation": "^0.220.0",
|
|
38
|
+
"@opentelemetry/semantic-conventions": "^1.43.0",
|
|
39
|
+
"autotel": "5.0.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"drizzle-orm": ">=0.45.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@arethetypeswrong/cli": "^0.18.
|
|
46
|
-
"@opentelemetry/core": "^2.
|
|
47
|
-
"@types/node": "^26.1.
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
49
|
-
"@typescript-eslint/parser": "^8.
|
|
45
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
46
|
+
"@opentelemetry/core": "^2.9.0",
|
|
47
|
+
"@types/node": "^26.1.1",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^8.65.0",
|
|
49
|
+
"@typescript-eslint/parser": "^8.65.0",
|
|
50
50
|
"drizzle-orm": "^0.45.2",
|
|
51
51
|
"eslint-config-prettier": "^10.1.8",
|
|
52
52
|
"eslint-plugin-unicorn": "^64.0.0",
|
|
53
|
-
"tsdown": "^0.22.
|
|
53
|
+
"tsdown": "^0.22.12",
|
|
54
54
|
"typescript": "^6.0.3",
|
|
55
55
|
"vitest": "^4.1.10"
|
|
56
56
|
},
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"dev": "tsdown --watch",
|
|
70
70
|
"lint": "eslint src/**/*.ts",
|
|
71
71
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
72
|
-
"format": "prettier --write .",
|
|
73
72
|
"format:check": "prettier --check src/**/*.ts",
|
|
74
73
|
"type-check": "tsc --noEmit",
|
|
75
74
|
"test": "vitest run --config vitest.unit.config.ts",
|
|
@@ -111,8 +111,8 @@ SQL text may contain user-supplied values. Disable capture or truncate aggressiv
|
|
|
111
111
|
### What is instrumented
|
|
112
112
|
|
|
113
113
|
- Session `query()` and `execute()` methods
|
|
114
|
-
- Prepared queries (`prepareQuery`)
|
|
115
|
-
- Transactions
|
|
114
|
+
- Prepared queries (`prepareQuery`): all execution methods: `all`, `execute`, `get`, `run`, `values`
|
|
115
|
+
- Transactions: the callback receives an already-instrumented transaction object, spans carry `db.transaction: true`
|
|
116
116
|
|
|
117
117
|
### Idempotency
|
|
118
118
|
|
|
@@ -132,7 +132,7 @@ import {
|
|
|
132
132
|
|
|
133
133
|
## Common Mistakes
|
|
134
134
|
|
|
135
|
-
### HIGH
|
|
135
|
+
### HIGH: Calling `instrumentDrizzleClient` after queries have already run
|
|
136
136
|
|
|
137
137
|
```typescript
|
|
138
138
|
// Wrong: some early queries miss instrumentation
|
|
@@ -150,7 +150,7 @@ await db.select().from(users); // instrumented
|
|
|
150
150
|
|
|
151
151
|
Patching works by mutating method references on the live object. Any query that ran before patching has no span.
|
|
152
152
|
|
|
153
|
-
### HIGH
|
|
153
|
+
### HIGH: Using autotel-drizzle for databases that have official OTel packages
|
|
154
154
|
|
|
155
155
|
```typescript
|
|
156
156
|
// Wrong: autotel-drizzle is for Drizzle, not for pg directly
|
|
@@ -164,7 +164,7 @@ init({ instrumentations: [new PgInstrumentation()] });
|
|
|
164
164
|
|
|
165
165
|
For PostgreSQL (`pg`/`postgres`), MySQL (`mysql2`), SQLite, MongoDB, and Redis, official OTel instrumentation packages exist and should be preferred.
|
|
166
166
|
|
|
167
|
-
### MEDIUM
|
|
167
|
+
### MEDIUM: Not setting `dbSystem` for non-PostgreSQL databases
|
|
168
168
|
|
|
169
169
|
```typescript
|
|
170
170
|
// Wrong: dbSystem defaults to 'postgresql' even for SQLite
|
|
@@ -176,7 +176,7 @@ instrumentDrizzleClient(sqliteDb, { dbSystem: 'sqlite' });
|
|
|
176
176
|
|
|
177
177
|
The `db.system` span attribute will be wrong if the default is not overridden.
|
|
178
178
|
|
|
179
|
-
### MEDIUM
|
|
179
|
+
### MEDIUM: Passing `captureQueryText: true` without reviewing SQL for PII
|
|
180
180
|
|
|
181
181
|
SQL statements built by Drizzle may embed user-supplied values (e.g., email addresses in `WHERE` clauses). Either disable capture or review what Drizzle sends before enabling in production.
|
|
182
182
|
|