Open selimb opened 1 year ago
@selimb can you clarify what you mean by the method "logging an error"? Is it that the OpenTelemetry span is being marked as failing?
I feel like we shouldn't be marking the span as "Error" here, since as you mention this operation "succeeded" trivially:
We're on datadog but not using OpenTelemetry yet. There's 2 things:
@azure/logger
such that its logs are sent through "mine". See the arrow in red below.http
, and responses with an "error" status code (specifically in the range [400, 500)
) are marked as failing. See arrow in blue below.Note that this was just an example though, the main request was just to expose the error codes. I can imagine the error codes would be useful in other scenarios.
Interesting! I wonder if this mechanism could lead to some other false positives like when services use CAE and Identity has to request a new access token.
But yes I'm not opposed to us better documenting/exposing the known code strings.
Is your feature request related to a problem? Please describe. I would like the KnownStorageErrorCode enum to be exported, such that error codes can more safely be checked against.
Specifically, I re-implement
ContainerClient.createIfNotExists
using the following because I don't like thatcreateIfNotExists
logs an error if the container already exists:Describe the solution you'd like I would like to be able to do:
Describe alternatives you've considered My current workaround is to "hard-code" the
ContainerAlreadyExists
string in my code, as in the first snippet above.