Error span on 5xx only

This commit is contained in:
Kevin Crawley 2021-04-14 05:20:03 -05:00 committed by GitHub
parent fe6acdf4d2
commit be81ce244e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View file

@ -117,7 +117,7 @@ func LogRequest(span opentracing.Span, r *http.Request) {
func LogResponseCode(span opentracing.Span, code int) {
if span != nil {
ext.HTTPStatusCode.Set(span, uint16(code))
if code >= 400 {
if code >= http.StatusInternalServerError {
ext.Error.Set(span, true)
}
}