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(
48
48
attributes [ 'http.request.body.size' ] = parseInt ( contentLength , 10 ) ;
49
49
}
50
50
51
+ const userAgentHeader = request . headers . get ( 'user-agent' ) ;
52
+ if ( userAgentHeader ) {
53
+ attributes [ 'user_agent.original' ] = userAgentHeader ;
54
+ }
55
+
51
56
attributes [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] = 'http.server' ;
52
57
53
58
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 ;
60
63
}
61
64
62
65
// Do not capture spans for OPTIONS and HEAD requests
You can’t perform that action at this time.
0 commit comments