Skip to content
Prev Previous commit
Next Next commit
review comments
  • Loading branch information
surbhigarg92 committed Apr 16, 2025
commit 180143332044f7feddc7d07682e14496af378d36
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class BuiltInMetricsConstant {
DIRECT_PATH_ENABLED_KEY,
DIRECT_PATH_USED_KEY);

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

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

View view =
View.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ void enableGrpcMetrics(
GrpcOpenTelemetry.newBuilder()
.sdk(this.getOrCreateOpenTelemetry(projectId, credentials, monitoringHost))
.enableMetrics(BuiltInMetricsConstant.GRPC_METRICS_TO_ENABLE)
// Disable gRPCs default metrics as they are not needed for Spanner.
.disableMetrics(BuiltInMetricsConstant.GRPC_METRICS_ENABLED_BY_DEFAULT)
.build();
ApiFunction<ManagedChannelBuilder, ManagedChannelBuilder> channelConfigurator =
Expand Down
Loading