Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server: introduce ServerMetricRecorder API and move per-call reporting from a C++ interceptor to a C-core filter #32106

Merged
merged 44 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
e0b7519
backend metric sampling
yousukseung Jan 13, 2023
4147529
Comments addressed.
yousukseung Jan 19, 2023
8d0e1bf
Merge branch 'master' into test
yousukseung Jan 20, 2023
29b4da6
More comments addressed.
yousukseung Jan 20, 2023
46913b8
Pushing changes left behind locally.
yousukseung Jan 20, 2023
122e975
Removed empty lines
yousukseung Jan 20, 2023
a3099bd
Update OrcaService to use ServerMetricRecorder (no named metrics yet)
yousukseung Jan 21, 2023
d75e814
Comments addressed.
yousukseung Jan 21, 2023
816a8af
More comments addressed
yousukseung Jan 21, 2023
7855ea4
More comments addressed.
yousukseung Jan 21, 2023
1448113
Comments fixed
yousukseung Jan 24, 2023
0ca1a8b
Merge branch 'backend_metric_sampling' into merged
yousukseung Jan 24, 2023
8ac753f
Merge remote-tracking branch 'upstream/master' into backend_metric_sa…
yousukseung Jan 25, 2023
4221d88
Comments addressed.
yousukseung Jan 25, 2023
eca48d4
Test fixed
yousukseung Jan 26, 2023
604df1b
make seq returned always up-to-date
yousukseung Jan 26, 2023
0da8bfe
skip atomic load when not cached
yousukseung Jan 26, 2023
8f586e7
Fixed ABSL_GUARDED_BY
yousukseung Jan 26, 2023
d0ce562
Comments addressed except client_lb_end2end_test
yousukseung Jan 27, 2023
bfc0dc0
test updated
yousukseung Jan 27, 2023
2367bf6
Comments addressed
yousukseung Jan 29, 2023
b471024
BUILD fix.
yousukseung Jan 30, 2023
5669e86
BackendMetricDataState moved to a separate header
yousukseung Jan 30, 2023
33aa915
comments addressed
yousukseung Jan 30, 2023
dddc849
Fixed clang and buildifier errors
yousukseung Jan 30, 2023
d58771f
More sanity check errors fixed.
yousukseung Jan 30, 2023
4c2c860
Merge remote-tracking branch 'upstream/master' into backend_metric_sa…
yousukseung Jan 30, 2023
90f6ec6
Fixed xds tests
yousukseung Jan 30, 2023
c21d62a
Ran generate_projects.sh
yousukseung Jan 30, 2023
a286a88
Comments addressed
yousukseung Jan 31, 2023
42be5de
comments addressed.
yousukseung Jan 31, 2023
c327577
Merge remote-tracking branch 'upstream/master' into backend_metric_sa…
yousukseung Jan 31, 2023
63afafb
generate project
yousukseung Jan 31, 2023
cc228d1
Build fixed
yousukseung Jan 31, 2023
886494d
generate project
yousukseung Jan 31, 2023
2b8e52e
sanity check errors fixed
yousukseung Jan 31, 2023
e22b336
test fixed
yousukseung Jan 31, 2023
21d8bf4
Backup poller period override moved to main()
yousukseung Jan 31, 2023
198eeba
Also move cfstream override
yousukseung Jan 31, 2023
7616eb2
Clang fixes, sanitize
yousukseung Feb 1, 2023
d96d88b
Merge remote-tracking branch 'upstream/master' into backend_metric_sa…
yousukseung Feb 1, 2023
a1b77c5
generate_projects.sh
yousukseung Feb 1, 2023
4632a63
portable print format fix
yousukseung Feb 1, 2023
35c9dc0
Removed outdated comment
yousukseung Feb 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 5 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@ tools/run_tests/tests.json linguist-generated=true
tools/run_tests/generated/tests.json linguist-generated=true
tools/run_tests/generated/sources_and_headers.json linguist-generated=true
src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h linguist-generated=true
src/core/lib/transport/static_metadata.h linguist-generated=true
src/core/lib/transport/static_metadata.cc linguist-generated=true
src/core/debug/stats_data.h linguist-generated=true
src/core/debug/stats_data.cc linguist-generated=true
src/core/experiments/experiments.h linguist-generated=true
src/core/experiments/experiments.cc linguist-generated=true
bazel/experiments.bzl linguist-generated=true
80 changes: 70 additions & 10 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,7 @@ grpc_cc_library(
"//src/core:grpc_lb_policy_priority",
"//src/core:grpc_lb_policy_ring_hash",
"//src/core:grpc_lb_policy_round_robin",
"//src/core:grpc_lb_policy_weighted_round_robin",
"//src/core:grpc_lb_policy_weighted_target",
"//src/core:grpc_channel_idle_filter",
"//src/core:grpc_message_size_filter",
Expand Down Expand Up @@ -1174,7 +1175,6 @@ grpc_cc_library(
grpc_cc_library(
name = "grpc_base",
srcs = [
"//src/core:lib/address_utils/parse_address.cc",
"//src/core:lib/channel/channel_stack.cc",
"//src/core:lib/channel/channel_stack_builder_impl.cc",
"//src/core:lib/channel/channel_trace.cc",
Expand Down Expand Up @@ -1205,8 +1205,6 @@ grpc_cc_library(
"//src/core:lib/iomgr/gethostname_fallback.cc",
"//src/core:lib/iomgr/gethostname_host_name_max.cc",
"//src/core:lib/iomgr/gethostname_sysconf.cc",
"//src/core:lib/iomgr/grpc_if_nametoindex_posix.cc",
"//src/core:lib/iomgr/grpc_if_nametoindex_unsupported.cc",
"//src/core:lib/iomgr/internal_errqueue.cc",
"//src/core:lib/iomgr/iocp_windows.cc",
"//src/core:lib/iomgr/iomgr.cc",
Expand Down Expand Up @@ -1274,9 +1272,15 @@ grpc_cc_library(
"//src/core:lib/transport/timeout_encoding.cc",
"//src/core:lib/transport/transport.cc",
"//src/core:lib/transport/transport_op_string.cc",
] +
# TODO(vigneshbabu): remove these
# These headers used to be vended by this target, but they have to be
# removed after landing event engine.
[
"//src/core:lib/iomgr/event_engine_shims/endpoint.cc",
"//src/core:lib/iomgr/event_engine_shims/tcp_client.cc",
],
hdrs = [
"//src/core:lib/address_utils/parse_address.h",
"//src/core:lib/channel/call_finalization.h",
"//src/core:lib/channel/call_tracer.h",
"//src/core:lib/channel/channel_stack.h",
Expand Down Expand Up @@ -1304,7 +1308,6 @@ grpc_cc_library(
"//src/core:lib/iomgr/ev_poll_posix.h",
"//src/core:lib/iomgr/ev_posix.h",
"//src/core:lib/iomgr/gethostname.h",
"//src/core:lib/iomgr/grpc_if_nametoindex.h",
"//src/core:lib/iomgr/internal_errqueue.h",
"//src/core:lib/iomgr/iocp_windows.h",
"//src/core:lib/iomgr/iomgr.h",
Expand Down Expand Up @@ -1359,6 +1362,13 @@ grpc_cc_library(
"//src/core:lib/transport/timeout_encoding.h",
"//src/core:lib/transport/transport.h",
"//src/core:lib/transport/transport_impl.h",
] +
# TODO(vigneshbabu): remove these
# These headers used to be vended by this target, but they have to be
# removed after landing event engine.
[
"//src/core:lib/iomgr/event_engine_shims/endpoint.h",
"//src/core:lib/iomgr/event_engine_shims/tcp_client.h",
],
defines = select({
"systemd": ["HAVE_LIBSYSTEMD"],
Expand Down Expand Up @@ -1400,6 +1410,7 @@ grpc_cc_library(
"grpc_trace",
"iomgr_timer",
"orphanable",
"parse_address",
"promise",
"ref_counted_ptr",
"sockaddr_utils",
Expand All @@ -1423,6 +1434,10 @@ grpc_cc_library(
"//src/core:default_event_engine",
"//src/core:dual_ref_counted",
"//src/core:error",
"//src/core:event_engine_common",
"//src/core:event_engine_shim",
"//src/core:event_engine_tcp_socket_utils",
"//src/core:event_engine_trace",
"//src/core:event_log",
"//src/core:experiments",
"//src/core:gpr_atm",
Expand All @@ -1443,6 +1458,7 @@ grpc_cc_library(
"//src/core:pipe",
"//src/core:poll",
"//src/core:pollset_set",
"//src/core:posix_event_engine_base_hdrs",
"//src/core:promise_status",
"//src/core:ref_counted",
"//src/core:resolved_address",
Expand Down Expand Up @@ -1632,6 +1648,7 @@ grpc_cc_library(
"handshaker",
"promise",
"ref_counted_ptr",
"stats",
"tsi_base",
"//src/core:activity",
"//src/core:arena",
Expand All @@ -1655,6 +1672,7 @@ grpc_cc_library(
"//src/core:seq",
"//src/core:slice",
"//src/core:slice_refcount",
"//src/core:stats_data",
"//src/core:status_helper",
"//src/core:try_seq",
"//src/core:unique_type_name",
Expand Down Expand Up @@ -1783,7 +1801,7 @@ grpc_cc_library(
"grpc_service_config_impl",
"grpc_trace",
"grpcpp_call_metric_recorder",
"grpcpp_server_metric_recorder",
"grpcpp_backend_metric_recorder",
"grpcpp_status",
"iomgr_timer",
"ref_counted_ptr",
Expand Down Expand Up @@ -1853,7 +1871,7 @@ grpc_cc_library(
"grpc_trace",
"grpc_unsecure",
"grpcpp_call_metric_recorder",
"grpcpp_server_metric_recorder",
"grpcpp_backend_metric_recorder",
"grpcpp_status",
"iomgr_timer",
"ref_counted_ptr",
Expand Down Expand Up @@ -1962,9 +1980,12 @@ grpc_cc_library(
)

grpc_cc_library(
name = "grpcpp_server_metric_recorder",
name = "grpcpp_backend_metric_recorder",
srcs = [
"src/cpp/server/orca/server_metric_recorder.cc",
"src/cpp/server/orca/backend_metric_recorder.cc",
markdroth marked this conversation as resolved.
Show resolved Hide resolved
],
hdrs = [
"src/cpp/server/backend_metric_recorder.h"
],
language = "c++",
public_hdrs = [
Expand All @@ -1973,8 +1994,11 @@ grpc_cc_library(
visibility = ["@grpc:public"],
deps = [
"gpr",
"grpcpp_call_metric_recorder",
"grpc++_public_hdrs",
"grpc_trace",
"//src/core:grpc_backend_metric_data",
"//src/core:grpc_backend_metric_provider",
],
)

Expand All @@ -2000,7 +2024,7 @@ grpc_cc_library(
"gpr",
"grpc++",
"grpc_base",
"grpcpp_server_metric_recorder",
"grpcpp_backend_metric_recorder",
"protobuf_duration_upb",
"ref_counted_ptr",
"xds_orca_service_upb",
Expand Down Expand Up @@ -2170,6 +2194,7 @@ grpc_cc_library(
"//src/core:channel_args",
"//src/core:channel_stack_type",
"//src/core:closure",
"//src/core:experiments",
"//src/core:slice",
"//src/core:slice_buffer",
"//src/core:slice_refcount",
Expand Down Expand Up @@ -2484,6 +2509,34 @@ grpc_cc_library(
deps = ["gpr"],
)

grpc_cc_library(
name = "parse_address",
srcs = [
"//src/core:lib/address_utils/parse_address.cc",
"//src/core:lib/iomgr/grpc_if_nametoindex_posix.cc",
"//src/core:lib/iomgr/grpc_if_nametoindex_unsupported.cc",
],
hdrs = [
"//src/core:lib/address_utils/parse_address.h",
"//src/core:lib/iomgr/grpc_if_nametoindex.h",
],
external_deps = [
"absl/status",
"absl/status:statusor",
"absl/strings",
],
visibility = ["@grpc:alt_grpc_base_legacy"],
deps = [
"gpr",
"uri_parser",
"//src/core:error",
"//src/core:grpc_sockaddr",
"//src/core:iomgr_port",
"//src/core:resolved_address",
"//src/core:status_helper",
],
)

grpc_cc_library(
name = "backoff",
srcs = [
Expand Down Expand Up @@ -2679,6 +2732,7 @@ grpc_cc_library(
"//src/core:ext/filters/client_channel/lb_call_state_internal.h",
"//src/core:ext/filters/client_channel/lb_policy/child_policy_handler.h",
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric.h",
"//src/core:ext/filters/client_channel/lb_policy/oob_backend_metric_internal.h",
"//src/core:ext/filters/client_channel/local_subchannel_pool.h",
"//src/core:ext/filters/client_channel/retry_filter.h",
"//src/core:ext/filters/client_channel/retry_service_config.h",
Expand Down Expand Up @@ -2810,6 +2864,7 @@ grpc_cc_library(
"grpc_trace",
"iomgr_timer",
"orphanable",
"parse_address",
"ref_counted_ptr",
"server_address",
"sockaddr_utils",
Expand Down Expand Up @@ -3752,6 +3807,11 @@ grpc_upb_proto_library(
deps = ["@envoy_api//envoy/type/http/v3:pkg"],
)

grpc_upb_proto_library(
name = "envoy_extensions_load_balancing_policies_client_side_weighted_round_robin_upb",
deps = ["@envoy_api//envoy/extensions/load_balancing_policies/client_side_weighted_round_robin/v3:pkg"],
)

grpc_upb_proto_library(
name = "envoy_extensions_load_balancing_policies_ring_hash_upb",
deps = ["@envoy_api//envoy/extensions/load_balancing_policies/ring_hash/v3:pkg"],
Expand Down