Skip to content

Commit 41266a3

Browse files
committed
feat: Add grpc.xds.resource_type label to xDS client metrics
1 parent c1a20ce commit 41266a3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ public class BuiltInMetricsConstant {
9999
public static final AttributeKey<String> DIRECT_PATH_USED_KEY =
100100
AttributeKey.stringKey("directpath_used");
101101
public static final AttributeKey<String> REQUEST_ID_KEY = AttributeKey.stringKey(REQUEST_ID);
102+
public static final AttributeKey<String> GRPC_XDS_RESOURCE_TYPE_KEY =
103+
AttributeKey.stringKey("grpc.xds.resource_type");
102104
public static Set<String> ALLOWED_EXEMPLARS_ATTRIBUTES = new HashSet<>(Arrays.asList(REQUEST_ID));
103105

104106
// IP address prefixes allocated for DirectPath backends.
@@ -232,6 +234,7 @@ private static void defineGRPCView(ImmutableMap.Builder<InstrumentSelector, View
232234
.map(AttributeKey::getKey)
233235
.collect(Collectors.toSet());
234236
attributesFilter.addAll(BuiltInMetricsConstant.GRPC_LB_RLS_ATTRIBUTES);
237+
attributesFilter.add(BuiltInMetricsConstant.GRPC_XDS_RESOURCE_TYPE_KEY.getKey());
235238

236239
View view =
237240
View.builder()

0 commit comments

Comments
 (0)