diff --git a/bazel/experiments.bzl b/bazel/experiments.bzl index b9be51d25b3..096cf1ff5e7 100644 --- a/bazel/experiments.bzl +++ b/bazel/experiments.bzl @@ -43,7 +43,6 @@ EXPERIMENT_ENABLES = { "tcp_rcv_lowat": "tcp_rcv_lowat", "trace_record_callops": "trace_record_callops", "unconstrained_max_quota_buffer_size": "unconstrained_max_quota_buffer_size", - "v3_backend_metric_filter": "v3_backend_metric_filter", "work_serializer_clears_time_cache": "work_serializer_clears_time_cache", "work_serializer_dispatch": "event_engine_client,work_serializer_dispatch", } diff --git a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc index 85c6d318bf6..33566871cdf 100644 --- a/src/core/ext/filters/backend_metrics/backend_metric_filter.cc +++ b/src/core/ext/filters/backend_metrics/backend_metric_filter.cc @@ -117,55 +117,15 @@ absl::optional MaybeSerializeBackendMetrics( } } // namespace -const grpc_channel_filter LegacyBackendMetricFilter::kFilter = - MakePromiseBasedFilter( - "backend_metric"); - const grpc_channel_filter BackendMetricFilter::kFilter = MakePromiseBasedFilter( "backend_metric"); -absl::StatusOr LegacyBackendMetricFilter::Create( - const ChannelArgs&, ChannelFilter::Args) { - return LegacyBackendMetricFilter(); -} - absl::StatusOr BackendMetricFilter::Create( const ChannelArgs&, ChannelFilter::Args) { return BackendMetricFilter(); } -ArenaPromise LegacyBackendMetricFilter::MakeCallPromise( - CallArgs call_args, NextPromiseFactory next_promise_factory) { - return ArenaPromise(Map( - next_promise_factory(std::move(call_args)), - [this](ServerMetadataHandle trailing_metadata) { - auto* ctx = &GetContext< - grpc_call_context_element>()[GRPC_CONTEXT_BACKEND_METRIC_PROVIDER]; - if (ctx == nullptr) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) { - gpr_log(GPR_INFO, "[%p] No BackendMetricProvider.", this); - } - return trailing_metadata; - } - absl::optional serialized = MaybeSerializeBackendMetrics( - reinterpret_cast(ctx->value)); - if (serialized.has_value() && !serialized->empty()) { - if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) { - gpr_log(GPR_INFO, - "[%p] Backend metrics serialized. size: %" PRIuPTR, this, - serialized->size()); - } - trailing_metadata->Set( - EndpointLoadMetricsBinMetadata(), - Slice::FromCopiedString(std::move(*serialized))); - } else if (GRPC_TRACE_FLAG_ENABLED(grpc_backend_metric_filter_trace)) { - gpr_log(GPR_INFO, "[%p] No backend metrics.", this); - } - return trailing_metadata; - })); -} - void BackendMetricFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) { auto* ctx = &GetContext< grpc_call_context_element>()[GRPC_CONTEXT_BACKEND_METRIC_PROVIDER]; @@ -190,15 +150,9 @@ void BackendMetricFilter::Call::OnServerTrailingMetadata(ServerMetadata& md) { } void RegisterBackendMetricFilter(CoreConfiguration::Builder* builder) { - if (IsV3BackendMetricFilterEnabled()) { - builder->channel_init() - ->RegisterFilter(GRPC_SERVER_CHANNEL) - .IfHasChannelArg(GRPC_ARG_SERVER_CALL_METRIC_RECORDING); - } else { - builder->channel_init() - ->RegisterFilter(GRPC_SERVER_CHANNEL) - .IfHasChannelArg(GRPC_ARG_SERVER_CALL_METRIC_RECORDING); - } + builder->channel_init() + ->RegisterFilter(GRPC_SERVER_CHANNEL) + .IfHasChannelArg(GRPC_ARG_SERVER_CALL_METRIC_RECORDING); } } // namespace grpc_core diff --git a/src/core/ext/filters/backend_metrics/backend_metric_filter.h b/src/core/ext/filters/backend_metrics/backend_metric_filter.h index 2e6766339f9..2c71a9d19cb 100644 --- a/src/core/ext/filters/backend_metrics/backend_metric_filter.h +++ b/src/core/ext/filters/backend_metrics/backend_metric_filter.h @@ -31,18 +31,6 @@ namespace grpc_core { -class LegacyBackendMetricFilter : public ChannelFilter { - public: - static const grpc_channel_filter kFilter; - - static absl::StatusOr Create( - const ChannelArgs& args, ChannelFilter::Args); - - // Construct a promise for one call. - ArenaPromise MakeCallPromise( - CallArgs call_args, NextPromiseFactory next_promise_factory) override; -}; - class BackendMetricFilter : public ImplementChannelFilter { public: static const grpc_channel_filter kFilter; diff --git a/src/core/lib/experiments/experiments.cc b/src/core/lib/experiments/experiments.cc index d2da6fbfb48..e668ab3ee7d 100644 --- a/src/core/lib/experiments/experiments.cc +++ b/src/core/lib/experiments/experiments.cc @@ -128,9 +128,6 @@ const char* const description_unconstrained_max_quota_buffer_size = "Discard the cap on the max free pool size for one memory allocator"; const char* const additional_constraints_unconstrained_max_quota_buffer_size = "{}"; -const char* const description_v3_backend_metric_filter = - "Use the backend metric filter utilizing the v3 filter api"; -const char* const additional_constraints_v3_backend_metric_filter = "{}"; const char* const description_work_serializer_clears_time_cache = "Have the work serializer clear the time cache when it dispatches work."; const char* const additional_constraints_work_serializer_clears_time_cache = @@ -214,8 +211,6 @@ const ExperimentMetadata g_experiment_metadata[] = { description_unconstrained_max_quota_buffer_size, additional_constraints_unconstrained_max_quota_buffer_size, nullptr, 0, false, true}, - {"v3_backend_metric_filter", description_v3_backend_metric_filter, - additional_constraints_v3_backend_metric_filter, nullptr, 0, false, true}, {"work_serializer_clears_time_cache", description_work_serializer_clears_time_cache, additional_constraints_work_serializer_clears_time_cache, nullptr, 0, true, @@ -333,9 +328,6 @@ const char* const description_unconstrained_max_quota_buffer_size = "Discard the cap on the max free pool size for one memory allocator"; const char* const additional_constraints_unconstrained_max_quota_buffer_size = "{}"; -const char* const description_v3_backend_metric_filter = - "Use the backend metric filter utilizing the v3 filter api"; -const char* const additional_constraints_v3_backend_metric_filter = "{}"; const char* const description_work_serializer_clears_time_cache = "Have the work serializer clear the time cache when it dispatches work."; const char* const additional_constraints_work_serializer_clears_time_cache = @@ -419,8 +411,6 @@ const ExperimentMetadata g_experiment_metadata[] = { description_unconstrained_max_quota_buffer_size, additional_constraints_unconstrained_max_quota_buffer_size, nullptr, 0, false, true}, - {"v3_backend_metric_filter", description_v3_backend_metric_filter, - additional_constraints_v3_backend_metric_filter, nullptr, 0, false, true}, {"work_serializer_clears_time_cache", description_work_serializer_clears_time_cache, additional_constraints_work_serializer_clears_time_cache, nullptr, 0, true, @@ -538,9 +528,6 @@ const char* const description_unconstrained_max_quota_buffer_size = "Discard the cap on the max free pool size for one memory allocator"; const char* const additional_constraints_unconstrained_max_quota_buffer_size = "{}"; -const char* const description_v3_backend_metric_filter = - "Use the backend metric filter utilizing the v3 filter api"; -const char* const additional_constraints_v3_backend_metric_filter = "{}"; const char* const description_work_serializer_clears_time_cache = "Have the work serializer clear the time cache when it dispatches work."; const char* const additional_constraints_work_serializer_clears_time_cache = @@ -624,8 +611,6 @@ const ExperimentMetadata g_experiment_metadata[] = { description_unconstrained_max_quota_buffer_size, additional_constraints_unconstrained_max_quota_buffer_size, nullptr, 0, false, true}, - {"v3_backend_metric_filter", description_v3_backend_metric_filter, - additional_constraints_v3_backend_metric_filter, nullptr, 0, false, true}, {"work_serializer_clears_time_cache", description_work_serializer_clears_time_cache, additional_constraints_work_serializer_clears_time_cache, nullptr, 0, true, diff --git a/src/core/lib/experiments/experiments.h b/src/core/lib/experiments/experiments.h index 1f76b92d44b..b82a77b4637 100644 --- a/src/core/lib/experiments/experiments.h +++ b/src/core/lib/experiments/experiments.h @@ -95,7 +95,6 @@ inline bool IsTcpFrameSizeTuningEnabled() { return false; } inline bool IsTcpRcvLowatEnabled() { return false; } inline bool IsTraceRecordCallopsEnabled() { return false; } inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; } -inline bool IsV3BackendMetricFilterEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; } inline bool IsWorkSerializerDispatchEnabled() { return false; } @@ -140,7 +139,6 @@ inline bool IsTcpFrameSizeTuningEnabled() { return false; } inline bool IsTcpRcvLowatEnabled() { return false; } inline bool IsTraceRecordCallopsEnabled() { return false; } inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; } -inline bool IsV3BackendMetricFilterEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; } inline bool IsWorkSerializerDispatchEnabled() { return false; } @@ -186,7 +184,6 @@ inline bool IsTcpFrameSizeTuningEnabled() { return false; } inline bool IsTcpRcvLowatEnabled() { return false; } inline bool IsTraceRecordCallopsEnabled() { return false; } inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return false; } -inline bool IsV3BackendMetricFilterEnabled() { return false; } #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE inline bool IsWorkSerializerClearsTimeCacheEnabled() { return true; } #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_DISPATCH @@ -221,7 +218,6 @@ enum ExperimentIds { kExperimentIdTcpRcvLowat, kExperimentIdTraceRecordCallops, kExperimentIdUnconstrainedMaxQuotaBufferSize, - kExperimentIdV3BackendMetricFilter, kExperimentIdWorkSerializerClearsTimeCache, kExperimentIdWorkSerializerDispatch, kNumExperiments @@ -330,10 +326,6 @@ inline bool IsTraceRecordCallopsEnabled() { inline bool IsUnconstrainedMaxQuotaBufferSizeEnabled() { return IsExperimentEnabled(kExperimentIdUnconstrainedMaxQuotaBufferSize); } -#define GRPC_EXPERIMENT_IS_INCLUDED_V3_BACKEND_METRIC_FILTER -inline bool IsV3BackendMetricFilterEnabled() { - return IsExperimentEnabled(kExperimentIdV3BackendMetricFilter); -} #define GRPC_EXPERIMENT_IS_INCLUDED_WORK_SERIALIZER_CLEARS_TIME_CACHE inline bool IsWorkSerializerClearsTimeCacheEnabled() { return IsExperimentEnabled(kExperimentIdWorkSerializerClearsTimeCache); diff --git a/src/core/lib/experiments/experiments.yaml b/src/core/lib/experiments/experiments.yaml index 898e7f892ff..0605df1f293 100644 --- a/src/core/lib/experiments/experiments.yaml +++ b/src/core/lib/experiments/experiments.yaml @@ -215,12 +215,6 @@ expiry: 2024/09/01 owner: ctiller@google.com test_tags: [resource_quota_test] -- name: v3_backend_metric_filter - description: - Use the backend metric filter utilizing the v3 filter api - expiry: 2024/05/05 - owner: ctiller@google.com - test_tags: [] - name: work_serializer_clears_time_cache description: Have the work serializer clear the time cache when it dispatches work.