mirror of https://github.com/grpc/grpc-java.git
Experimental metrics (i.e WRR and RLS metrics) are disabled by default. Users are expected to explicitly enable while configuring metrics.
This commit is contained in:
parent
cc587e60c5
commit
80f872e3a6
|
@ -136,25 +136,31 @@ final class CachingRlsLbClient {
|
||||||
MetricInstrumentRegistry metricInstrumentRegistry
|
MetricInstrumentRegistry metricInstrumentRegistry
|
||||||
= MetricInstrumentRegistry.getDefaultRegistry();
|
= MetricInstrumentRegistry.getDefaultRegistry();
|
||||||
DEFAULT_TARGET_PICKS_COUNTER = metricInstrumentRegistry.registerLongCounter(
|
DEFAULT_TARGET_PICKS_COUNTER = metricInstrumentRegistry.registerLongCounter(
|
||||||
"grpc.lb.rls.default_target_picks", "Number of LB picks sent to the default target", "pick",
|
"grpc.lb.rls.default_target_picks",
|
||||||
|
"EXPERIMENTAL. Number of LB picks sent to the default target", "{pick}",
|
||||||
Arrays.asList("grpc.target", "grpc.lb.rls.server_target",
|
Arrays.asList("grpc.target", "grpc.lb.rls.server_target",
|
||||||
"grpc.lb.rls.data_plane_target", "grpc.lb.pick_result"), Collections.emptyList(), true);
|
"grpc.lb.rls.data_plane_target", "grpc.lb.pick_result"), Collections.emptyList(),
|
||||||
|
false);
|
||||||
TARGET_PICKS_COUNTER = metricInstrumentRegistry.registerLongCounter("grpc.lb.rls.target_picks",
|
TARGET_PICKS_COUNTER = metricInstrumentRegistry.registerLongCounter("grpc.lb.rls.target_picks",
|
||||||
"Number of LB picks sent to each RLS target", "pick",
|
"EXPERIMENTAL. Number of LB picks sent to each RLS target. Note that if the default "
|
||||||
Arrays.asList("grpc.target", "grpc.lb.rls.server_target",
|
+ "target is also returned by the RLS server, RPCs sent to that target from the cache "
|
||||||
"grpc.lb.rls.data_plane_target", "grpc.lb.pick_result"), Collections.emptyList(), true);
|
+ "will be counted in this metric, not in grpc.rls.default_target_picks.", "{pick}",
|
||||||
|
Arrays.asList("grpc.target", "grpc.lb.rls.server_target", "grpc.lb.rls.data_plane_target",
|
||||||
|
"grpc.lb.pick_result"), Collections.emptyList(),
|
||||||
|
false);
|
||||||
FAILED_PICKS_COUNTER = metricInstrumentRegistry.registerLongCounter("grpc.lb.rls.failed_picks",
|
FAILED_PICKS_COUNTER = metricInstrumentRegistry.registerLongCounter("grpc.lb.rls.failed_picks",
|
||||||
"Number of LB picks failed due to either a failed RLS request or the RLS channel being "
|
"EXPERIMENTAL. Number of LB picks failed due to either a failed RLS request or the "
|
||||||
+ "throttled", "pick", Arrays.asList("grpc.target", "grpc.lb.rls.server_target"),
|
+ "RLS channel being throttled", "{pick}",
|
||||||
Collections.emptyList(), true);
|
Arrays.asList("grpc.target", "grpc.lb.rls.server_target"),
|
||||||
|
Collections.emptyList(), false);
|
||||||
CACHE_ENTRIES_GAUGE = metricInstrumentRegistry.registerLongGauge("grpc.lb.rls.cache_entries",
|
CACHE_ENTRIES_GAUGE = metricInstrumentRegistry.registerLongGauge("grpc.lb.rls.cache_entries",
|
||||||
"Number of entries in the RLS cache", "entry",
|
"EXPERIMENTAL. Number of entries in the RLS cache", "{entry}",
|
||||||
Arrays.asList("grpc.target", "grpc.lb.rls.server_target", "grpc.lb.rls.instance_id"),
|
Arrays.asList("grpc.target", "grpc.lb.rls.server_target", "grpc.lb.rls.instance_uuid"),
|
||||||
Collections.emptyList(), true);
|
Collections.emptyList(), false);
|
||||||
CACHE_SIZE_GAUGE = metricInstrumentRegistry.registerLongGauge("grpc.lb.rls.cache_size",
|
CACHE_SIZE_GAUGE = metricInstrumentRegistry.registerLongGauge("grpc.lb.rls.cache_size",
|
||||||
"The current size of the RLS cache", "byte",
|
"EXPERIMENTAL. The current size of the RLS cache", "By",
|
||||||
Arrays.asList("grpc.target", "grpc.lb.rls.server_target", "grpc.lb.rls.instance_id"),
|
Arrays.asList("grpc.target", "grpc.lb.rls.server_target", "grpc.lb.rls.instance_uuid"),
|
||||||
Collections.emptyList(), true);
|
Collections.emptyList(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CachingRlsLbClient(Builder builder) {
|
private CachingRlsLbClient(Builder builder) {
|
||||||
|
|
|
@ -89,24 +89,26 @@ final class WeightedRoundRobinLoadBalancer extends RoundRobinLoadBalancer {
|
||||||
MetricInstrumentRegistry metricInstrumentRegistry
|
MetricInstrumentRegistry metricInstrumentRegistry
|
||||||
= MetricInstrumentRegistry.getDefaultRegistry();
|
= MetricInstrumentRegistry.getDefaultRegistry();
|
||||||
RR_FALLBACK_COUNTER = metricInstrumentRegistry.registerLongCounter("grpc.lb.wrr.rr_fallback",
|
RR_FALLBACK_COUNTER = metricInstrumentRegistry.registerLongCounter("grpc.lb.wrr.rr_fallback",
|
||||||
"Number of scheduler updates in which there were not enough endpoints with valid "
|
"EXPERIMENTAL. Number of scheduler updates in which there were not enough endpoints "
|
||||||
+ "weight, which caused the WRR policy to fall back to RR behavior", "update",
|
+ "with valid weight, which caused the WRR policy to fall back to RR behavior",
|
||||||
Lists.newArrayList("grpc.target"), Lists.newArrayList("grpc.lb.locality"), true);
|
"{update}", Lists.newArrayList("grpc.target"), Lists.newArrayList("grpc.lb.locality"),
|
||||||
|
false);
|
||||||
ENDPOINT_WEIGHT_NOT_YET_USEABLE_COUNTER = metricInstrumentRegistry.registerLongCounter(
|
ENDPOINT_WEIGHT_NOT_YET_USEABLE_COUNTER = metricInstrumentRegistry.registerLongCounter(
|
||||||
"grpc.lb.wrr.endpoint_weight_not_yet_usable",
|
"grpc.lb.wrr.endpoint_weight_not_yet_usable", "EXPERIMENTAL. Number of endpoints "
|
||||||
"Number of endpoints from each scheduler update that don't yet have usable weight "
|
+ "from each scheduler update that don't yet have usable weight information",
|
||||||
+ "information", "endpoint", Lists.newArrayList("grpc.target"),
|
"{endpoint}", Lists.newArrayList("grpc.target"), Lists.newArrayList("grpc.lb.locality"),
|
||||||
Lists.newArrayList("grpc.lb.locality"), true);
|
false);
|
||||||
ENDPOINT_WEIGHT_STALE_COUNTER = metricInstrumentRegistry.registerLongCounter(
|
ENDPOINT_WEIGHT_STALE_COUNTER = metricInstrumentRegistry.registerLongCounter(
|
||||||
"grpc.lb.wrr.endpoint_weight_stale",
|
"grpc.lb.wrr.endpoint_weight_stale",
|
||||||
"Number of endpoints from each scheduler update whose latest weight is older than the "
|
"EXPERIMENTAL. Number of endpoints from each scheduler update whose latest weight is "
|
||||||
+ "expiration period", "endpoint", Lists.newArrayList("grpc.target"),
|
+ "older than the expiration period", "{endpoint}", Lists.newArrayList("grpc.target"),
|
||||||
Lists.newArrayList("grpc.lb.locality"), true);
|
Lists.newArrayList("grpc.lb.locality"), false);
|
||||||
ENDPOINT_WEIGHTS_HISTOGRAM = metricInstrumentRegistry.registerDoubleHistogram(
|
ENDPOINT_WEIGHTS_HISTOGRAM = metricInstrumentRegistry.registerDoubleHistogram(
|
||||||
"grpc.lb.wrr.endpoint_weights", "The histogram buckets will be endpoint weight ranges.",
|
"grpc.lb.wrr.endpoint_weights",
|
||||||
"weight", Lists.newArrayList(), Lists.newArrayList("grpc.target"),
|
"EXPERIMENTAL. The histogram buckets will be endpoint weight ranges.",
|
||||||
|
"{weight}", Lists.newArrayList(), Lists.newArrayList("grpc.target"),
|
||||||
Lists.newArrayList("grpc.lb.locality"),
|
Lists.newArrayList("grpc.lb.locality"),
|
||||||
true);
|
false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WeightedRoundRobinLoadBalancer(Helper helper, Ticker ticker) {
|
public WeightedRoundRobinLoadBalancer(Helper helper, Ticker ticker) {
|
||||||
|
|
Loading…
Reference in New Issue