Skip to content

Conversation

@gouthamve
Copy link
Contributor

@gouthamve gouthamve commented May 13, 2020

This pulls in weaveworks/common#187 and reverts #2483

Before:

2020-05-12 16:14:31.381381 I | http: superfluous response.WriteHeader call from github.com/opentracing-contrib/go-stdlib/nethttp.(*statusCodeTracker).WriteHeader (status-code-tracker.go:19)
level=warn ts=2020-05-12T15:14:31.381571716Z caller=logging.go:49 traceID=1bce8fc8c1a57be7 msg="GET /api/v1/query?query=up[10000m]&start=1557759455&step=126144 (500) 729.261961ms Response: \"write tcp 127.0.0.1:9091->127.0.0.1:54276: write: broken pipe\\n\" ws: false; Accept: */*; User-Agent: curl/7.70.0; "

After:

level=warn ts=2020-05-12T15:13:17.161683485Z caller=logging.go:51 traceID=604b1b0b5218a0e7 msg="GET /api/v1/query?query=up[10000m]&start=1557759455&step=126144 728.757586ms, error: write tcp 127.0.0.1:9091->127.0.0.1:54270: write: broken pipe ws: false; Accept: */*; User-Agent: curl/7.70.0; "

The new log is more accurate (the status code in this case is not 500), and also doesn't log the duplicate header write golang error.

@gouthamve gouthamve changed the title Correct logging fix Properly fix the wrong logging of 200 when write to client fails May 13, 2020
@gouthamve gouthamve force-pushed the correct-logging-fix branch from 9a3e97e to dc0a787 Compare May 13, 2020 09:24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to be merged by PR #2576. I suggest merge them in order.

Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gouthamve gouthamve force-pushed the correct-logging-fix branch from dc0a787 to e417867 Compare May 14, 2020 13:27
@gouthamve gouthamve merged commit 9147e5a into cortexproject:master May 14, 2020
@gouthamve gouthamve deleted the correct-logging-fix branch May 14, 2020 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants