Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HttpClient: Invoke Enrich when SocketException = HostNotFound #3407

Merged
Merged
Show file tree
Hide file tree
Changes from 6 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 @@ -194,20 +194,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