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

Report request latency in default metrics #181

Merged
merged 3 commits into from
Jun 27, 2023
Merged

Conversation

bluekeyes
Copy link
Member

This is in milliseconds by default, but can be changed by setting the zerolog.DurationFieldUnit variable, which also changes the unit used in request logs. For now, report a histogram of all requests, but it may make sense to split this out by status code in the future.

This is in milliseconds by default, but can be changed by setting the
zerolog.DurationFieldUnit variable, which also changes the unit used in
request logs. For now, report a histogram of all requests, but it may
make sense to split this out by status code in the future.
@bluekeyes bluekeyes requested a review from a team June 26, 2023 06:29
@bluekeyes
Copy link
Member Author

On a different internal PR, there's some discussion about units for time-based metrics and we're currently leaning towards adding an option to set the unit used when go-baseapp exports metrics.Timer instances. If we implement that, it may make more sense to change this to be a timer instead of a histogram and then take advantage of the export functionality to set appropriate units.

This will take advantage of the global timer unit configuration and also
allows monitoring latency by status, as errors may be faster or slower
than successful requests.
@bluekeyes
Copy link
Member Author

Updated to use metrics.Timer now that #184 merged and also split up the metrics by status code.

@bluekeyes bluekeyes merged commit 3974f55 into develop Jun 27, 2023
3 checks passed
@bluekeyes bluekeyes deleted the bkeyes/request-latency branch June 27, 2023 18:47
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.

None yet

2 participants