filter: add grpc upstream stats#10748
Conversation
|
cc @kyessenov |
6b5a4cc to
53b3640
Compare
source/common/grpc/context_impl.cc
Outdated
There was a problem hiding this comment.
change type to std::chrono::duration
There was a problem hiding this comment.
Would miliseconds work? duration is a template, pretty sure I'll need to modify the class as well 🤔
53b3640 to
dfa06e4
Compare
|
Not sure why the docs are failing 🤔 |
jmarantz
left a comment
There was a problem hiding this comment.
Looks good generally; one minor nit.
@envoyproxy/senior-maintainers
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
Signed-off-by: Patrik Cyvoct <patrik@ptrk.io>
6dcb4e8 to
f7c833d
Compare
|
All good for me I think |
|
@Sh4d1 Do not force-push to PR branches please. It makes reviewing changes much more difficult. |
|
/retest |
|
🐴 hold your horses - no failures detected, yet. |
|
/azp retest |
|
Command 'retest' is not supported by Azure Pipelines. Supported commands
See additional documentation. |
|
@ggreenway it was only a rebase 😄 |
|
/azp run envoy-presubmit |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@Sh4d1 Don't rebase. Please merge instead. We squash the commits when the PR is merged so the extra history doesn't hurt anything. But when people force-push, there's not a way to automatically see that it is only a rebase. As described in https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md:
|
|
/azp run envoy-presubmit (macOS) |
|
No pipelines are associated with this pull request. |
|
@ggreenway okay! Sorry I missed that part, my bad 🙄 |
|
@envoyproxy/api-shepherds PTAL |
| if (config_->enable_upstream_stats_ && | ||
| decoder_callbacks_->streamInfo().lastUpstreamTxByteSent().has_value() && | ||
| decoder_callbacks_->streamInfo().lastUpstreamRxByteReceived().has_value()) { | ||
| std::chrono::milliseconds chrono_duration = | ||
| std::chrono::duration_cast<std::chrono::milliseconds>( | ||
| decoder_callbacks_->streamInfo().lastUpstreamRxByteReceived().value() - | ||
| decoder_callbacks_->streamInfo().lastUpstreamTxByteSent().value()); | ||
| config_->context_.chargeUpstreamStat(*cluster_, request_names_, chrono_duration); | ||
| } |
There was a problem hiding this comment.
@ggreenway @Sh4d1 post review drive by: this would not include "trailers only" responses (headers only responses with an error). I think this is probably not what we want and we should include error responses also? Can we fix/clarify this in a follow up? Thank you.
There was a problem hiding this comment.
@mattklein123 good catch! I think adding the same logic in encodeHeaders if end_stream is true should be enough right? I'll send the fix tomorrow I think 😄
There was a problem hiding this comment.
Or move the whole logic there 🤔
* stats: add upstream_rq_time by grpc methods Signed-off-by: Patrik Cyvoct <patrik@ptrk.io> Signed-off-by: pengg <pengg@google.com>
Description: Add
upstream_rq_timehistogram to grpc statsRisk Level: Medium
Testing: unit test + manual test
Docs Changes: add note about
enable_upstream_statsRelease Notes: added
Parially Fixes #9169