@@ -215,6 +215,7 @@ describe('GCPFunction', () => {
215215 // The method and path stay on the span even though they are no longer the name.
216216 [ HTTP_REQUEST_METHOD ] : 'POST' ,
217217 [ URL_PATH ] : '/path' ,
218+ [ SENTRY_SEGMENT_NAME_SOURCE ] : 'component' ,
218219 } ) ,
219220 } ) ,
220221 expect . any ( Function ) ,
@@ -233,7 +234,10 @@ describe('GCPFunction', () => {
233234 expect ( mockStartSpanManual ) . toBeCalledWith (
234235 expect . objectContaining ( {
235236 name : 'my-cloud-run-service' ,
236- attributes : expect . objectContaining ( { [ FAAS_NAME ] : 'my-cloud-run-service' } ) ,
237+ attributes : expect . objectContaining ( {
238+ [ FAAS_NAME ] : 'my-cloud-run-service' ,
239+ [ SENTRY_SEGMENT_NAME_SOURCE ] : 'component' ,
240+ } ) ,
237241 } ) ,
238242 expect . any ( Function ) ,
239243 ) ;
@@ -251,7 +255,7 @@ describe('GCPFunction', () => {
251255 expect ( mockStartSpanManual ) . toBeCalledWith (
252256 expect . objectContaining ( {
253257 name : SERVERLESS_FUNCTION_SPAN_NAME_FALLBACK ,
254- attributes : expect . objectContaining ( { [ FAAS_NAME ] : undefined } ) ,
258+ attributes : expect . objectContaining ( { [ FAAS_NAME ] : undefined , [ SENTRY_SEGMENT_NAME_SOURCE ] : 'component' } ) ,
255259 } ) ,
256260 expect . any ( Function ) ,
257261 ) ;
@@ -283,7 +287,10 @@ describe('GCPFunction', () => {
283287 expect ( mockStartSpanManual ) . toBeCalledWith (
284288 expect . objectContaining ( {
285289 name : 'POST /path' ,
286- attributes : expect . objectContaining ( { [ FAAS_NAME ] : 'myCloudFunction' } ) ,
290+ attributes : expect . objectContaining ( {
291+ [ FAAS_NAME ] : 'myCloudFunction' ,
292+ [ SENTRY_SEGMENT_NAME_SOURCE ] : 'route' ,
293+ } ) ,
287294 } ) ,
288295 expect . any ( Function ) ,
289296 ) ;
0 commit comments