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
Copy file name to clipboardExpand all lines: dev-packages/node-integration-tests/suites/tracing/postgresjs/test.ts
+10-27Lines changed: 10 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,14 @@ describe('postgresjs auto instrumentation', () => {
9
9
expect.objectContaining({
10
10
data: expect.objectContaining({
11
11
'db.namespace': 'test_db',
12
-
'db.operation.name': 'CREATE TABLE',
13
-
'db.query.text':
14
-
'CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(?) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"))',
15
12
'db.system.name': 'postgres',
16
13
'sentry.op': 'db',
17
14
'sentry.origin': 'manual',
18
15
'server.address': 'localhost',
19
16
'server.port': 5444,
20
17
}),
21
-
description: 'CREATE TABLE db:test_db',
18
+
description:
19
+
'CREATE TABLE "User" ("id" SERIAL NOT NULL,"createdAt" TIMESTAMP(?) NOT NULL DEFAULT CURRENT_TIMESTAMP,"email" TEXT NOT NULL,"name" TEXT,CONSTRAINT "User_pkey" PRIMARY KEY ("id"))',
22
20
op: 'db',
23
21
status: 'ok',
24
22
origin: 'manual',
@@ -31,16 +29,14 @@ describe('postgresjs auto instrumentation', () => {
31
29
expect.objectContaining({
32
30
data: expect.objectContaining({
33
31
'db.namespace': 'test_db',
34
-
'db.operation.name': 'SELECT',
35
-
'db.query.text':
36
-
"select b.oid, b.typarray from pg_catalog.pg_type a left join pg_catalog.pg_type b on b.oid = a.typelem where a.typcategory = 'A' group by b.oid, b.typarray order by b.oid",
37
32
'db.system.name': 'postgres',
38
33
'sentry.op': 'db',
39
34
'sentry.origin': 'manual',
40
35
'server.address': 'localhost',
41
36
'server.port': 5444,
42
37
}),
43
-
description: 'SELECT db:test_db',
38
+
description:
39
+
"select b.oid, b.typarray from pg_catalog.pg_type a left join pg_catalog.pg_type b on b.oid = a.typelem where a.typcategory = 'A' group by b.oid, b.typarray order by b.oid",
44
40
op: 'db',
45
41
status: 'ok',
46
42
origin: 'manual',
@@ -53,15 +49,13 @@ describe('postgresjs auto instrumentation', () => {
53
49
expect.objectContaining({
54
50
data: expect.objectContaining({
55
51
'db.namespace': 'test_db',
56
-
'db.operation.name': 'INSERT',
57
-
'db.query.text': 'INSERT INTO "User" ("email", "name") VALUES (\'Foo\', \'bar@baz.com\')',
58
52
'db.system.name': 'postgres',
59
53
'sentry.origin': 'manual',
60
54
'sentry.op': 'db',
61
55
'server.address': 'localhost',
62
56
'server.port': 5444,
63
57
}),
64
-
description: 'INSERT db:test_db',
58
+
description: 'INSERT INTO "User" ("email", "name") VALUES (\'Foo\', \'bar@baz.com\')',
65
59
op: 'db',
66
60
status: 'ok',
67
61
origin: 'manual',
@@ -74,15 +68,13 @@ describe('postgresjs auto instrumentation', () => {
74
68
expect.objectContaining({
75
69
data: expect.objectContaining({
76
70
'db.namespace': 'test_db',
77
-
'db.operation.name': 'UPDATE',
78
-
'db.query.text': 'UPDATE "User" SET "name" = \'Foo\' WHERE "email" = \'bar@baz.com\'',
79
71
'db.system.name': 'postgres',
80
72
'sentry.op': 'db',
81
73
'sentry.origin': 'manual',
82
74
'server.address': 'localhost',
83
75
'server.port': 5444,
84
76
}),
85
-
description: 'UPDATE db:test_db',
77
+
description: 'UPDATE "User" SET "name" = \'Foo\' WHERE "email" = \'bar@baz.com\'',
86
78
op: 'db',
87
79
status: 'ok',
88
80
origin: 'manual',
@@ -95,15 +87,13 @@ describe('postgresjs auto instrumentation', () => {
95
87
expect.objectContaining({
96
88
data: expect.objectContaining({
97
89
'db.namespace': 'test_db',
98
-
'db.operation.name': 'SELECT',
99
-
'db.query.text': 'SELECT * FROM "User" WHERE "email" = \'bar@baz.com\'',
100
90
'db.system.name': 'postgres',
101
91
'sentry.op': 'db',
102
92
'sentry.origin': 'manual',
103
93
'server.address': 'localhost',
104
94
'server.port': 5444,
105
95
}),
106
-
description: 'SELECT db:test_db',
96
+
description: 'SELECT * FROM "User" WHERE "email" = \'bar@baz.com\'',
107
97
op: 'db',
108
98
status: 'ok',
109
99
origin: 'manual',
@@ -116,15 +106,13 @@ describe('postgresjs auto instrumentation', () => {
116
106
expect.objectContaining({
117
107
data: expect.objectContaining({
118
108
'db.namespace': 'test_db',
119
-
'db.operation.name': 'SELECT',
120
-
'db.query.text': 'SELECT * from generate_series(?,?) as x',
121
109
'db.system.name': 'postgres',
122
110
'sentry.op': 'db',
123
111
'sentry.origin': 'manual',
124
112
'server.address': 'localhost',
125
113
'server.port': 5444,
126
114
}),
127
-
description: 'SELECT db:test_db',
115
+
description: 'SELECT * from generate_series(?,?) as x',
128
116
op: 'db',
129
117
status: 'ok',
130
118
origin: 'manual',
@@ -137,15 +125,13 @@ describe('postgresjs auto instrumentation', () => {
137
125
expect.objectContaining({
138
126
data: expect.objectContaining({
139
127
'db.namespace': 'test_db',
140
-
'db.operation.name': 'DROP TABLE',
141
-
'db.query.text': 'DROP TABLE "User"',
142
128
'db.system.name': 'postgres',
143
129
'sentry.op': 'db',
144
130
'sentry.origin': 'manual',
145
131
'server.address': 'localhost',
146
132
'server.port': 5444,
147
133
}),
148
-
description: 'DROP TABLE db:test_db',
134
+
description: 'DROP TABLE "User"',
149
135
op: 'db',
150
136
status: 'ok',
151
137
origin: 'manual',
@@ -158,16 +144,13 @@ describe('postgresjs auto instrumentation', () => {
158
144
expect.objectContaining({
159
145
data: expect.objectContaining({
160
146
'db.namespace': 'test_db',
161
-
'db.query.text': 'SELECT * FROM "User" WHERE "email" = \'foo@baz.com\'',
162
147
'db.system.name': 'postgres',
163
148
'sentry.op': 'db',
164
149
'sentry.origin': 'manual',
165
150
'server.address': 'localhost',
166
151
'server.port': 5444,
167
152
}),
168
-
// This span is an error span and the `command` is not available when a does not resolve
169
-
// That's why we can't update the span description when the query fails
170
-
description: 'postgresjs.query',
153
+
description: 'SELECT * FROM "User" WHERE "email" = \'foo@baz.com\'',
0 commit comments