Skip to content

Commit 9a0d168

Browse files
committed
opentelemetry: Align attempt delay duration metric attributes with gRFC Proposal A121 and verify core labels in tests
1 parent a24b798 commit 9a0d168

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

opentelemetry/src/main/java/io/grpc/opentelemetry/OpenTelemetryMetricsModule.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -255,20 +255,6 @@ public void recordAttemptDelayEnd() {
255255
.put(METHOD_KEY, fullMethodName)
256256
.put(TARGET_KEY, target)
257257
.put("grpc.delay_type", delayType);
258-
if (module.localityEnabled) {
259-
String savedLocality = locality;
260-
if (savedLocality == null) {
261-
savedLocality = "";
262-
}
263-
builder.put(LOCALITY_KEY, savedLocality);
264-
}
265-
if (module.backendServiceEnabled) {
266-
String savedBackendService = backendService;
267-
if (savedBackendService == null) {
268-
savedBackendService = "";
269-
}
270-
builder.put(BACKEND_SERVICE_KEY, savedBackendService);
271-
}
272258
if (module.customLabelEnabled) {
273259
builder.put(
274260
CUSTOM_LABEL_KEY, info.getCallOptions().getOption(Grpc.CALL_OPTION_CUSTOM_LABEL));

opentelemetry/src/test/java/io/grpc/opentelemetry/OpenTelemetryMetricsModuleTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,8 @@ public void clientAttemptDelayDuration_recorded() {
16411641
histogram -> histogram.hasPointsSatisfying(
16421642
point -> {
16431643
point.hasSum(0.25);
1644+
point.hasAttribute(METHOD_KEY, method.getFullMethodName());
1645+
point.hasAttribute(TARGET_KEY, "target:///");
16441646
point.hasAttribute(
16451647
AttributeKey.stringKey("grpc.delay_type"), "connecting");
16461648
})));

0 commit comments

Comments
 (0)