Add TCP tracing to chaotic good transport.

PiperOrigin-RevId: 685956496
python/sync/typings
Nana Pang 1 month ago committed by Copybara-Service
parent b02976cfbc
commit df0b1dfed8
  1. 2
      src/core/BUILD
  2. 11
      src/core/ext/transport/chaotic_good/client_transport.cc
  3. 5
      src/core/lib/transport/promise_endpoint.h

@ -8010,6 +8010,8 @@ grpc_cc_library(
"chaotic_good_transport",
"context",
"event_engine_context",
"event_engine_extensions",
"event_engine_query_extensions",
"for_each",
"grpc_promise_endpoint",
"if",

@ -36,6 +36,8 @@
#include "src/core/ext/transport/chaotic_good/frame_header.h"
#include "src/core/ext/transport/chttp2/transport/hpack_encoder.h"
#include "src/core/lib/event_engine/event_engine_context.h"
#include "src/core/lib/event_engine/extensions/tcp_trace.h"
#include "src/core/lib/event_engine/query_extensions.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/lib/promise/loop.h"
#include "src/core/lib/promise/map.h"
@ -199,6 +201,15 @@ ChaoticGoodClientTransport::ChaoticGoodClientTransport(
->memory_quota()
->CreateMemoryAllocator("chaotic-good")),
outgoing_frames_(4) {
// Set up TCP tracer if enabled.
if (args.GetBool(GRPC_ARG_TCP_TRACING_ENABLED).value_or(false)) {
auto* epte = grpc_event_engine::experimental::QueryExtension<
grpc_event_engine::experimental::TcpTraceExtension>(
data_endpoint.GetEventEngineEndpoint().get());
if (epte != nullptr) {
epte->InitializeAndReturnTcpTracer();
}
}
auto transport = MakeRefCounted<ChaoticGoodTransport>(
std::move(control_endpoint), std::move(data_endpoint),
std::move(hpack_parser), std::move(hpack_encoder));

@ -258,6 +258,11 @@ class PromiseEndpoint {
const grpc_event_engine::experimental::EventEngine::ResolvedAddress&
GetLocalAddress() const;
std::shared_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
GetEventEngineEndpoint() const {
return endpoint_;
}
private:
std::shared_ptr<grpc_event_engine::experimental::EventEngine::Endpoint>
endpoint_;

Loading…
Cancel
Save