File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
src/OpenTelemetry.Instrumentation.Owin
test/OpenTelemetry.Instrumentation.Owin.Tests Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 55* Updated OpenTelemetry core component version(s) to ` 1.12.0 ` .
66 ([ #2725 ] ( https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2725 ) )
77
8+ * Fixed ` url.query ` value that was incorrectly always set to ` Microsoft.Owin.ReadableStringCollection ` .
9+ ([ #2732 ] ( https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/2732 ) )
10+
811## 1.11.0-beta.1
912
1013Released 2025-Mar-05
Original file line number Diff line number Diff line change @@ -94,13 +94,17 @@ private static void BeginRequest(IOwinContext owinContext)
9494
9595 if ( activity . IsAllDataRequested )
9696 {
97+ var queryString = OwinInstrumentationActivitySource . Options . DisableUrlQueryRedaction
98+ ? request . QueryString . Value
99+ : RedactionHelper . GetRedactedQueryString ( request . QueryString . Value ) ;
100+
97101 RequestDataHelper . SetHttpMethodTag ( activity , request . Method ) ;
98102 activity . SetTag ( SemanticConventions . AttributeServerAddress , request . Uri . Host ) ;
99103 activity . SetTag ( SemanticConventions . AttributeServerPort , request . Uri . Port ) ;
100104 activity . SetTag ( SemanticConventions . AttributeNetworkProtocolVersion , request . Protocol ) ;
101105
102106 activity . SetTag ( SemanticConventions . AttributeUrlPath , request . Uri . AbsolutePath ) ;
103- activity . SetTag ( SemanticConventions . AttributeUrlQuery , request . Query ) ;
107+ activity . SetTag ( SemanticConventions . AttributeUrlQuery , queryString ) ;
104108 activity . SetTag ( SemanticConventions . AttributeUrlScheme , owinContext . Request . Scheme ) ;
105109
106110 if ( request . Headers . TryGetValue ( "User-Agent" , out var userAgent ) && userAgent . Length > 0 )
Original file line number Diff line number Diff line change @@ -345,7 +345,8 @@ Owin has finished to inspect the activity status. */
345345 Assert . Equal ( requestUri . Host , activity . TagObjects . FirstOrDefault ( t => t . Key == SemanticConventions . AttributeServerAddress ) . Value ) ;
346346 Assert . Equal ( requestUri . Port , activity . TagObjects . FirstOrDefault ( t => t . Key == SemanticConventions . AttributeServerPort ) . Value ) ;
347347 Assert . Equal ( "GET" , activity . TagObjects . FirstOrDefault ( t => t . Key == SemanticConventions . AttributeHttpRequestMethod ) . Value ) ;
348- Assert . Equal ( requestUri . AbsolutePath , activity . TagObjects . FirstOrDefault ( t => t . Key == SemanticConventions . AttributeUrlPath ) . Value ) ;
348+ Assert . Equal ( expectedRequestUri . AbsolutePath , activity . TagObjects . FirstOrDefault ( t => t . Key == SemanticConventions . AttributeUrlPath ) . Value ) ;
349+ Assert . Equal ( expectedRequestUri . Query . TrimStart ( '?' ) , activity . TagObjects . FirstOrDefault ( t => t . Key == SemanticConventions . AttributeUrlQuery ) . Value ) ;
349350 }
350351 finally
351352 {
You can’t perform that action at this time.
0 commit comments