Skip to content

Commit

Permalink
Merge pull request #1 from carlosalberto/error_flagging
Browse files Browse the repository at this point in the history
Apply feedback.
  • Loading branch information
tedsuo authored Sep 24, 2020
2 parents cdb0f04 + ff6d57c commit 920dabd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 34 deletions.
8 changes: 1 addition & 7 deletions specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Table of Contents
* [Status creation](#status-creation)
* [GetCanonicalCode](#getcanonicalcode)
* [GetDescription](#getdescription)
* [GetIsOk](#getisok)
* [SpanKind](#spankind)
* [Concurrency](#concurrency)
* [Included Propagators](#included-propagators)
Expand Down Expand Up @@ -578,8 +577,7 @@ a canonical code, and an optional descriptive message.
### StatusCanonicalCode

`StatusCanonicalCode` represents the canonical set of status codes of a finished
`Span`, following the [Standard GRPC
codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md):
`Span`.

- `Unset`
- The default status.
Expand Down Expand Up @@ -627,10 +625,6 @@ Returns the `StatusCanonicalCode` of this `Status`.
Returns the description of this `Status`.
Languages should follow their usual conventions on whether to return `null` or an empty string here if no description was given.

### GetIsError

Returns true if the canonical code of this `Status` is `Error`, otherwise false.

## SpanKind

`SpanKind` describes the relationship between the Span, its parents,
Expand Down
34 changes: 7 additions & 27 deletions specification/trace/semantic_conventions/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,33 +37,13 @@ default span name.

## Status

Implementations MUST set the [span status](../api.md#status) if the HTTP communication failed
or an HTTP error status code is returned (e.g. above 3xx).

In the case of an HTTP redirect, the request should normally be considered successful,
unless the client aborts following redirects due to hitting some limit (redirect loop).
If following a (chain of) redirect(s) successfully, the status should be set according to the result of the final HTTP request.

Don't set the span status description if the reason can be inferred from `http.status_code` and `http.status_text`.

| HTTP code | Span status code |
|-------------------------|-----------------------|
| 100...299 | `Ok` |
| 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
[Span Status](../api.md#status) MUST be left unset if HTTP status code was in the
1xx, 2xx or 3xx ranges, unless there was another error (e.g., network error receiving
the response body; or 3xx codes with max redirects exceeded), in which case status
MUST be set to `Error`.

For HTTP status codes in the 4xx and 5xx ranges, as well as any other code the client
failed to interpret, status MUST be set to `Error`.

## Common Attributes

Expand Down

0 comments on commit 920dabd

Please sign in to comment.