File tree Expand file tree Collapse file tree
packages/server-utils/src/integrations/tracing-channel/aws-sdk/services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,9 +25,6 @@ export class LambdaServiceExtension implements ServiceExtension {
2525 [ ATTR_FAAS_INVOKED_NAME ] : functionName ,
2626 [ ATTR_FAAS_INVOKED_PROVIDER ] : 'aws' ,
2727 } ;
28- if ( request . region ) {
29- spanAttributes [ ATTR_FAAS_INVOKED_REGION ] = request . region ;
30- }
3128 spanName = `${ functionName } ${ INVOKE_COMMAND } ` ;
3229 break ;
3330 }
@@ -47,6 +44,11 @@ export class LambdaServiceExtension implements ServiceExtension {
4744 public responseHook ( response : NormalizedResponse , span : Span ) : void {
4845 if ( response . request . commandName === INVOKE_COMMAND ) {
4946 span . setAttribute ( ATTR_FAAS_EXECUTION , response . requestId ) ;
47+ // Region resolves asynchronously after `requestPreSpanHook`, so it's backfilled onto the
48+ // normalized request and read here (same timing as `cloud.region`).
49+ if ( response . request . region ) {
50+ span . setAttribute ( ATTR_FAAS_INVOKED_REGION , response . request . region ) ;
51+ }
5052 }
5153 }
5254}
You can’t perform that action at this time.
0 commit comments