Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Instrumentation.Http/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
To remove this tag, set "http.flavor" to null using `ActivityProcessor`.
([#3380](https://github.com/open-telemetry/opentelemetry-dotnet/issues/3380))

* Fix `Enrich` not getting invoked when SocketException due to HostNotFound
occurs.
([#3407](https://github.com/open-telemetry/opentelemetry-dotnet/issues/3407))

## 1.0.0-rc9.4

Released 2022-Jun-03
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using System;
using System.Diagnostics;
using System.Net.Http;
using System.Net.Sockets;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
Expand Down Expand Up @@ -194,20 +193,7 @@ public override void OnException(Activity activity, object payload)

if (exc is HttpRequestException)
{
if (exc.InnerException is SocketException exception)
{
switch (exception.SocketErrorCode)
{
case SocketError.HostNotFound:
activity.SetStatus(Status.Error.WithDescription(exc.Message));
return;
}
}

if (exc.InnerException != null)
{
activity.SetStatus(Status.Error.WithDescription(exc.Message));
}
activity.SetStatus(Status.Error.WithDescription(exc.Message));
Copy link
Member Author

@alanwest alanwest Jun 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this kind of broadens the scope where we record an error status + description to also include HttpRequestException where InnerException is null... seems kinda odd we'd limit it in this way.

}

try
Expand Down