Skip to content

Commit 55cc088

Browse files
authored
Add #nullable enable and fix NullReferenceException in DynamoDB (#7849)
## Summary of changes - Add `#nullable enable` to a bunch of files - Fix `NullReferenceException` in DynamoDB integrations ## Reason for change While looking at logs, spotted null reference exception in DynamoDB integration. Adding `#nullable enable` (and being conservative about what _could_ be null) revealed multiple cases ## Implementation details - Add `#nullable enable` to DynamoDB duck types and integrations - Update source generator to respect updated nullability - Fixed incorrect access on null objects - Add missing dispose on enumerator ## Test coverage Should be covered by existing. These are generally edge cases ## Other details Made other cosmetic changes too, removing unnecessary comments and namespaces etc. Recommend commit-by-commit review for simplicity (bug-fixes are isolated to a single commit)
1 parent 3f1d126 commit 55cc088

File tree

265 files changed

+432
-678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+432
-678
lines changed

tracer/missing-nullability-files.csv

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,6 @@ src/Datadog.Trace/Tagging/AspNetCoreEndpointTags.cs
180180
src/Datadog.Trace/Tagging/AspNetCoreMvcTags.cs
181181
src/Datadog.Trace/Tagging/AspNetCoreTags.cs
182182
src/Datadog.Trace/Tagging/AspNetTags.cs
183-
src/Datadog.Trace/Tagging/AwsDynamoDbTags.cs
184-
src/Datadog.Trace/Tagging/AwsKinesisTags.cs
185-
src/Datadog.Trace/Tagging/AwsSdkTags.cs
186-
src/Datadog.Trace/Tagging/AwsSnsTags.cs
187-
src/Datadog.Trace/Tagging/AwsSqsTags.cs
188183
src/Datadog.Trace/Tagging/AzureFunctionsTags.cs
189184
src/Datadog.Trace/Tagging/AzureServiceBusTags.cs
190185
src/Datadog.Trace/Tagging/CosmosDbTags.cs
@@ -202,7 +197,6 @@ src/Datadog.Trace/Tagging/RabbitMQTags.cs
202197
src/Datadog.Trace/Tagging/RemotingTags.cs
203198
src/Datadog.Trace/Tagging/SqlTags.cs
204199
src/Datadog.Trace/Tagging/TagItem.cs
205-
src/Datadog.Trace/Tagging/TagsList.cs
206200
src/Datadog.Trace/Tagging/TraceAnnotationTags.cs
207201
src/Datadog.Trace/Tagging/WcfTags.cs
208202
src/Datadog.Trace/Tagging/WebTags.cs
@@ -534,23 +528,6 @@ src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AdoNet/Sqlite/SqliteDefinition
534528
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/UserEvents/IIdentityResult.cs
535529
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/UserEvents/IIdentityUser.cs
536530
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AspNetCore/UserEvents/ISignInResult.cs
537-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/AwsDynamoDbCommon.cs
538-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/BatchGetItemAsyncIntegration.cs
539-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/BatchGetItemIntegration.cs
540-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/BatchWriteItemAsyncIntegration.cs
541-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/BatchWriteItemIntegration.cs
542-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/DeleteItemAsyncIntegration.cs
543-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/DeleteItemIntegration.cs
544-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/GetItemAsyncIntegration.cs
545-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/GetItemIntegration.cs
546-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/IAmazonDynamoDbRequestWithTableName.cs
547-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/IBatchRequest.cs
548-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/PutItemAsyncIntegration.cs
549-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/PutItemIntegration.cs
550-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/ScanAsyncIntegration.cs
551-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/ScanIntegration.cs
552-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/UpdateItemAsyncIntegration.cs
553-
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/UpdateItemIntegration.cs
554531
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/Lambda/HandlerWrapperSetHandlerIntegration.cs
555532
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/Lambda/ILambdaExtensionRequest.cs
556533
src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/Lambda/LambdaCommon.cs

