Skip to content

Commit

Permalink
server: introduce ServerMetricRecorder API and move per-call reportin…
Browse files Browse the repository at this point in the history
…g from a C++ interceptor to a C-core filter (#32106)

* backend metric sampling

* Comments addressed.

* More comments addressed.

* Pushing changes left behind locally.

* Removed empty lines

* Update OrcaService to use ServerMetricRecorder (no named metrics yet)

* Comments addressed.

* More comments addressed

* More comments addressed.

* Comments fixed

* Comments addressed.

* Test fixed

* make seq returned always up-to-date

* skip atomic load when not cached

* Fixed ABSL_GUARDED_BY

* Comments addressed except client_lb_end2end_test

* test updated

* Comments addressed

* BUILD fix.

* BackendMetricDataState moved to a separate header

* comments addressed

* Fixed clang and buildifier errors

* More sanity check errors fixed.

* Fixed xds tests

* Ran generate_projects.sh

* Comments addressed

* comments addressed.

* generate project

* Build fixed

* generate project

* sanity check errors fixed

* test fixed

* Backup poller period override moved to main()

* Also move cfstream override

* Clang fixes, sanitize

* generate_projects.sh

* portable print format fix

* Removed outdated comment
  • Loading branch information
yousukseung authored and wanlin31 committed May 18, 2023
1 parent 27ec5cd commit 4b50876
Show file tree
Hide file tree
Showing 43 changed files with 1,198 additions and 634 deletions.
37 changes: 21 additions & 16 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,7 @@ grpc_cc_library(
"grpc_base",
# standard plugins
"census",
"//src/core:grpc_backend_metric_filter",
"//src/core:grpc_deadline_filter",
"//src/core:grpc_client_authority_filter",
"//src/core:grpc_lb_policy_grpclb",
Expand Down Expand Up @@ -1818,6 +1819,7 @@ grpc_cc_library(
"grpc_security_base",
"grpc_service_config_impl",
"grpc_trace",
"grpcpp_backend_metric_recorder",
"grpcpp_call_metric_recorder",
"grpcpp_status",
"iomgr_timer",
Expand All @@ -1833,6 +1835,7 @@ grpc_cc_library(
"//src/core:error",
"//src/core:gpr_atm",
"//src/core:gpr_manual_constructor",
"//src/core:grpc_backend_metric_provider",
"//src/core:grpc_service_config",
"//src/core:grpc_transport_inproc",
"//src/core:json",
Expand Down Expand Up @@ -1885,6 +1888,7 @@ grpc_cc_library(
"grpc_service_config_impl",
"grpc_trace",
"grpc_unsecure",
"grpcpp_backend_metric_recorder",
"grpcpp_call_metric_recorder",
"grpcpp_status",
"iomgr_timer",
Expand All @@ -1896,6 +1900,7 @@ grpc_cc_library(
"//src/core:error",
"//src/core:gpr_atm",
"//src/core:gpr_manual_constructor",
"//src/core:grpc_backend_metric_provider",
"//src/core:grpc_insecure_credentials",
"//src/core:grpc_service_config",
"//src/core:grpc_transport_inproc",
Expand Down Expand Up @@ -1973,45 +1978,42 @@ grpc_cc_library(

grpc_cc_library(
name = "grpcpp_call_metric_recorder",
srcs = [
"src/cpp/server/orca/call_metric_recorder.cc",
],
external_deps = [
"absl/strings",
"absl/types:optional",
"upb_lib",
],
language = "c++",
public_hdrs = [
"include/grpcpp/ext/call_metric_recorder.h",
],
visibility = ["@grpc:public"],
deps = [
"grpc++_public_hdrs",
"xds_orca_upb",
"//src/core:arena",
"//src/core:grpc_backend_metric_data",
],
deps = ["grpc++_public_hdrs"],
)

grpc_cc_library(
name = "grpcpp_orca_interceptor",
name = "grpcpp_backend_metric_recorder",
srcs = [
"src/cpp/server/orca/orca_interceptor.cc",
"src/cpp/server/backend_metric_recorder.cc",
],
hdrs = [
"src/cpp/server/orca/orca_interceptor.h",
"src/cpp/server/backend_metric_recorder.h",
],
external_deps = [
"absl/base:core_headers",
"absl/strings",
"absl/types:optional",
],
language = "c++",
public_hdrs = [
"include/grpcpp/ext/server_metric_recorder.h",
],
visibility = ["@grpc:public"],
deps = [
"grpc++",
"grpc_base",
"gpr",
"grpc++_public_hdrs",
"grpc_trace",
"grpcpp_call_metric_recorder",
"//src/core:grpc_backend_metric_data",
"//src/core:grpc_backend_metric_provider",
],
)

Expand All @@ -2022,6 +2024,7 @@ grpc_cc_library(
],
external_deps = [
"absl/base:core_headers",
"absl/strings",
"absl/time",
"absl/types:optional",
"upb_lib",
Expand All @@ -2037,11 +2040,13 @@ grpc_cc_library(
"gpr",
"grpc++",
"grpc_base",
"grpcpp_backend_metric_recorder",
"protobuf_duration_upb",
"ref_counted_ptr",
"xds_orca_service_upb",
"xds_orca_upb",
"//src/core:default_event_engine",
"//src/core:grpc_backend_metric_data",
"//src/core:ref_counted",
"//src/core:time",
],
Expand Down
33 changes: 12 additions & 21 deletions CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4b50876

Please sign in to comment.