Skip to content

Commit

Permalink
Update HTTP status code mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Ted Young committed Sep 17, 2020
1 parent 5cdce91 commit 2dff27e
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions specification/trace/semantic_conventions/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,19 @@ Don't set the span status description if the reason can be inferred from `http.s
| HTTP code | Span status code |
|-------------------------|-----------------------|
| 100...299 | `Ok` |
| 3xx redirect codes | `DeadlineExceeded` in case of loop (see above) [1], otherwise `Ok` |
| 401 Unauthorized ⚠ | `Unauthenticated` ⚠ (Unauthorized actually means unauthenticated according to [RFC 7235][rfc-unauthorized]) |
| 403 Forbidden | `PermissionDenied` |
| 404 Not Found | `NotFound` |
| 429 Too Many Requests | `ResourceExhausted` |
| 499 Client Closed | `Cancelled` (Not an official HTTP status code, defined by [NGINX][nginx-http-499]) |
| Other 4xx code | `InvalidArgument` [1] |
| 501 Not Implemented | `Unimplemented` |
| 503 Service Unavailable | `Unavailable` |
| 504 Gateway Timeout | `DeadlineExceeded` |
| Other 5xx code | `Internal` [1] |
| Any status code the client fails to interpret (e.g., 093 or 573) | `Unknown` |

Note that the items marked with [1] are different from the mapping defined in the [OpenCensus semantic conventions][oc-http-status].

[oc-http-status]: https://github.com/census-instrumentation/opencensus-specs/blob/master/trace/HTTP.md#mapping-from-http-status-codes-to-trace-status-codes
| 3xx redirect codes | `Error` in case of loop (see above), otherwise `Ok` |
| 401 Unauthorized ⚠ | `Error` ⚠ (Unauthorized actually means unauthenticated according to [RFC 7235][rfc-unauthorized]) |
| 403 Forbidden | `Error` |
| 404 Not Found | `Error` |
| 429 Too Many Requests | `Error` |
| 499 Client Closed | `Error` (Not an official HTTP status code, defined by [NGINX][nginx-http-499]) |
| Other 4xx code | `Error` |
| 501 Not Implemented | `Error` |
| 503 Service Unavailable | `Error` |
| 504 Gateway Timeout | `Error` |
| Other 5xx code | `Error` |
| Any status code the client fails to interpret (e.g., 093 or 573) | `Error` |

[rfc-unauthorized]: https://tools.ietf.org/html/rfc7235#section-3.1
[nginx-http-499]: https://httpstatuses.com/499

Expand Down

0 comments on commit 2dff27e

Please sign in to comment.