@@ -231,27 +231,31 @@ static AdoNetSignature GetAdoNetSignature(TypeDefinition type, CustomAttribute a
231
231
int ? integrationKind = null ;
232
232
int ? returnType = null ;
233
233
string callTargetType = null ;
234
+ var instrumentationCategory = InstrumentationCategory . Tracing ;
234
235
235
236
foreach ( var namedArgument in attribute . Properties )
236
237
{
237
238
switch ( namedArgument . Name )
238
239
{
239
- case nameof ( AdoNetSignatureAttributeProperties . MethodName ) :
240
+ case nameof ( AdoNetTargetSignatureAttributeProperties . MethodName ) :
240
241
methodName = namedArgument . Argument . Value ? . ToString ( ) ;
241
242
break ;
242
- case nameof ( AdoNetSignatureAttributeProperties . ReturnTypeName ) :
243
+ case nameof ( AdoNetTargetSignatureAttributeProperties . ReturnTypeName ) :
243
244
returnTypeName = namedArgument . Argument . Value ? . ToString ( ) ;
244
245
break ;
245
- case nameof ( AdoNetSignatureAttributeProperties . ParameterTypeNames ) :
246
+ case nameof ( AdoNetTargetSignatureAttributeProperties . ParameterTypeNames ) :
246
247
parameterTypeNames = GetStringArray ( namedArgument . Argument . Value ) ;
247
248
break ;
248
- case nameof ( AdoNetSignatureAttributeProperties . CallTargetType ) :
249
+ case nameof ( AdoNetTargetSignatureAttributeProperties . CallTargetType ) :
249
250
callTargetType = ( ( TypeDefinition ) namedArgument . Argument . Value ) . FullName ;
250
251
break ;
251
- case nameof ( AdoNetSignatureAttributeProperties . CallTargetIntegrationKind ) :
252
+ case nameof ( AdoNetTargetSignatureAttributeProperties . CallTargetIntegrationKind ) :
252
253
integrationKind = namedArgument . Argument . Value as int ? ;
253
254
break ;
254
- case nameof ( AdoNetSignatureAttributeProperties . ReturnType ) :
255
+ case nameof ( AdoNetTargetSignatureAttributeProperties . InstrumentationCategory ) :
256
+ instrumentationCategory = ( InstrumentationCategory ) ( namedArgument . Argument . Value as uint ? ) . GetValueOrDefault ( ) ;
257
+ break ;
258
+ case nameof ( AdoNetTargetSignatureAttributeProperties . ReturnType ) :
255
259
returnType = namedArgument . Argument . Value as int ? ;
256
260
break ;
257
261
default :
@@ -279,9 +283,10 @@ static AdoNetSignature GetAdoNetSignature(TypeDefinition type, CustomAttribute a
279
283
targetMethodName : methodName ! ,
280
284
targetReturnType : returnTypeName ,
281
285
targetParameterTypes : parameterTypeNames ?? Array . Empty < string > ( ) ,
286
+ returnType : returnType ?? 0 ,
282
287
instrumentationTypeName : callTargetType ! . ToString ( ) ,
283
288
callTargetIntegrationKind : integrationKind ?? 0 ,
284
- returnType : returnType ?? 0 ) ;
289
+ instrumentationCategory : instrumentationCategory ) ;
285
290
}
286
291
287
292
static List < AssemblyCallTargetDefinitionSource > GetAdoNetClientInstruments ( CustomAttribute attribute )
@@ -421,7 +426,7 @@ static List<CallTargetDefinitionSource> MergeAdoNetAttributes(List<AssemblyCallT
421
426
instrumentationTypeName : signature . InstrumentationTypeName ,
422
427
integrationKind : signature . CallTargetIntegrationKind ,
423
428
isAdoNetIntegration : true ,
424
- instrumentationCategory : InstrumentationCategory . Tracing ) ;
429
+ instrumentationCategory : signature . InstrumentationCategory ) ;
425
430
426
431
res . Add ( callTargetSource ) ;
427
432
}
@@ -716,14 +721,15 @@ public CallTargetDefinitionSource(string integrationName, string assemblyName, s
716
721
717
722
internal record AdoNetSignature
718
723
{
719
- public AdoNetSignature ( string className , string targetMethodName , string targetReturnType , string [ ] targetParameterTypes , string instrumentationTypeName , int callTargetIntegrationKind , int returnType )
724
+ public AdoNetSignature ( string className , string targetMethodName , string targetReturnType , string [ ] targetParameterTypes , string instrumentationTypeName , int callTargetIntegrationKind , int returnType , InstrumentationCategory instrumentationCategory )
720
725
{
721
726
ClassName = className ;
722
727
TargetMethodName = targetMethodName ;
723
728
TargetReturnType = targetReturnType ;
724
729
TargetParameterTypes = new ( targetParameterTypes ) ;
725
730
InstrumentationTypeName = instrumentationTypeName ;
726
731
CallTargetIntegrationKind = callTargetIntegrationKind ;
732
+ InstrumentationCategory = instrumentationCategory ;
727
733
ReturnType = returnType ;
728
734
}
729
735
@@ -739,6 +745,8 @@ public AdoNetSignature(string className, string targetMethodName, string targetR
739
745
740
746
public int CallTargetIntegrationKind { get ; }
741
747
748
+ public InstrumentationCategory InstrumentationCategory { get ; }
749
+
742
750
public int ReturnType { get ; }
743
751
}
744
752
@@ -796,14 +804,15 @@ private static class InstrumentAttributeProperties
796
804
public const string InstrumentationCategory = nameof ( InstrumentationCategory ) ;
797
805
}
798
806
799
- private static class AdoNetSignatureAttributeProperties
807
+ private static class AdoNetTargetSignatureAttributeProperties
800
808
{
801
809
public const string MethodName = nameof ( MethodName ) ;
802
810
public const string ReturnTypeName = nameof ( ReturnTypeName ) ;
803
811
public const string ParameterTypeNames = nameof ( ParameterTypeNames ) ;
812
+ public const string ReturnType = nameof ( ReturnType ) ;
804
813
public const string CallTargetType = nameof ( CallTargetType ) ;
805
814
public const string CallTargetIntegrationKind = nameof ( CallTargetIntegrationKind ) ;
806
- public const string ReturnType = nameof ( ReturnType ) ;
815
+ public const string InstrumentationCategory = nameof ( InstrumentationCategory ) ;
807
816
}
808
817
809
818
private static class AdoNetInstrumentAttributeProperties
0 commit comments