[call-v3] Remove `v3_backend_metric_filter` experiment (#36227)

We're all rolled out.

Closes #36227

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36227 from ctiller:v3bmf 08392ddd36
PiperOrigin-RevId: 621263847
pull/36234/head
Craig Tiller 8 months ago committed by Copybara-Service
parent a020e1d229
commit aa3b659e48
  1. 1
      bazel/experiments.bzl
  2. 52
      src/core/ext/filters/backend_metrics/backend_metric_filter.cc
  3. 12
      src/core/ext/filters/backend_metrics/backend_metric_filter.h
  4. 15
      src/core/lib/experiments/experiments.cc
  5. 8
      src/core/lib/experiments/experiments.h
  6. 6
      src/core/lib/experiments/experiments.yaml

@ -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",
}

@ -117,55 +117,15 @@ absl::optional<std::string> MaybeSerializeBackendMetrics(
}
} // namespace
const grpc_channel_filter LegacyBackendMetricFilter::kFilter =
MakePromiseBasedFilter<LegacyBackendMetricFilter, FilterEndpoint::kServer>(
"backend_metric");
const grpc_channel_filter BackendMetricFilter::kFilter =
MakePromiseBasedFilter<BackendMetricFilter, FilterEndpoint::kServer>(
"backend_metric");
absl::StatusOr<LegacyBackendMetricFilter> LegacyBackendMetricFilter::Create(
const ChannelArgs&, ChannelFilter::Args) {
return LegacyBackendMetricFilter();
}
absl::StatusOr<BackendMetricFilter> BackendMetricFilter::Create(
const ChannelArgs&, ChannelFilter::Args) {
return BackendMetricFilter();
}
ArenaPromise<ServerMetadataHandle> LegacyBackendMetricFilter::MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) {
return ArenaPromise<ServerMetadataHandle>(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<std::string> serialized = MaybeSerializeBackendMetrics(
reinterpret_cast<BackendMetricProvider*>(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<BackendMetricFilter>(GRPC_SERVER_CHANNEL)
.IfHasChannelArg(GRPC_ARG_SERVER_CALL_METRIC_RECORDING);
} else {
builder->channel_init()
->RegisterFilter<LegacyBackendMetricFilter>(GRPC_SERVER_CHANNEL)
.IfHasChannelArg(GRPC_ARG_SERVER_CALL_METRIC_RECORDING);
}
builder->channel_init()
->RegisterFilter<BackendMetricFilter>(GRPC_SERVER_CHANNEL)
.IfHasChannelArg(GRPC_ARG_SERVER_CALL_METRIC_RECORDING);
}
} // namespace grpc_core

@ -31,18 +31,6 @@
namespace grpc_core {
class LegacyBackendMetricFilter : public ChannelFilter {
public:
static const grpc_channel_filter kFilter;
static absl::StatusOr<LegacyBackendMetricFilter> Create(
const ChannelArgs& args, ChannelFilter::Args);
// Construct a promise for one call.
ArenaPromise<ServerMetadataHandle> MakeCallPromise(
CallArgs call_args, NextPromiseFactory next_promise_factory) override;
};
class BackendMetricFilter : public ImplementChannelFilter<BackendMetricFilter> {
public:
static const grpc_channel_filter kFilter;

@ -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,

@ -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);

@ -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.

Loading…
Cancel
Save