-
Notifications
You must be signed in to change notification settings - Fork 271
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
metrics: correctly reflect closed connections in route metrics #3378
Conversation
this isn't a comment on this particular change so much as the architecture of this middleware, which predates this PR, but... a "closed" counter is usually, in my experience, a good place to lean on RAII guards that increment a closed counter when dropped. that could be stored as an that'd be a more significant change though, so i'll just note the idea here for posterity. |
The poll contract isn't really tied to the connection contract: calling poll_ready doesn't indicate that connection is being attempted, strictly speaking. Services may be polled eagerly or more than once. It would be fragile to encode this here. Also, callers may cache error values returned from poll_ready, so this may not be called as expected. I think a preferable solution is to modify the stack to replace the push_filter with a service that runs the filter in the request-response path... |
…etrics Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
2b35e5f
to
68293e1
Compare
… route metrics" This reverts commit 2b35e5f. Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
68293e1
to
9c3dc5a
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.
I can push a commit that addresses this.
This PR fixes a problem that was introduced in the following commit: 5ac1352
The problem is that if a particular route is configured to fail a connection, the
poll_ready
call on the inner service will return the error and the service will never get called. Therefore in order to capture that in metrics, we need to increment the metrics counter if we encounter errors while callingpoll_ready
on the inner service.Signed-off-by: Zahari Dichev zaharidichev@gmail.com