Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Convert 500 http status code to trace status code Internal #1227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions plugin/ochttp/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ func TraceStatus(httpStatusCode int, statusLine string) trace.Status {
code = trace.StatusCodeUnauthenticated
case http.StatusTooManyRequests:
code = trace.StatusCodeResourceExhausted
case http.StatusInternalServerError:
code = trace.StatusCodeInternal
case http.StatusNotImplemented:
code = trace.StatusCodeUnimplemented
case http.StatusServiceUnavailable:
Expand Down
2 changes: 1 addition & 1 deletion plugin/ochttp/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ func TestStatusUnitTest(t *testing.T) {
{200, trace.Status{Code: trace.StatusCodeOK, Message: `OK`}},
{204, trace.Status{Code: trace.StatusCodeOK, Message: `OK`}},
{100, trace.Status{Code: trace.StatusCodeUnknown, Message: `UNKNOWN`}},
{500, trace.Status{Code: trace.StatusCodeUnknown, Message: `UNKNOWN`}},
{500, trace.Status{Code: trace.StatusCodeInternal, Message: `INTERNAL`}},
{400, trace.Status{Code: trace.StatusCodeInvalidArgument, Message: `INVALID_ARGUMENT`}},
{422, trace.Status{Code: trace.StatusCodeInvalidArgument, Message: `INVALID_ARGUMENT`}},
{499, trace.Status{Code: trace.StatusCodeCancelled, Message: `CANCELLED`}},
Expand Down