tracer/src/Datadog.Trace.SourceGenerators/TagsListGenerator/Sources.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ partial class ")
146146
};
147147
}
148148
149-
public override void SetTag(string key, string value)
149+
public override void SetTag(string key, string? value)
150150
{
151151
switch(key)
152152
{

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/AwsDynamoDbCommon.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
44
// </copyright>
55

6+
#nullable enable
7+
68
using System;
79
using System.Text;
810
using Datadog.Trace.Configuration;
@@ -21,7 +23,7 @@ internal static class AwsDynamoDbCommon
2123
internal const string IntegrationName = nameof(Configuration.IntegrationId.AwsDynamoDb);
2224
internal const IntegrationId IntegrationId = Configuration.IntegrationId.AwsDynamoDb;
2325

24-
public static Scope CreateScope(Tracer tracer, string operation, out AwsDynamoDbTags tags, ISpanContext parentContext = null)
26+
public static Scope? CreateScope(Tracer tracer, string operation, out AwsDynamoDbTags? tags, ISpanContext? parentContext = null)
2527
{
2628
tags = null;
2729

@@ -32,7 +34,7 @@ public static Scope CreateScope(Tracer tracer, string operation, out AwsDynamoDb
3234
return null;
3335
}
3436

35-
Scope scope = null;
37+
Scope? scope = null;
3638

3739
try
3840
{
@@ -61,7 +63,7 @@ public static Scope CreateScope(Tracer tracer, string operation, out AwsDynamoDb
6163
return scope;
6264
}
6365

64-
public static void TagTableNameAndResourceName(string tableName, AwsDynamoDbTags tags, Scope scope)
66+
public static void TagTableNameAndResourceName(string? tableName, AwsDynamoDbTags? tags, Scope? scope)
6567
{
6668
if (scope == null || tags == null || tableName == null)
6769
{
@@ -73,16 +75,17 @@ public static void TagTableNameAndResourceName(string tableName, AwsDynamoDbTags
7375
span.ResourceName = $"{span.ResourceName} {tableName}";
7476
}
7577

76-
public static void TagBatchRequest<TBatchRequest>(TBatchRequest request, AwsDynamoDbTags tags, Scope scope)
78+
public static void TagBatchRequest<TBatchRequest>(TBatchRequest request, AwsDynamoDbTags? tags, Scope? scope)
7779
where TBatchRequest : IBatchRequest
7880
{
79-
if (request.RequestItems.Count != 1)
81+
if (request.RequestItems?.Count != 1)
8082
{
8183
return;
8284
}
8385

8486
// TableName tagging only when batch is from one table.
8587
var iterator = request.RequestItems.GetEnumerator();
88+
using var disposable = iterator as IDisposable;
8689
while (iterator.MoveNext())
8790
{
8891
var tableName = iterator.Key as string;

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/BatchGetItemAsyncIntegration.cs

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
44
// </copyright>
55

6+
#nullable enable
7+
68
using System;
79
using System.ComponentModel;
810
using System.Threading;
911
using Datadog.Trace.ClrProfiler.CallTarget;
1012
using Datadog.Trace.DuckTyping;
11-
using Datadog.Trace.Tagging;
1213

1314
namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.DynamoDb
1415
{
@@ -20,7 +21,7 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.DynamoDb
2021
TypeName = "Amazon.DynamoDBv2.AmazonDynamoDBClient",
2122
MethodName = "BatchGetItemAsync",
2223
ReturnTypeName = "System.Threading.Tasks.Task`1[Amazon.DynamoDBv2.Model.BatchGetItemResponse]",
23-
ParameterTypeNames = new[] { "Amazon.DynamoDBv2.Model.BatchGetItemRequest", ClrNames.CancellationToken },
24+
ParameterTypeNames = ["Amazon.DynamoDBv2.Model.BatchGetItemRequest", ClrNames.CancellationToken],
2425
MinimumVersion = "3.0.0",
2526
MaximumVersion = "4.*.*",
2627
IntegrationName = AwsDynamoDbCommon.IntegrationName)]
@@ -30,15 +31,6 @@ public class BatchGetItemAsyncIntegration
3031
{
3132
private const string Operation = "BatchGetItem";
3233

33-
/// <summary>
34-
/// OnMethodBegin callback
35-
/// </summary>
36-
/// <typeparam name="TTarget">Type of the target</typeparam>
37-
/// <typeparam name="TBatchGetItemRequest">Type of the request object</typeparam>
38-
/// <param name="instance">Instance value, aka `this` of the instrumented method</param>
39-
/// <param name="request">The request for the DynamoDB operation</param>
40-
/// <param name="cancellationToken">CancellationToken value</param>
41-
/// <returns>CallTarget state value</returns>
4234
internal static CallTargetState OnMethodBegin<TTarget, TBatchGetItemRequest>(TTarget instance, TBatchGetItemRequest request, CancellationToken cancellationToken)
4335
where TBatchGetItemRequest : IBatchRequest, IDuckType
4436
{
@@ -47,23 +39,13 @@ internal static CallTargetState OnMethodBegin<TTarget, TBatchGetItemRequest>(TTa
4739
return CallTargetState.GetDefault();
4840
}
4941

50-
var scope = AwsDynamoDbCommon.CreateScope(Tracer.Instance, Operation, out AwsDynamoDbTags tags);
42+
var scope = AwsDynamoDbCommon.CreateScope(Tracer.Instance, Operation, out var tags);
5143
AwsDynamoDbCommon.TagBatchRequest(request, tags, scope);
5244

5345
return new CallTargetState(scope);
5446
}
5547

56-
/// <summary>
57-
/// OnAsyncMethodEnd callback
58-
/// </summary>
59-
/// <typeparam name="TTarget">Type of the target</typeparam>
60-
/// <typeparam name="TResponse">Type of the response, in an async scenario will be T of Task of T</typeparam>
61-
/// <param name="instance">Instance value, aka `this` of the instrumented method.</param>
62-
/// <param name="response">Response instance</param>
63-
/// <param name="exception">Exception instance in case the original code threw an exception.</param>
64-
/// <param name="state">CallTarget state value</param>
65-
/// <returns>A response value, in an async scenario will be T of Task of T</returns>
66-
internal static TResponse OnAsyncMethodEnd<TTarget, TResponse>(TTarget instance, TResponse response, Exception exception, in CallTargetState state)
48+
internal static TResponse OnAsyncMethodEnd<TTarget, TResponse>(TTarget instance, TResponse response, Exception? exception, in CallTargetState state)
6749
{
6850
state.Scope.DisposeWithException(exception);
6951
return response;

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/BatchGetItemIntegration.cs

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
44
// </copyright>
55

6+
#nullable enable
7+
68
using System;
79
using System.ComponentModel;
810
using Datadog.Trace.ClrProfiler.CallTarget;
911
using Datadog.Trace.DuckTyping;
10-
using Datadog.Trace.Tagging;
1112

1213
namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.DynamoDb
1314
{
@@ -19,7 +20,7 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.DynamoDb
1920
TypeName = "Amazon.DynamoDBv2.AmazonDynamoDBClient",
2021
MethodName = "BatchGetItem",
2122
ReturnTypeName = "Amazon.DynamoDBv2.Model.BatchGetItemResponse",
22-
ParameterTypeNames = new[] { "Amazon.DynamoDBv2.Model.BatchGetItemRequest" },
23+
ParameterTypeNames = ["Amazon.DynamoDBv2.Model.BatchGetItemRequest"],
2324
MinimumVersion = "3.0.0",
2425
MaximumVersion = "4.*.*",
2526
IntegrationName = AwsDynamoDbCommon.IntegrationName)]
@@ -29,14 +30,6 @@ public class BatchGetItemIntegration
2930
{
3031
private const string Operation = "BatchGetItem";
3132

32-
/// <summary>
33-
/// OnMethodBegin callback
34-
/// </summary>
35-
/// <typeparam name="TTarget">Type of the target</typeparam>
36-
/// <typeparam name="TBatchGetItemRequest">Type of the request object</typeparam>
37-
/// <param name="instance">Instance value, aka `this` of the instrumented method</param>
38-
/// <param name="request">The request for the DynamoDB operation</param>
39-
/// <returns>CallTarget state value</returns>
4033
internal static CallTargetState OnMethodBegin<TTarget, TBatchGetItemRequest>(TTarget instance, TBatchGetItemRequest request)
4134
where TBatchGetItemRequest : IBatchRequest, IDuckType
4235
{
@@ -45,23 +38,13 @@ internal static CallTargetState OnMethodBegin<TTarget, TBatchGetItemRequest>(TTa
4538
return CallTargetState.GetDefault();
4639
}
4740

48-
var scope = AwsDynamoDbCommon.CreateScope(Tracer.Instance, Operation, out AwsDynamoDbTags tags);
41+
var scope = AwsDynamoDbCommon.CreateScope(Tracer.Instance, Operation, out var tags);
4942
AwsDynamoDbCommon.TagBatchRequest(request, tags, scope);
5043

5144
return new CallTargetState(scope);
5245
}
5346

54-
/// <summary>
55-
/// OnMethodEnd callback
56-
/// </summary>
57-
/// <typeparam name="TTarget">Type of the target</typeparam>
58-
/// <typeparam name="TReturn">Type of the return value</typeparam>
59-
/// <param name="instance">Instance value, aka `this` of the instrumented method.</param>
60-
/// <param name="returnValue">Task of HttpResponse message instance</param>
61-
/// <param name="exception">Exception instance in case the original code threw an exception.</param>
62-
/// <param name="state">CallTarget state value</param>
63-
/// <returns>A response value, in an async scenario will be T of Task of T</returns>
64-
internal static CallTargetReturn<TReturn> OnMethodEnd<TTarget, TReturn>(TTarget instance, TReturn returnValue, Exception exception, in CallTargetState state)
47+
internal static CallTargetReturn<TReturn> OnMethodEnd<TTarget, TReturn>(TTarget instance, TReturn returnValue, Exception? exception, in CallTargetState state)
6548
{
6649
state.Scope.DisposeWithException(exception);
6750
return new CallTargetReturn<TReturn>(returnValue);

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/BatchWriteItemAsyncIntegration.cs

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
44
// </copyright>
55

6+
#nullable enable
7+
68
using System;
79
using System.ComponentModel;
810
using System.Threading;
911
using Datadog.Trace.ClrProfiler.CallTarget;
1012
using Datadog.Trace.DuckTyping;
11-
using Datadog.Trace.Tagging;
1213

1314
namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.DynamoDb
1415
{
@@ -20,7 +21,7 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.DynamoDb
2021
TypeName = "Amazon.DynamoDBv2.AmazonDynamoDBClient",
2122
MethodName = "BatchWriteItemAsync",
2223
ReturnTypeName = "System.Threading.Tasks.Task`1[Amazon.DynamoDBv2.Model.BatchWriteItemResponse]",
23-
ParameterTypeNames = new[] { "Amazon.DynamoDBv2.Model.BatchWriteItemRequest", ClrNames.CancellationToken },
24+
ParameterTypeNames = ["Amazon.DynamoDBv2.Model.BatchWriteItemRequest", ClrNames.CancellationToken],
2425
MinimumVersion = "3.0.0",
2526
MaximumVersion = "4.*.*",
2627
IntegrationName = AwsDynamoDbCommon.IntegrationName)]
@@ -30,15 +31,6 @@ public class BatchWriteItemAsyncIntegration
3031
{
3132
private const string Operation = "BatchWriteItem";
3233

33-
/// <summary>
34-
/// OnMethodBegin callback
35-
/// </summary>
36-
/// <typeparam name="TTarget">Type of the target</typeparam>
37-
/// <typeparam name="TBatchWriteItemRequest">Type of the request object</typeparam>
38-
/// <param name="instance">Instance value, aka `this` of the instrumented method</param>
39-
/// <param name="request">The request for the DynamoDB operation</param>
40-
/// <param name="cancellationToken">CancellationToken value</param>
41-
/// <returns>CallTarget state value</returns>
4234
internal static CallTargetState OnMethodBegin<TTarget, TBatchWriteItemRequest>(TTarget instance, TBatchWriteItemRequest request, CancellationToken cancellationToken)
4335
where TBatchWriteItemRequest : IBatchRequest, IDuckType
4436
{
@@ -47,23 +39,13 @@ internal static CallTargetState OnMethodBegin<TTarget, TBatchWriteItemRequest>(T
4739
return CallTargetState.GetDefault();
4840
}
4941

50-
var scope = AwsDynamoDbCommon.CreateScope(Tracer.Instance, Operation, out AwsDynamoDbTags tags);
42+
var scope = AwsDynamoDbCommon.CreateScope(Tracer.Instance, Operation, out var tags);
5143
AwsDynamoDbCommon.TagBatchRequest(request, tags, scope);
5244

5345
return new CallTargetState(scope);
5446
}
5547

56-
/// <summary>
57-
/// OnAsyncMethodEnd callback
58-
/// </summary>
59-
/// <typeparam name="TTarget">Type of the target</typeparam>
60-
/// <typeparam name="TResponse">Type of the response, in an async scenario will be T of Task of T</typeparam>
61-
/// <param name="instance">Instance value, aka `this` of the instrumented method.</param>
62-
/// <param name="response">Response instance</param>
63-
/// <param name="exception">Exception instance in case the original code threw an exception.</param>
64-
/// <param name="state">CallTarget state value</param>
65-
/// <returns>A response value, in an async scenario will be T of Task of T</returns>
66-
internal static TResponse OnAsyncMethodEnd<TTarget, TResponse>(TTarget instance, TResponse response, Exception exception, in CallTargetState state)
48+
internal static TResponse OnAsyncMethodEnd<TTarget, TResponse>(TTarget instance, TResponse response, Exception? exception, in CallTargetState state)
6749
{
6850
state.Scope.DisposeWithException(exception);
6951
return response;

tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/AWS/DynamoDb/BatchWriteItemIntegration.cs

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2017 Datadog, Inc.
44
// </copyright>
55

6+
#nullable enable
7+
68
using System;
79
using System.ComponentModel;
810
using Datadog.Trace.ClrProfiler.CallTarget;
911
using Datadog.Trace.DuckTyping;
10-
using Datadog.Trace.Tagging;
1112

1213
namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.DynamoDb
1314
{
@@ -19,7 +20,7 @@ namespace Datadog.Trace.ClrProfiler.AutoInstrumentation.AWS.DynamoDb
1920
TypeName = "Amazon.DynamoDBv2.AmazonDynamoDBClient",
2021
MethodName = "BatchWriteItem",
2122
ReturnTypeName = "Amazon.DynamoDBv2.Model.BatchWriteItemResponse",
22-
ParameterTypeNames = new[] { "Amazon.DynamoDBv2.Model.BatchWriteItemRequest" },
23+
ParameterTypeNames = ["Amazon.DynamoDBv2.Model.BatchWriteItemRequest"],
2324
MinimumVersion = "3.0.0",
2425
MaximumVersion = "4.*.*",
2526
IntegrationName = AwsDynamoDbCommon.IntegrationName)]
@@ -29,14 +30,6 @@ public class BatchWriteItemIntegration
2930
{
3031
private const string Operation = "BatchWriteItem";
3132

32-
/// <summary>
33-
/// OnMethodBegin callback
34-
/// </summary>
35-
/// <typeparam name="TTarget">Type of the target</typeparam>
36-
/// <typeparam name="TBatchWriteItemRequest">Type of the request object</typeparam>
37-
/// <param name="instance">Instance value, aka `this` of the instrumented method</param>
38-
/// <param name="request">The request for the DynamoDB operation</param>
39-
/// <returns>CallTarget state value</returns>
4033
internal static CallTargetState OnMethodBegin<TTarget, TBatchWriteItemRequest>(TTarget instance, TBatchWriteItemRequest request)
4134
where TBatchWriteItemRequest : IBatchRequest, IDuckType
4235
{
@@ -45,23 +38,13 @@ internal static CallTargetState OnMethodBegin<TTarget, TBatchWriteItemRequest>(T
4538
return CallTargetState.GetDefault();
4639
}
4740

48-
var scope = AwsDynamoDbCommon.CreateScope(Tracer.Instance, Operation, out AwsDynamoDbTags tags);
41+
var scope = AwsDynamoDbCommon.CreateScope(Tracer.Instance, Operation, out var tags);
4942
AwsDynamoDbCommon.TagBatchRequest(request, tags, scope);
5043

5144
return new CallTargetState(scope);
5245
}
5346

54-
/// <summary>
55-
/// OnMethodEnd callback
56-
/// </summary>
57-
/// <typeparam name="TTarget">Type of the target</typeparam>
58-
/// <typeparam name="TReturn">Type of the return value</typeparam>
59-
/// <param name="instance">Instance value, aka `this` of the instrumented method.</param>
60-
/// <param name="returnValue">Task of HttpResponse message instance</param>
61-
/// <param name="exception">Exception instance in case the original code threw an exception.</param>
62-
/// <param name="state">CallTarget state value</param>
63-
/// <returns>A response value, in an async scenario will be T of Task of T</returns>
64-
internal static CallTargetReturn<TReturn> OnMethodEnd<TTarget, TReturn>(TTarget instance, TReturn returnValue, Exception exception, in CallTargetState state)
47+
internal static CallTargetReturn<TReturn> OnMethodEnd<TTarget, TReturn>(TTarget instance, TReturn returnValue, Exception? exception, in CallTargetState state)
6548
{
6649
state.Scope.DisposeWithException(exception);
6750
return new CallTargetReturn<TReturn>(returnValue);

0 commit comments

Comments
 (0)