You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2cbacb5
Browse filesBrowse the repository at this point in the historyBrowse files
feat(node): Rewrite knex instrumentation to orchestrion tracing channels (#22237)
Migrates the knex integration off the vendored `InstrumentationBase`
monkey-patch onto a `node:diagnostics_channel` subscriber whose channels
are injected by the orchestrion code transform. The vendored OTel path
stays as the fallback when orchestrion isn't injected.
closes#20757
@@ -17,30 +19,30 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di
17
19
'db.system': 'mysql2',
18
20
'db.name': 'tests',
19
21
'db.user': 'root',
20
-
'sentry.origin': 'auto.db.otel.knex',
22
+
'sentry.origin': ORIGIN,
21
23
'sentry.op': 'db',
22
24
'net.peer.name': 'localhost',
23
25
'net.peer.port': 3307,
24
26
}),
25
27
status: 'ok',
26
28
description:
27
29
'create table `User` (`id` int unsigned not null auto_increment primary key, `createdAt` timestamp(3) not null default CURRENT_TIMESTAMP(3), `email` text not null, `name` text not null)',
28
-
origin: 'auto.db.otel.knex',
30
+
origin: ORIGIN,
29
31
}),
30
32
expect.objectContaining({
31
33
data: expect.objectContaining({
32
34
'knex.version': KNEX_VERSION,
33
35
'db.system': 'mysql2',
34
36
'db.name': 'tests',
35
37
'db.user': 'root',
36
-
'sentry.origin': 'auto.db.otel.knex',
38
+
'sentry.origin': ORIGIN,
37
39
'sentry.op': 'db',
38
40
'net.peer.name': 'localhost',
39
41
'net.peer.port': 3307,
40
42
}),
41
43
status: 'ok',
42
44
description: 'insert into `User` (`email`, `name`) values (?, ?)',
43
-
origin: 'auto.db.otel.knex',
45
+
origin: ORIGIN,
44
46
}),
45
47
46
48
expect.objectContaining({
@@ -52,12 +54,12 @@ describeWithDockerCompose('knex auto instrumentation', { workingDirectory: [__di
@@ -16,30 +18,30 @@ describe('knex auto instrumentation', () => {
16
18
'knex.version': KNEX_VERSION,
17
19
'db.system': 'postgresql',
18
20
'db.name': 'tests',
19
-
'sentry.origin': 'auto.db.otel.knex',
21
+
'sentry.origin': ORIGIN,
20
22
'sentry.op': 'db',
21
23
'net.peer.name': 'localhost',
22
24
'net.peer.port': 5445,
23
25
}),
24
26
status: 'ok',
25
27
description:
26
28
'create table "User" ("id" serial primary key, "createdAt" timestamptz(3) not null default CURRENT_TIMESTAMP(3), "email" text not null, "name" text not null)',
27
-
origin: 'auto.db.otel.knex',
29
+
origin: ORIGIN,
28
30
}),
29
31
expect.objectContaining({
30
32
data: expect.objectContaining({
31
33
'knex.version': KNEX_VERSION,
32
34
'db.system': 'postgresql',
33
35
'db.name': 'tests',
34
-
'sentry.origin': 'auto.db.otel.knex',
36
+
'sentry.origin': ORIGIN,
35
37
'sentry.op': 'db',
36
38
'net.peer.name': 'localhost',
37
39
'net.peer.port': 5445,
38
40
}),
39
41
status: 'ok',
40
42
// In the knex-otel spans, the placeholders (e.g., `$1`) are replaced by a `?`.
41
43
description: 'insert into "User" ("email", "name") values (?, ?)',
42
-
origin: 'auto.db.otel.knex',
44
+
origin: ORIGIN,
43
45
}),
44
46
45
47
expect.objectContaining({
@@ -50,12 +52,12 @@ describe('knex auto instrumentation', () => {
50
52
'db.system': 'postgresql',
51
53
'db.name': 'tests',
52
54
'db.statement': 'select * from "User"',
53
-
'sentry.origin': 'auto.db.otel.knex',
55
+
'sentry.origin': ORIGIN,
54
56
'sentry.op': 'db',
55
57
}),
56
58
status: 'ok',
57
59
description: 'select * from "User"',
58
-
origin: 'auto.db.otel.knex',
60
+
origin: ORIGIN,
59
61
}),
60
62
61
63
expect.objectContaining({
@@ -66,12 +68,12 @@ describe('knex auto instrumentation', () => {
0 commit comments