Skip to content

Commit a4a85b3

Browse files
committed
fix: remove duplicate logic
1 parent f8989ff commit a4a85b3

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

gax-java/gax/src/main/java/com/google/api/gax/tracing/ApiTracerContext.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,8 @@ public Map<String, Object> getAttemptAttributes() {
179179
ObservabilityAttributes.ARTIFACT_ATTRIBUTE, libraryMetadata().artifactName());
180180
}
181181
}
182-
if (transport() == Transport.GRPC) {
183-
if (!Strings.isNullOrEmpty(fullMethodName())) {
184-
attributes.put(ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE, fullMethodName());
185-
}
186-
if (Strings.isNullOrEmpty(fullMethodName())) {
187-
attributes.put(ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE, fullMethodName());
188-
}
182+
if (transport() == Transport.GRPC && !Strings.isNullOrEmpty(fullMethodName())) {
183+
attributes.put(ObservabilityAttributes.GRPC_RPC_METHOD_ATTRIBUTE, fullMethodName());
189184
}
190185
if (transport() == Transport.HTTP && !Strings.isNullOrEmpty(httpMethod())) {
191186
attributes.put(ObservabilityAttributes.HTTP_METHOD_ATTRIBUTE, httpMethod());

0 commit comments

Comments
 (0)