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

[HttpWebRequest] Add additional error types #5111

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.
Jump to
Jump to file
Failed to load files.
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 @@ -26,6 +26,10 @@
* **Breaking Change**: Removed `http.user_agent` tag from HttpClient activity.
([#5110](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5110))

* `HttpWebRequest` : Introduced additional values for `error.type` tag on
activity and `http.client.request.duration` metric.
([#5111](https://github.com/open-telemetry/opentelemetry-dotnet/pull/5111))

## 1.6.0-beta.3

Released 2023-Nov-17
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,21 @@ private static string GetErrorType(Exception exception)
{
WebExceptionStatus.NameResolutionFailure => "name_resolution_failure",
WebExceptionStatus.ConnectFailure => "connect_failure",
WebExceptionStatus.ReceiveFailure => "receive_failure",
utpilla marked this conversation as resolved.
Show resolved Hide resolved
WebExceptionStatus.SendFailure => "send_failure",
WebExceptionStatus.PipelineFailure => "pipeline_failure",
WebExceptionStatus.RequestCanceled => "request_cancelled",
WebExceptionStatus.ProtocolError => "protocol_error",
WebExceptionStatus.ConnectionClosed => "connection_closed",
WebExceptionStatus.TrustFailure => "trust_failure",
WebExceptionStatus.SecureChannelFailure => "secure_channel_failure",
WebExceptionStatus.ServerProtocolViolation => "server_protocol_violation",
WebExceptionStatus.KeepAliveFailure => "keep_alive_failure",
WebExceptionStatus.Timeout => "timeout",
WebExceptionStatus.ProxyNameResolutionFailure => "proxy_name_resolution_failure",
WebExceptionStatus.MessageLengthLimitExceeded => "message_length_limit_exceeded",
WebExceptionStatus.RequestProhibitedByCachePolicy => "request_prohibited_by_cache_policy",
WebExceptionStatus.RequestProhibitedByProxy => "request_prohibited_by_proxy",
_ => wexc.GetType().FullName,
};
}
Expand Down