Skip to content

Commit 4b6c55d

Browse files
committed
review comments
1 parent 235b3a1 commit 4b6c55d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInMetricsConstant.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public class BuiltInMetricsConstant {
107107
DIRECT_PATH_ENABLED_KEY,
108108
DIRECT_PATH_USED_KEY);
109109

110-
public static final Set<String> GRPC_ATTRIBUTES =
110+
static final Set<String> GRPC_LB_RLS_ATTRIBUTES =
111111
ImmutableSet.of("grpc.lb.rls.data_plane_target", "grpc.lb.pick_result");
112112

113113
static Aggregation AGGREGATION_WITH_MILLIS_HISTOGRAM =
@@ -212,7 +212,7 @@ private static void defineGRPCView(ImmutableMap.Builder<InstrumentSelector, View
212212
BuiltInMetricsConstant.COMMON_ATTRIBUTES.stream()
213213
.map(AttributeKey::getKey)
214214
.collect(Collectors.toSet());
215-
attributesFilter.addAll(BuiltInMetricsConstant.GRPC_ATTRIBUTES);
215+
attributesFilter.addAll(BuiltInMetricsConstant.GRPC_LB_RLS_ATTRIBUTES);
216216

217217
View view =
218218
View.builder()

google-cloud-spanner/src/main/java/com/google/cloud/spanner/BuiltInMetricsProvider.java

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ void enableGrpcMetrics(
9999
GrpcOpenTelemetry.newBuilder()
100100
.sdk(this.getOrCreateOpenTelemetry(projectId, credentials, monitoringHost))
101101
.enableMetrics(BuiltInMetricsConstant.GRPC_METRICS_TO_ENABLE)
102+
// Disable gRPCs default metrics as they are not needed for Spanner.
102103
.disableMetrics(BuiltInMetricsConstant.GRPC_METRICS_ENABLED_BY_DEFAULT)
103104
.build();
104105
ApiFunction<ManagedChannelBuilder, ManagedChannelBuilder> channelConfigurator =

0 commit comments

Comments
 (0)