wankai123 commented on a change in pull request #6243:
URL: https://github.com/apache/skywalking/pull/6243#discussion_r562327322



##########
File path: 
oap-server/server-receiver-plugin/otel-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/otel/oc/OCMetricHandler.java
##########
@@ -57,11 +58,21 @@
     @Override public StreamObserver<ExportMetricsServiceRequest> export(
         StreamObserver<ExportMetricsServiceResponse> responseObserver) {
         return new StreamObserver<ExportMetricsServiceRequest>() {
-            @Override public void onNext(ExportMetricsServiceRequest request) {
+            private Node node;
+
+            @Override
+            public void onNext(ExportMetricsServiceRequest request) {
+                if (request.hasNode())
+                    node = request.getNode();

Review comment:
       <pre>/**
      * 
      * This is required only in the first message on the stream or if the
      * previous sent ExportMetricsServiceRequest message has a different Node 
(e.g.
      * when the same RPC is used to send Metrics from multiple Applications).
      * 
      *
      * <code>.opencensus.proto.agent.common.v1.Node node = 1;</code>
      * @return The node.
      */
     @java.lang.Override
     public io.opencensus.proto.agent.common.v1.Node getNode() {
       return node_ == null ? 
io.opencensus.proto.agent.common.v1.Node.getDefaultInstance() : node_;
     }</pre>
   
   I think the generated code already had a defaultInstance?

##########
File path: 
oap-server/server-receiver-plugin/otel-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/otel/oc/OCMetricHandler.java
##########
@@ -107,6 +118,13 @@
         return result;
     }
 
+    private static Map<String, String> buildLabelsFromNodeInfo(Node node,
+                                                               Map<String, 
String> buildLabelsResult) {
+        if (node != null)
+            buildLabelsResult.put("node_identifier_host_name", 
node.getIdentifier().getHostName());

Review comment:
       <pre>
   node {
     identifier {
       host_name: "docker.for.mac.host.internal"
     }
     service_info {
       name: "otel-collector"
     }
   }
   </pre>
   I looked at the data I got, so far it's just given host_name for now.
   I'm not sure about what `pid & start_timestamp ` exactly means , I think we 
could add these later?




----------------------------------------------------------------
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:
[email protected]


Reply via email to