@@ -17,9 +17,14 @@ test('Sends server-side Supabase auth admin `createUser` span', async ({ page, b
1717 const transactionEvent = await httpTransactionPromise ;
1818
1919 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' ,
2328 parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
2429 span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
2530 start_timestamp : expect . any ( Number ) ,
@@ -54,8 +59,15 @@ test('Sends client-side Supabase db-operation spans and breadcrumbs to Sentry',
5459
5560 expect ( transactionEvent . spans ) . toContainEqual (
5661 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+ } ) ,
5971 parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
6072 span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
6173 start_timestamp : expect . any ( Number ) ,
@@ -67,9 +79,15 @@ test('Sends client-side Supabase db-operation spans and breadcrumbs to Sentry',
6779 ) ;
6880
6981 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' ,
7391 parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
7492 span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
7593 start_timestamp : expect . any ( Number ) ,
@@ -83,15 +101,15 @@ test('Sends client-side Supabase db-operation spans and breadcrumbs to Sentry',
83101 timestamp : expect . any ( Number ) ,
84102 type : 'supabase' ,
85103 category : 'db.select' ,
86- message : 'from(todos)' ,
104+ message : 'select(*) filter(order, asc) from(todos)' ,
87105 data : expect . any ( Object ) ,
88106 } ) ;
89107
90108 expect ( transactionEvent . breadcrumbs ) . toContainEqual ( {
91109 timestamp : expect . any ( Number ) ,
92110 type : 'supabase' ,
93111 category : 'db.insert' ,
94- message : 'from(todos)' ,
112+ message : 'insert(...) select(*) from(todos)' ,
95113 data : expect . any ( Object ) ,
96114 } ) ;
97115} ) ;
@@ -109,8 +127,15 @@ test('Sends server-side Supabase db-operation spans and breadcrumbs to Sentry',
109127
110128 expect ( transactionEvent . spans ) . toContainEqual (
111129 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' ,
114139 parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
115140 span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
116141 start_timestamp : expect . any ( Number ) ,
@@ -122,9 +147,15 @@ test('Sends server-side Supabase db-operation spans and breadcrumbs to Sentry',
122147 ) ;
123148
124149 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' ,
128159 parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
129160 span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
130161 start_timestamp : expect . any ( Number ) ,
@@ -138,34 +169,38 @@ test('Sends server-side Supabase db-operation spans and breadcrumbs to Sentry',
138169 timestamp : expect . any ( Number ) ,
139170 type : 'supabase' ,
140171 category : 'db.select' ,
141- message : 'from(todos)' ,
172+ message : 'select(*) from(todos)' ,
142173 data : expect . any ( Object ) ,
143174 } ) ;
144175
145176 expect ( transactionEvent . breadcrumbs ) . toContainEqual ( {
146177 timestamp : expect . any ( Number ) ,
147178 type : 'supabase' ,
148179 category : 'db.insert' ,
149- message : 'from(todos)' ,
180+ message : 'insert(...) select(*) from(todos)' ,
150181 data : expect . any ( Object ) ,
151182 } ) ;
152183} ) ;
153184
154185test ( 'Sends server-side Supabase auth admin `listUsers` span' , async ( { page, baseURL } ) => {
155186 const httpTransactionPromise = waitForTransaction ( 'supabase-nextjs' , transactionEvent => {
156187 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'
159189 ) ;
160190 } ) ;
161191
162192 await fetch ( `${ baseURL } /api/list-users` ) ;
163193 const transactionEvent = await httpTransactionPromise ;
164194
165195 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' ,
169204 parent_span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
170205 span_id : expect . stringMatching ( / [ a - f 0 - 9 ] { 16 } / ) ,
171206 start_timestamp : expect . any ( Number ) ,
0 commit comments