Skip to content

Commit

Permalink
[HttpWebRequest] Add additional error types (#5111)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishweshbankwar committed Dec 1, 2023
1 parent c48c014 commit c5f5dd7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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",
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

0 comments on commit c5f5dd7

Please sign in to comment.