Skip to content

feat(coderd/httpmw): log start timestamp for http requests #9776

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

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Sep 19, 2023

This PR adds a slog field, start_timestamp start that will give us a definitive source of truth for the request timestamp.

Having this would've been helpful in debugging #9729 to eliminate a potential, but unlikely, order of events (where the goroutine would be held up, resulting in a log that may have a timestamp later than one would expect).

// actually logging the request. This can also be useful when
// filtering logs that started at a certain time (compared to
// trying to compute the value).
slog.F("start_timestamp", start),
Copy link
Member

Choose a reason for hiding this comment

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

nit: _timestamp indicates a UNIX timestamp in milliseconds to me. If we're just logging a string, just name it start.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can make the change, but I don't feel that timestamp universally refers to UNIX timestamps. A unix timestamp is just one representation for a timestamp (Timestamp examples).

Copy link
Member

Choose a reason for hiding this comment

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

This is just me, and maybe I'm the odd one out here :-)

@mafredri mafredri force-pushed the mafredri/feat-httpmw-log-start-timestamp branch from 242a550 to 8869937 Compare September 19, 2023 13:25
@mafredri mafredri changed the title feat(coderd/httpmw): log start_timestamp for http requests feat(coderd/httpmw): log start timestamp for http requests Sep 19, 2023
@github-actions github-actions bot added the stale This issue is like stale bread. label Sep 27, 2023
@mafredri mafredri merged commit 4e44204 into main Sep 27, 2023
@mafredri mafredri deleted the mafredri/feat-httpmw-log-start-timestamp branch September 27, 2023 11:39
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale This issue is like stale bread.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants