Skip to content

Commit

Permalink
Report Exception.FullName for http.client.request.duration/error.type (
Browse files Browse the repository at this point in the history
  • Loading branch information
antonfirsov committed Oct 12, 2023
1 parent 121530f commit 0032260
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private static bool TryGetErrorType(HttpResponseMessage? response, Exception? ex
HttpRequestError.ConfigurationLimitExceeded => "configuration_limit_exceeded",

// Fall back to the exception type name in case of HttpRequestError.Unknown or when exception is not an HttpRequestException.
_ => exception.GetType().Name
_ => exception.GetType().FullName!
};
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -670,8 +670,8 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
_output.WriteLine($"Client exception: {clientException}");
string[] expectedExceptionTypes = TestAsync
? [nameof(TaskCanceledException)]
: [nameof(TaskCanceledException), nameof(OperationCanceledException)];
? [typeof(TaskCanceledException).FullName]
: [typeof(TaskCanceledException).FullName, typeof(OperationCanceledException).FullName];
Measurement<double> m = Assert.Single(recorder.GetMeasurements());
VerifyRequestDuration(m, uri, acceptedErrorTypes: expectedExceptionTypes);
Expand Down Expand Up @@ -859,7 +859,7 @@ await LoopbackServerFactory.CreateClientAndServerAsync(async uri =>
Assert.True(ex is HttpRequestException or TaskCanceledException);
Measurement<double> m = Assert.Single(recorder.GetMeasurements());
VerifyRequestDuration(m, uri, acceptedErrorTypes: [nameof(TaskCanceledException), "response_ended"]);
VerifyRequestDuration(m, uri, acceptedErrorTypes: [typeof(TaskCanceledException).FullName, "response_ended"]);
}, async server =>
{
try
Expand Down

0 comments on commit 0032260

Please sign in to comment.