quic: add QUIC connection close stats to upstream connections#17222
quic: add QUIC connection close stats to upstream connections#17222jmarantz merged 19 commits intoenvoyproxy:mainfrom
Conversation
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
|
/assign @jmarantz |
| return std::make_unique<Http3ConnPoolImpl>( | ||
| host, priority, dispatcher, options, transport_socket_options, random_generator, state, | ||
| [](HttpConnPoolImplBase* pool) -> ::Envoy::ConnectionPool::ActiveClientPtr { | ||
| [&](HttpConnPoolImplBase* pool) -> ::Envoy::ConnectionPool::ActiveClientPtr { |
There was a problem hiding this comment.
I think for non-test uses I'd avoid capturing [&] -- can you capture just what's needed?
| std::shared_ptr<Upstream::MockClusterInfo> cluster_{new NiceMock<Upstream::MockClusterInfo>()}; | ||
| NiceMock<Random::MockRandomGenerator> random_; | ||
| AlternateProtocolsCacheSharedPtr alternate_protocols_; | ||
| Stats::IsolatedStoreImpl scope_; |
There was a problem hiding this comment.
I think typically in tests if we are instantiating a store we'd call the member variable stats_ or store_ or stats_store_.
Here & below.
test/integration/server.h
Outdated
| absl::Notification server_gone_; | ||
| Stats::SymbolTableImpl symbol_table_; | ||
| std::unique_ptr<Stats::AllocatorImpl> stats_allocator_; | ||
| Quic::QuicStatNames* quic_stat_names_; |
There was a problem hiding this comment.
use OptRef<Quic:QuicStatNames> rather than a pointer here. It's more idiomatic for Envoy style, and also avoids having an uninitialized value there potentially.
test/integration/utility.cc
Outdated
| return sendRequestAndWaitForResponse(*dispatcher, method, url, body, host, content_type, client); | ||
| #else | ||
| ASSERT(false, "running a QUIC integration test without compiling QUIC"); | ||
| (void)quic_stat_names; |
There was a problem hiding this comment.
use UNREFERENCED_PARAMETER(quic_stat_names) in ./source/common/common/macros.h
| Filesystem::fileSystemForTest(), random_generator); | ||
| Event::DispatcherPtr dispatcher(api.allocateDispatcher("test_thread")); | ||
| TestConnectionCallbacks connection_callbacks(*dispatcher); | ||
|
|
There was a problem hiding this comment.
given the existing usage model and implementation of this, where mock_stats_store is instantiated a few lines up, I think it would be more consistent for you to instantiate a new Quic::QuicStatNames here, using mock_stats_store.symbolTable().
That will avoid the new args to makeSingleRequest, and remove a large number of other changes in this PR I think.
There was a problem hiding this comment.
That's an great advice!
done.
|
/wait |
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
jmarantz
left a comment
There was a problem hiding this comment.
this basically looks great, with a couple of small nits and a suggestion.
test/integration/utility.h
Outdated
| #include "source/common/common/dump_state_utils.h" | ||
| #include "source/common/common/utility.h" | ||
| #include "source/common/http/codec_client.h" | ||
| #include "source/common/quic/quic_stat_names.h" |
There was a problem hiding this comment.
it shouldn't be necessary to include quic_stat_names.h here in the header; you should include it from the cc
There was a problem hiding this comment.
done including it in the cc file
Signed-off-by: Renjie Tang <renjietang@google.com>
jmarantz
left a comment
There was a problem hiding this comment.
OK -- I was worried that the lack of a Quic::Context might be a barrier to easily finishing off that PR, and also favor the parallel with the Http::Context and Grpc::Context.
But I don't feel that strongly about it, and you can always add it later (albeit with another large PR).
/assign-from @envoyproxy/senior-maintainers
|
@envoyproxy/senior-maintainers assignee is @alyssawilk |
|
want to check out CI and I can take a look once that's sorted? |
Signed-off-by: Renjie Tang <renjietang@google.com>
alyssawilk
left a comment
There was a problem hiding this comment.
Nice, thanks for following up on this!
|
|
||
| EXPECT_EQ( | ||
| 1U, TestUtility::findCounter( | ||
| store_, "http3.upstream.rx.quic_connection_close_error_code_QUIC_INVALID_FRAME_DATA") |
There was a problem hiding this comment.
do we have docs for this?
I'm not entirely sure where we'd put them. Currently the upstream stats I'm familiar with are rooted in the cluster so docced in cluster_stats.rst
That said these are only updated when traffic is sent to a cluster, so maybe put them there but make it clear they're not rooted in the cluster and are in fact global? Unless @mattklein123 or @phlax have better suggestions
There was a problem hiding this comment.
Yeah I think that might be the best place to put this doc. done.
Signed-off-by: Renjie Tang <renjietang@google.com>
alyssawilk
left a comment
There was a problem hiding this comment.
LGTM, though it looks like one comment of @jmarantz may not be addressed - I'll let him check and merge.
/retest for the windows flake
|
Retrying Azure Pipelines: |
|
/wait |
Signed-off-by: Renjie Tang <renjietang@google.com>
|
unfortunately needs a main merge before we can land this |
Signed-off-by: Renjie Tang <renjietang@google.com>
|
Hey Renjie, is the windows release failure that uint64 optional issue you mentioned? Looks like it might need one more pass? |
Yes it's still the optional<uint64_t> issue. I've filed #17409 |
Signed-off-by: Renjie Tang <renjietang@google.com>
|
/retest |
|
Retrying Azure Pipelines: |
Signed-off-by: Renjie Tang <renjietang@google.com>
Signed-off-by: Renjie Tang <renjietang@google.com>
1. Update ENVOY_COMMIT to the latest Envoy's commit 2. Update ENVOY_SHA in bazel/repositories.bzl 3. Pass an extra QuicStatNames argument when creating the cluster_manager_factory_ in process_impl.cc. This is to accommodate the recent change in the constructor of Envoy::Upstream::ProdClusterManagerFactory in envoyproxy/envoy#17222. Signed-off-by: Jason Ye jiajunye@google.com
…roxy#17222) * add QUIC stats to upstream connections Signed-off-by: Renjie Tang <renjietang@google.com> * format Signed-off-by: Renjie Tang <renjietang@google.com> * minor ci fixes Signed-off-by: Renjie Tang <renjietang@google.com> * format Signed-off-by: Renjie Tang <renjietang@google.com> * fix compiler error Signed-off-by: Renjie Tang <renjietang@google.com> * address comments. Signed-off-by: Renjie Tang <renjietang@google.com> * clean up unused variables. Signed-off-by: Renjie Tang <renjietang@google.com> * remove unused includes. Signed-off-by: Renjie Tang <renjietang@google.com> * fix ci compile time option Signed-off-by: Renjie Tang <renjietang@google.com> * fix an unrelated Windows ci failure. Signed-off-by: Renjie Tang <renjietang@google.com> * add docs and fix a compile option issue. Signed-off-by: Renjie Tang <renjietang@google.com> * fix include Signed-off-by: Renjie Tang <renjietang@google.com> * fix windows CI failure in config_impl_test Signed-off-by: Renjie Tang <renjietang@google.com> * fix unsuccessful merge to upstream. Signed-off-by: Renjie Tang <renjietang@google.com>
Commit Message: Allow upstream quic connections to charge connection close stats.
Additional Description: For upstream connections, QuicStatNames reference is now passed down as Server->ClusterManager->ConnPool->EnvoyQuicConnection.
Risk Level: Low
Testing: unit tests
Docs Changes: docs/root/configuration/upstream/cluster_manager/cluster_stats.rst