pull/35501/head
Craig Tiller 1 year ago
parent 20e5b2c4bb
commit 9834ee4ae2
  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