Skip to content

Commit

Permalink
remove status_code in metrics report when http client returns error a…
Browse files Browse the repository at this point in the history
…nd no response received
  • Loading branch information
2011aad committed Mar 14, 2024
1 parent e8853ea commit fb5258a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tracing/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func ClientMiddleware(opts ...Option) client.Middleware {
span.SetStatus(semconv.SpanStatusFromHTTPStatusCode(resp.StatusCode()))
attrs = append(attrs, semconv.HTTPStatusCodeKey.Int(resp.StatusCode()))
} else { // resp.StatusCode() is not valid when client returns error
span.SetStatus(codes.Error, "Transport layer error")
span.SetStatus(codes.Error, err.Error())
}
span.SetAttributes(attrs...)

Expand Down

0 comments on commit fb5258a

Please sign in to comment.