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
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,9 @@ describe('postgresjs auto instrumentation', () => {
10
10
data: expect.objectContaining({
11
11
'db.namespace': 'test_db',
12
12
'db.system.name': 'postgres',
13
+
'db.operation.name': 'CREATE TABLE',
14
+
'db.query.text':
15
+
'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"))',
13
16
'sentry.op': 'db',
14
17
'sentry.origin': 'auto.db.otel.postgres',
15
18
'server.address': 'localhost',
@@ -30,6 +33,9 @@ describe('postgresjs auto instrumentation', () => {
30
33
data: expect.objectContaining({
31
34
'db.namespace': 'test_db',
32
35
'db.system.name': 'postgres',
36
+
'db.operation.name': 'SELECT',
37
+
'db.query.text':
38
+
"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",
33
39
'sentry.op': 'db',
34
40
'sentry.origin': 'auto.db.otel.postgres',
35
41
'server.address': 'localhost',
@@ -50,6 +56,8 @@ describe('postgresjs auto instrumentation', () => {
50
56
data: expect.objectContaining({
51
57
'db.namespace': 'test_db',
52
58
'db.system.name': 'postgres',
59
+
'db.operation.name': 'INSERT',
60
+
'db.query.text': 'INSERT INTO "User" ("email", "name") VALUES (\'Foo\', \'[email protected]\')',
53
61
'sentry.origin': 'auto.db.otel.postgres',
54
62
'sentry.op': 'db',
55
63
'server.address': 'localhost',
@@ -69,6 +77,8 @@ describe('postgresjs auto instrumentation', () => {
69
77
data: expect.objectContaining({
70
78
'db.namespace': 'test_db',
71
79
'db.system.name': 'postgres',
80
+
'db.operation.name': 'UPDATE',
81
+
'db.query.text': 'UPDATE "User" SET "name" = \'Foo\' WHERE "email" = \'[email protected]\'',
72
82
'sentry.op': 'db',
73
83
'sentry.origin': 'auto.db.otel.postgres',
74
84
'server.address': 'localhost',
@@ -88,6 +98,8 @@ describe('postgresjs auto instrumentation', () => {
88
98
data: expect.objectContaining({
89
99
'db.namespace': 'test_db',
90
100
'db.system.name': 'postgres',
101
+
'db.operation.name': 'SELECT',
102
+
'db.query.text': 'SELECT * FROM "User" WHERE "email" = \'[email protected]\'',
91
103
'sentry.op': 'db',
92
104
'sentry.origin': 'auto.db.otel.postgres',
93
105
'server.address': 'localhost',
@@ -107,6 +119,8 @@ describe('postgresjs auto instrumentation', () => {
107
119
data: expect.objectContaining({
108
120
'db.namespace': 'test_db',
109
121
'db.system.name': 'postgres',
122
+
'db.operation.name': 'SELECT',
123
+
'db.query.text': 'SELECT * from generate_series(?,?) as x',
110
124
'sentry.op': 'db',
111
125
'sentry.origin': 'auto.db.otel.postgres',
112
126
'server.address': 'localhost',
@@ -126,6 +140,8 @@ describe('postgresjs auto instrumentation', () => {
126
140
data: expect.objectContaining({
127
141
'db.namespace': 'test_db',
128
142
'db.system.name': 'postgres',
143
+
'db.operation.name': 'DROP TABLE',
144
+
'db.query.text': 'DROP TABLE "User"',
129
145
'sentry.op': 'db',
130
146
'sentry.origin': 'auto.db.otel.postgres',
131
147
'server.address': 'localhost',
@@ -145,6 +161,10 @@ describe('postgresjs auto instrumentation', () => {
145
161
data: expect.objectContaining({
146
162
'db.namespace': 'test_db',
147
163
'db.system.name': 'postgres',
164
+
// No db.operation.name here, as this is an errored span
165
+
'db.response.status_code': '42P01',
166
+
'error.type': 'PostgresError',
167
+
'db.query.text': 'SELECT * FROM "User" WHERE "email" = \'[email protected]\'',
0 commit comments