[call-v3] Move `ServerLoadReportingFilter` to new registration mechanism (#35501)

Closes #35501

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35501 from ctiller:tpl2 9834ee4ae2
PiperOrigin-RevId: 597277587
pull/35313/head^2
Craig Tiller 11 months ago committed by Copybara-Service
parent 20e5b2c4bb
commit 55c13844d9
  1. 6
      src/core/ext/filters/load_reporting/server_load_reporting_filter.cc
  2. 2
      src/core/ext/filters/load_reporting/server_load_reporting_filter.h

@ -244,11 +244,9 @@ void ServerLoadReportingFilter::Call::OnFinalize(
GetStatusTagForStatus(final_info->final_status)}});
}
namespace {
const grpc_channel_filter kFilter =
const grpc_channel_filter ServerLoadReportingFilter::kFilter =
MakePromiseBasedFilter<ServerLoadReportingFilter, FilterEndpoint::kServer>(
"server_load_reporting");
} // namespace
// TODO(juanlishen): We should register the filter during grpc initialization
// time once OpenCensus is compatible with our build system. For now, we force
@ -266,7 +264,7 @@ struct ServerLoadReportingFilterStaticRegistrar {
grpc::load_reporter::MeasureEndLatencyMs();
grpc::load_reporter::MeasureOtherCallMetric();
builder->channel_init()
->RegisterFilter(GRPC_SERVER_CHANNEL, &kFilter)
->RegisterFilter<ServerLoadReportingFilter>(GRPC_SERVER_CHANNEL)
.IfChannelArg(GRPC_ARG_ENABLE_LOAD_REPORTING, false);
});
}

@ -37,6 +37,8 @@ namespace grpc_core {
class ServerLoadReportingFilter
: public ImplementChannelFilter<ServerLoadReportingFilter> {
public:
static const grpc_channel_filter kFilter;
static absl::StatusOr<ServerLoadReportingFilter> Create(
const ChannelArgs& args, ChannelFilter::Args);

Loading…
Cancel
Save