File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -48,15 +48,18 @@ export function wrapRequestHandler(
4848 attributes [ 'http.request.body.size' ] = parseInt ( contentLength , 10 ) ;
4949 }
5050
51+ const userAgentHeader = request . headers . get ( 'user-agent' ) ;
52+ if ( userAgentHeader ) {
53+ attributes [ 'user_agent.original' ] = userAgentHeader ;
54+ }
55+
5156 attributes [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] = 'http.server' ;
5257
5358 addCloudResourceContext ( isolationScope ) ;
54- if ( request ) {
55- addRequest ( isolationScope , request ) ;
56- if ( request . cf ) {
57- addCultureContext ( isolationScope , request . cf ) ;
58- attributes [ 'network.protocol.name' ] = request . cf . httpProtocol ;
59- }
59+ addRequest ( isolationScope , request ) ;
60+ if ( request . cf ) {
61+ addCultureContext ( isolationScope , request . cf ) ;
62+ attributes [ 'network.protocol.name' ] = request . cf . httpProtocol ;
6063 }
6164
6265 // Do not capture spans for OPTIONS and HEAD requests
You can’t perform that action at this time.
0 commit comments