@@ -17,9 +17,14 @@ test('Sends server-side Supabase auth admin `createUser` span', async ({ page, b
17
17
const transactionEvent = await httpTransactionPromise ;
18
18
19
19
expect ( transactionEvent . spans ) . toContainEqual ( {
20
- data : expect . any ( Object ) ,
21
- description : 'createUser' ,
22
- op : 'db.auth.admin.createUser' ,
20
+ data : expect . objectContaining ( {
21
+ 'db.operation' : 'auth.admin.createUser' ,
22
+ 'db.system' : 'postgresql' ,
23
+ 'sentry.op' : 'db' ,
24
+ 'sentry.origin' : 'auto.db.supabase' ,
25
+ } ) ,
26
+ description : 'auth (admin) createUser' ,
27
+ op : 'db' ,
23
28
parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
24
29
span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
25
30
start_timestamp : expect . any ( Number ) ,
@@ -54,8 +59,15 @@ test('Sends client-side Supabase db-operation spans and breadcrumbs to Sentry',
54
59
55
60
expect ( transactionEvent . spans ) . toContainEqual (
56
61
expect . objectContaining ( {
57
- description : 'from(todos)' ,
58
- op : 'db.select' ,
62
+ description : 'select(*) filter(order, asc) from(todos)' ,
63
+ op : 'db' ,
64
+ data : expect . objectContaining ( {
65
+ 'db.operation' : 'select' ,
66
+ 'db.query' : [ 'select(*)' , 'filter(order, asc)' ] ,
67
+ 'db.system' : 'postgresql' ,
68
+ 'sentry.op' : 'db' ,
69
+ 'sentry.origin' : 'auto.db.supabase' ,
70
+ } ) ,
59
71
parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
60
72
span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
61
73
start_timestamp : expect . any ( Number ) ,
@@ -67,9 +79,15 @@ test('Sends client-side Supabase db-operation spans and breadcrumbs to Sentry',
67
79
) ;
68
80
69
81
expect ( transactionEvent . spans ) . toContainEqual ( {
70
- data : expect . any ( Object ) ,
71
- description : 'from(todos)' ,
72
- op : 'db.insert' ,
82
+ data : expect . objectContaining ( {
83
+ 'db.operation' : 'select' ,
84
+ 'db.query' : [ 'select(*)' , 'filter(order, asc)' ] ,
85
+ 'db.system' : 'postgresql' ,
86
+ 'sentry.op' : 'db' ,
87
+ 'sentry.origin' : 'auto.db.supabase' ,
88
+ } ) ,
89
+ description : 'select(*) filter(order, asc) from(todos)' ,
90
+ op : 'db' ,
73
91
parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
74
92
span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
75
93
start_timestamp : expect . any ( Number ) ,
@@ -83,15 +101,15 @@ test('Sends client-side Supabase db-operation spans and breadcrumbs to Sentry',
83
101
timestamp : expect . any ( Number ) ,
84
102
type : 'supabase' ,
85
103
category : 'db.select' ,
86
- message : 'from(todos)' ,
104
+ message : 'select(*) filter(order, asc) from(todos)' ,
87
105
data : expect . any ( Object ) ,
88
106
} ) ;
89
107
90
108
expect ( transactionEvent . breadcrumbs ) . toContainEqual ( {
91
109
timestamp : expect . any ( Number ) ,
92
110
type : 'supabase' ,
93
111
category : 'db.insert' ,
94
- message : 'from(todos)' ,
112
+ message : 'insert(...) select(*) from(todos)' ,
95
113
data : expect . any ( Object ) ,
96
114
} ) ;
97
115
} ) ;
@@ -109,8 +127,15 @@ test('Sends server-side Supabase db-operation spans and breadcrumbs to Sentry',
109
127
110
128
expect ( transactionEvent . spans ) . toContainEqual (
111
129
expect . objectContaining ( {
112
- description : 'from(todos)' ,
113
- op : 'db.select' ,
130
+ data : expect . objectContaining ( {
131
+ 'db.operation' : 'insert' ,
132
+ 'db.query' : [ 'select(*)' ] ,
133
+ 'db.system' : 'postgresql' ,
134
+ 'sentry.op' : 'db' ,
135
+ 'sentry.origin' : 'auto.db.supabase' ,
136
+ } ) ,
137
+ description : 'insert(...) select(*) from(todos)' ,
138
+ op : 'db' ,
114
139
parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
115
140
span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
116
141
start_timestamp : expect . any ( Number ) ,
@@ -122,9 +147,15 @@ test('Sends server-side Supabase db-operation spans and breadcrumbs to Sentry',
122
147
) ;
123
148
124
149
expect ( transactionEvent . spans ) . toContainEqual ( {
125
- data : expect . any ( Object ) ,
126
- description : 'from(todos)' ,
127
- op : 'db.insert' ,
150
+ data : expect . objectContaining ( {
151
+ 'db.operation' : 'select' ,
152
+ 'db.query' : [ 'select(*)' ] ,
153
+ 'db.system' : 'postgresql' ,
154
+ 'sentry.op' : 'db' ,
155
+ 'sentry.origin' : 'auto.db.supabase' ,
156
+ } ) ,
157
+ description : 'select(*) from(todos)' ,
158
+ op : 'db' ,
128
159
parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
129
160
span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
130
161
start_timestamp : expect . any ( Number ) ,
@@ -138,34 +169,38 @@ test('Sends server-side Supabase db-operation spans and breadcrumbs to Sentry',
138
169
timestamp : expect . any ( Number ) ,
139
170
type : 'supabase' ,
140
171
category : 'db.select' ,
141
- message : 'from(todos)' ,
172
+ message : 'select(*) from(todos)' ,
142
173
data : expect . any ( Object ) ,
143
174
} ) ;
144
175
145
176
expect ( transactionEvent . breadcrumbs ) . toContainEqual ( {
146
177
timestamp : expect . any ( Number ) ,
147
178
type : 'supabase' ,
148
179
category : 'db.insert' ,
149
- message : 'from(todos)' ,
180
+ message : 'insert(...) select(*) from(todos)' ,
150
181
data : expect . any ( Object ) ,
151
182
} ) ;
152
183
} ) ;
153
184
154
185
test ( 'Sends server-side Supabase auth admin `listUsers` span' , async ( { page, baseURL } ) => {
155
186
const httpTransactionPromise = waitForTransaction ( 'supabase-nextjs' , transactionEvent => {
156
187
return (
157
- transactionEvent ?. contexts ?. trace ?. op === 'http.server' &&
158
- transactionEvent ?. transaction === 'GET /api/list-users'
188
+ transactionEvent ?. contexts ?. trace ?. op === 'http.server' && transactionEvent ?. transaction === 'GET /api/list-users'
159
189
) ;
160
190
} ) ;
161
191
162
192
await fetch ( `${ baseURL } /api/list-users` ) ;
163
193
const transactionEvent = await httpTransactionPromise ;
164
194
165
195
expect ( transactionEvent . spans ) . toContainEqual ( {
166
- data : expect . any ( Object ) ,
167
- description : 'listUsers' ,
168
- op : 'db.auth.admin.listUsers' ,
196
+ data : expect . objectContaining ( {
197
+ 'db.operation' : 'auth.admin.listUsers' ,
198
+ 'db.system' : 'postgresql' ,
199
+ 'sentry.op' : 'db' ,
200
+ 'sentry.origin' : 'auto.db.supabase' ,
201
+ } ) ,
202
+ description : 'auth (admin) listUsers' ,
203
+ op : 'db' ,
169
204
parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
170
205
span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
171
206
start_timestamp : expect . any ( Number ) ,
0 commit comments