-
Notifications
You must be signed in to change notification settings - Fork 7
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
track response time for http endpoints #1412
track response time for http endpoints #1412
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this. The issue is the route label should be populated with a low-cardinality value. This is a limitation with Prometheus, warned against in here. I've explained the workaround in the comments.
a3ef3ca
to
49086f7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one small comment but lgtm
internal/middleware/responsetime.go
Outdated
} | ||
|
||
// MeasureResponseTime tracks response time of requests. | ||
func MeasureResponseTime(next http.Handler) http.Handler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MeasureHTTPResponseTime & explain in godoc it doens't track websockets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tyty
} | ||
|
||
// MeasureHTTPResponseTime tracks response time of HTTP requests. | ||
// We don't track websocket requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Description
Add middleware to track response time for HTTP requests.
This can help us understand our performance bottlenecks and improve our observability.
Fixes JIRA/GitHub issue number
Engineering checklist
Check only items that apply
Test instructions
Notes for code reviewers