diff --git a/source/common/config/grpc_mux_impl.cc b/source/common/config/grpc_mux_impl.cc index 4242599901a7..0be661419845 100644 --- a/source/common/config/grpc_mux_impl.cc +++ b/source/common/config/grpc_mux_impl.cc @@ -160,7 +160,7 @@ void GrpcMuxImpl::onDiscoveryResponse( std::unique_ptr&& message, ControlPlaneStats& control_plane_stats) { const std::string type_url = message->type_url(); - ENVOY_LOG(debug, "Received gRPC message for {} at version {}", type_url, message->version_info()); + ENVOY_LOG(debug, "Received gRPC message for {} at version {}, resp {}", type_url, message->version_info(), message->DebugString()); if (api_state_.count(type_url) == 0) { // TODO(yuval-k): This should never happen. consider dropping the stream as this is a // protocol violation diff --git a/source/common/http/conn_manager_impl.cc b/source/common/http/conn_manager_impl.cc index b9296d2a7bf8..05c1942e802c 100644 --- a/source/common/http/conn_manager_impl.cc +++ b/source/common/http/conn_manager_impl.cc @@ -1293,9 +1293,15 @@ void ConnectionManagerImpl::ActiveStream::refreshCachedRoute(const Router::Route // 查找路由,根据配置的 route 规则查找当前请求匹配的规则,会调用到 RouteMatcher::route route = snapped_route_config_->route(cb, *request_headers_, filter_manager_.streamInfo(), stream_id_); - ENVOY_STREAM_LOG(debug, "refreshCachedRoute route cluster name {}", *this, - route==nullptr? "empty":route->routeEntry()->clusterName()); + if (!route) { + ENVOY_STREAM_LOG(debug, "refreshCachedRoute empty route", *this); + } else if (route->routeEntry()) { + ENVOY_STREAM_LOG(debug, "refreshCachedRoute route cluster name: {}, route name: {}", *this, route->routeEntry()->clusterName(), route->routeEntry()->routeName()); + } else { + ENVOY_STREAM_LOG(debug, "refreshCachedRoute has route, but entry empty", *this); + } } + } setRoute(route); diff --git a/source/extensions/filters/http/local_ratelimit/local_ratelimit.cc b/source/extensions/filters/http/local_ratelimit/local_ratelimit.cc index b216b15075af..04b009f08e20 100644 --- a/source/extensions/filters/http/local_ratelimit/local_ratelimit.cc +++ b/source/extensions/filters/http/local_ratelimit/local_ratelimit.cc @@ -77,6 +77,7 @@ bool FilterConfig::enforced() const { } Http::FilterHeadersStatus Filter::decodeHeaders(Http::RequestHeaderMap& headers, bool) { + ENVOY_LOG(debug, "local_ratelimit decodeHeaders"); const auto* config = getConfig(); if (!config->enabled()) { @@ -116,6 +117,7 @@ Http::FilterHeadersStatus Filter::decodeHeaders(Http::RequestHeaderMap& headers, } bool Filter::requestAllowed(absl::Span request_descriptors) { + ENVOY_LOG(debug, "local_ratelimit requestAllowed with request_descriptors"); const auto* config = getConfig(); return config->rateLimitPerConnection() ? getPerConnectionRateLimiter().requestAllowed(request_descriptors) diff --git a/source/extensions/filters/http/local_ratelimit/local_ratelimit.h b/source/extensions/filters/http/local_ratelimit/local_ratelimit.h index 5b485e6b999f..a7d3910446a1 100644 --- a/source/extensions/filters/http/local_ratelimit/local_ratelimit.h +++ b/source/extensions/filters/http/local_ratelimit/local_ratelimit.h @@ -127,9 +127,11 @@ using FilterConfigSharedPtr = std::shared_ptr; * HTTP local rate limit filter. Depending on the route configuration, this filter calls consults * with local token bucket before allowing further filter iteration. */ -class Filter : public Http::PassThroughFilter { +class Filter : public Logger::Loggable, public Http::PassThroughFilter { public: - Filter(FilterConfigSharedPtr config) : config_(config) {} + Filter(FilterConfigSharedPtr config) : config_(config) { + ENVOY_LOG(debug, "construct local_ratelimit filter {}", static_cast(this)); + } // Http::StreamDecoderFilter Http::FilterHeadersStatus decodeHeaders(Http::RequestHeaderMap& headers,