Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: log x-request-id header if present #407

Merged
merged 1 commit into from
Dec 14, 2018

Conversation

adamdecaf
Copy link
Member

@adamdecaf adamdecaf commented Dec 13, 2018

The logging middleware isn't able to show the requestId, which is how
we trace requests through all systems. Instead we needed to pull that
header off and pass it around to each endpoint function.

Our timing metrics were always 0ms as ach currently does everything inmem.

New Logs:

$ go run ./cmd/server/
ts=2018-12-13T19:03:14.593253Z caller=main.go:69 startup="Starting ach server version v0.6.0-rc2"
ts=2018-12-13T19:03:14.593828Z caller=main.go:122 transport=HTTP addr=:8080
ts=2018-12-13T19:03:14.593915Z caller=main.go:112 admin="listening on :9090"
ts=2018-12-13T19:03:20.979302Z caller=files.go:61 component=HTTP files=createFile requestId=9ee116937ad6d3de7a4db34294b3f3c20e5ff868 error=null
ts=2018-12-13T19:03:20.97991Z caller=files.go:230 component=HTTP files=getFileContents requestId=53666a141fb23672dc8e26730054384ad46fe1f9 error=null
ts=2018-12-13T19:03:20.980228Z caller=files.go:270 component=HTTP files=validateFile requestId=a89e4e5bdefedf44a973daa477793b15b5061477 error=null
ts=2018-12-13T19:03:21.928213Z caller=files.go:61 component=HTTP files=createFile requestId=25471e4010e241e0c3cb510a1e6491ea0d290e2b error=null
ts=2018-12-13T19:03:21.928502Z caller=files.go:230 component=HTTP files=getFileContents requestId=1973e578875119d08312337c83f304fbbae64921 error=null
ts=2018-12-13T19:03:21.928717Z caller=files.go:270 component=HTTP files=validateFile requestId=2d4b912bc4e4fba35e6c540f815ca4090944e4a0 error=null

The logging middleware isn't able to show the requestId, which is how
we trace requests through all systems. Instead we needed to pull that
header off and pass it around to each endpoint function.

Our timing metrics were always 0ms as ach currently does everything
inmem.
@adamdecaf adamdecaf merged commit 02b8ad7 into moov-io:master Dec 14, 2018
@adamdecaf adamdecaf deleted the log-request-id branch December 14, 2018 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants