peng-yongsheng commented on a change in pull request #1273: [WIP]Zipkin 
receiver in SkyWalking collector
URL: 
https://github.com/apache/incubator-skywalking/pull/1273#discussion_r195479026
 
 

 ##########
 File path: 
apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanProcessor.java
 ##########
 @@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler;
+
+import 
org.apache.skywalking.apm.collector.receiver.zipkin.provider.RegisterServices;
+import 
org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverConfig;
+import 
org.apache.skywalking.apm.collector.receiver.zipkin.provider.cache.CacheFactory;
+import zipkin2.Span;
+import zipkin2.codec.SpanBytesDecoder;
+
+import javax.servlet.ServletInputStream;
+import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
+import java.util.List;
+
+public class SpanProcessor {
+    void convert(ZipkinReceiverConfig config, SpanBytesDecoder decoder, 
HttpServletRequest request, RegisterServices registerServices) throws 
IOException {
+        int len = request.getContentLength();
+        ServletInputStream iii = request.getInputStream();
+        byte[] buffer = new byte[len];
+        iii.read(buffer, 0, len);
+
+        List<Span> spanList = decoder.decodeList(buffer);
+
+        spanList.forEach(span -> {
+            // In Zipkin, the local service name represents the application 
owner.
+            String applicationCode = span.localServiceName();
+            if (applicationCode != null) {
 
 Review comment:
   The localServiceName will be a empty string based on the actual situation? 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to