You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/04/12 14:47:31 UTC

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #6737: Add some defensive codes of new protobuffers' semantics

kezhenxu94 commented on a change in pull request #6737:
URL: https://github.com/apache/skywalking/pull/6737#discussion_r611696093



##########
File path: oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/LogEntry2MetricsAdapter.java
##########
@@ -97,9 +94,8 @@
     protected ServiceMeshMetric.Builder adaptCommonPart() {
         final AccessLogCommon properties = entry.getCommonProperties();
         final String endpoint = endpoint();
-        final int responseCode = ofNullable(entry.getResponse()).map(HTTPResponseProperties::getResponseCode)
-                                                                .map(UInt32Value::getValue)
-                                                                .orElse(200);
+        int responseCode = entry.getResponse().getResponseCode().getValue();

Review comment:
       > Would not we get null from entry.getResponse?
   
   It always constructs a new Response object if it’s null




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org