You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by wu...@apache.org on 2018/05/26 07:44:20 UTC
[incubator-skywalking] branch zipkin/receiver-v1 updated: Open HTTP
service at zipkin tranditional port,
and context path. And put some doc for it.
This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch zipkin/receiver-v1
in repository https://gitbox.apache.org/repos/asf/incubator-skywalking.git
The following commit(s) were added to refs/heads/zipkin/receiver-v1 by this push:
new 803d91a Open HTTP service at zipkin tranditional port, and context path. And put some doc for it.
803d91a is described below
commit 803d91a20ce4420800540fbf6116363c0fa86056
Author: wusheng <wu...@foxmail.com>
AuthorDate: Sat May 26 15:44:10 2018 +0800
Open HTTP service at zipkin tranditional port, and context path. And put some doc for it.
---
apm-collector/apm-collector-boot/pom.xml | 8 +-
.../src/main/resources/application.yml | 7 +-
.../receiver-zipkin/docs/README.md | 13 +++
.../receiver-zipkin/pom.xml | 12 ++-
.../{ => receiver-zipkin-define}/pom.xml | 5 +-
.../zipkin/define/ZipkinReceiverModule.java | 42 ++++++++++
...ywalking.apm.collector.core.module.ModuleDefine | 19 +++++
.../{ => receiver-zipkin-provider}/pom.xml | 17 +++-
.../zipkin/provider/ZipkinReceiverConfig.java | 27 +++++++
.../zipkin/provider/ZipkinReceiverProvider.java | 94 ++++++++++++++++++++++
.../zipkin/provider/handler/SpanJettyHandler.java | 42 ++++++++++
...alking.apm.collector.core.module.ModuleProvider | 19 +++++
docs/README.md | 1 +
docs/en/Incubating/Abstract.md | 1 +
14 files changed, 298 insertions(+), 9 deletions(-)
diff --git a/apm-collector/apm-collector-boot/pom.xml b/apm-collector/apm-collector-boot/pom.xml
index 69b9b8e..95b1237 100644
--- a/apm-collector/apm-collector-boot/pom.xml
+++ b/apm-collector/apm-collector-boot/pom.xml
@@ -180,6 +180,12 @@
<version>${project.version}</version>
</dependency>
<!-- alarm provider -->
+ <!-- zipkin receiver-->
+ <dependency>
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>receiver-zipkin-provider</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<!-- instrument provided dependency -->
<dependency>
@@ -240,4 +246,4 @@
</plugin>
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
diff --git a/apm-collector/apm-collector-boot/src/main/resources/application.yml b/apm-collector/apm-collector-boot/src/main/resources/application.yml
index 33995cd..c8d9818 100644
--- a/apm-collector/apm-collector-boot/src/main/resources/application.yml
+++ b/apm-collector/apm-collector-boot/src/main/resources/application.yml
@@ -86,4 +86,9 @@ configuration:
applicationAverageResponseTimeThreshold: 2000
# thermodynamic
thermodynamicResponseTimeStep: 50
- thermodynamicCountOfResponseTimeSteps: 40
\ No newline at end of file
+ thermodynamicCountOfResponseTimeSteps: 40
+receiver_zipkin:
+ default:
+ host: localhost
+ port: 9411
+ contextPath: /api/v2/spans
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README.md b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README.md
new file mode 100644
index 0000000..428c172
--- /dev/null
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README.md
@@ -0,0 +1,13 @@
+# Zipkin receiver
+Zipkin receiver provides the feature to receive span data from zipkin instrumented applications. SkyWalking backend provides
+analysis, aggregation and visualization. So the user will not need to change or learn how SkyWalking auto instrumentation
+agents(Java, .NET, node.js) work, or they don't want to change for some reasons.
+
+Zipkin receiver is only an optional features in SkyWalking, even now it is [an incubating feature](../../../docs/en/Incubating/Abstract.md).
+
+## Limits
+As an incubating feature, it is a prototype. So it has following limits:
+
+1. Don't try to use SkyWalking native agents and Zipkin's libs in the same distributed system. Considering HEADERs of Zipkin and SkyWalking aren't shared/interoperable, their two will not propagate context for each other. Trace will not continue.
+1. Don't support cluster mode.
+1. Analysis based on trace will be finished in the certain and given duration. The default assumption is 2 min most. SkyWalking used more complex header and context to avoid this in analysis stage.
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml
index 5f81d4c..4ed7017 100644
--- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml
@@ -29,6 +29,16 @@
<artifactId>receiver-zipkin</artifactId>
<packaging>pom</packaging>
+ <modules>
+ <module>receiver-zipkin-define</module>
+ <module>receiver-zipkin-provider</module>
+ </modules>
-
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>apm-collector-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
</project>
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/pom.xml
similarity index 89%
copy from apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml
copy to apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/pom.xml
index 5f81d4c..e7d1282 100644
--- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/pom.xml
@@ -21,14 +21,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <artifactId>apm-collector-thirdparty-receiver</artifactId>
+ <artifactId>receiver-zipkin</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>5.0.0-beta2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>receiver-zipkin</artifactId>
- <packaging>pom</packaging>
+ <artifactId>receiver-zipkin-define</artifactId>
</project>
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/define/ZipkinReceiverModule.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/define/ZipkinReceiverModule.java
new file mode 100644
index 0000000..c93c192
--- /dev/null
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/define/ZipkinReceiverModule.java
@@ -0,0 +1,42 @@
+/*
+ * 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.define;
+
+import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
+
+/**
+ * Zipkin receiver module provides the HTTP, protoc serve for any SDK or agent by following Zipkin format.
+ *
+ * At this moment, Zipkin format is not compatible with SkyWalking, especially HEADERs.
+ * Please don't consider this as a Zipkin-SkyWalking integration,
+ * it is provided for adding analysis, aggregation and visualization capabilities to zipkin backend.
+ *
+ * @author wusheng
+ */
+public class ZipkinReceiverModule extends ModuleDefine {
+ public static final String NAME = "receiver_zipkin";
+
+ @Override public String name() {
+ return NAME;
+ }
+
+ @Override public Class[] services() {
+ return new Class[0];
+ }
+}
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
new file mode 100644
index 0000000..c8608bc
--- /dev/null
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-define/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleDefine
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+#
+
+org.apache.skywalking.apm.collector.receiver.zipkin.define.ZipkinReceiverModule
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/pom.xml
similarity index 69%
copy from apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml
copy to apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/pom.xml
index 5f81d4c..0ea71ba 100644
--- a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/pom.xml
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/pom.xml
@@ -21,14 +21,25 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
- <artifactId>apm-collector-thirdparty-receiver</artifactId>
+ <artifactId>receiver-zipkin</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>5.0.0-beta2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>receiver-zipkin</artifactId>
- <packaging>pom</packaging>
+ <artifactId>receiver-zipkin-provider</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>receiver-zipkin-define</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.skywalking</groupId>
+ <artifactId>collector-jetty-manager-define</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
</project>
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverConfig.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverConfig.java
new file mode 100644
index 0000000..9afe409
--- /dev/null
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverConfig.java
@@ -0,0 +1,27 @@
+/*
+ * 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;
+
+import org.apache.skywalking.apm.collector.server.jetty.JettyServerConfig;
+
+/**
+ * @author wusheng
+ */
+public class ZipkinReceiverConfig extends JettyServerConfig {
+}
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverProvider.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverProvider.java
new file mode 100644
index 0000000..13ae2bf
--- /dev/null
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/ZipkinReceiverProvider.java
@@ -0,0 +1,94 @@
+/*
+ * 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.
+ *
+ */
+
+/*
+ * 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;
+
+import org.apache.skywalking.apm.collector.core.module.ModuleConfig;
+import org.apache.skywalking.apm.collector.core.module.ModuleDefine;
+import org.apache.skywalking.apm.collector.core.module.ModuleProvider;
+import org.apache.skywalking.apm.collector.core.module.ModuleStartException;
+import org.apache.skywalking.apm.collector.core.module.ServiceNotProvidedException;
+import org.apache.skywalking.apm.collector.jetty.manager.JettyManagerModule;
+import org.apache.skywalking.apm.collector.jetty.manager.service.JettyManagerService;
+import org.apache.skywalking.apm.collector.receiver.zipkin.define.ZipkinReceiverModule;
+import org.apache.skywalking.apm.collector.receiver.zipkin.provider.handler.SpanJettyHandler;
+import org.apache.skywalking.apm.collector.server.jetty.JettyServer;
+
+/**
+ * @author wusheng
+ */
+public class ZipkinReceiverProvider extends ModuleProvider {
+ public static final String NAME = "default";
+ private ZipkinReceiverConfig config;
+
+ public ZipkinReceiverProvider() {
+ config = new ZipkinReceiverConfig();
+ }
+
+ @Override public String name() {
+ return NAME;
+ }
+
+ @Override public Class<? extends ModuleDefine> module() {
+ return ZipkinReceiverModule.class;
+ }
+
+ @Override public ModuleConfig createConfigBeanIfAbsent() {
+ return config;
+ }
+
+ @Override public void prepare() throws ServiceNotProvidedException {
+
+ }
+
+ @Override public void start() throws ServiceNotProvidedException, ModuleStartException {
+ JettyManagerService managerService = getManager().find(JettyManagerModule.NAME).getService(JettyManagerService.class);
+ JettyServer jettyServer = managerService.createIfAbsent(config.getHost(), config.getPort(), config.getContextPath());
+ addHandlers(jettyServer);
+ }
+
+ @Override public void notifyAfterCompleted() throws ServiceNotProvidedException {
+
+ }
+
+ @Override public String[] requiredModules() {
+ return new String[] {JettyManagerModule.NAME};
+ }
+
+ private void addHandlers(JettyServer jettyServer) {
+ jettyServer.addHandler(new SpanJettyHandler());
+ }
+}
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanJettyHandler.java b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanJettyHandler.java
new file mode 100644
index 0000000..9c05419
--- /dev/null
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/java/org/apache/skywalking/apm/collector/receiver/zipkin/provider/handler/SpanJettyHandler.java
@@ -0,0 +1,42 @@
+/*
+ * 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 com.google.gson.JsonElement;
+import java.io.IOException;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.skywalking.apm.collector.server.jetty.ArgumentsParseException;
+import org.apache.skywalking.apm.collector.server.jetty.JettyHandler;
+
+/**
+ * @author wusheng
+ */
+public class SpanJettyHandler extends JettyHandler {
+ @Override public String pathSpec() {
+ return "";
+ }
+
+ @Override protected JsonElement doGet(HttpServletRequest req) throws ArgumentsParseException {
+ return null;
+ }
+
+ @Override protected JsonElement doPost(HttpServletRequest req) throws ArgumentsParseException, IOException {
+ return null;
+ }
+}
diff --git a/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
new file mode 100644
index 0000000..9046f75
--- /dev/null
+++ b/apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/receiver-zipkin-provider/src/main/resources/META-INF/services/org.apache.skywalking.apm.collector.core.module.ModuleProvider
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+#
+
+org.apache.skywalking.apm.collector.receiver.zipkin.provider.ZipkinReceiverProvider
diff --git a/docs/README.md b/docs/README.md
index c58cdd2..936be3b 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -16,6 +16,7 @@
* Incubating Features
* [Abstract](en/Incubating/Abstract.md)
* [Support Custom Trace Ignore](../apm-sniffer/optional-plugins/trace-ignore-plugin/README.md)
+ * [Receive Zipkin span data](../apm-collector/apm-collector-thirdparty-receiver/receiver-zipkin/docs/README.md)
* Application Toolkit
* [Overview](en/Applicaton-toolkit.md)
* [OpenTracing Tracer](en/Opentracing.md)
diff --git a/docs/en/Incubating/Abstract.md b/docs/en/Incubating/Abstract.md
index 452146d..34769d3 100644
--- a/docs/en/Incubating/Abstract.md
+++ b/docs/en/Incubating/Abstract.md
@@ -10,3 +10,4 @@ List some typical incubating features
1. New storage implementor in collector, such as: ElasticSearch HTTP, MySQL...
1. New module provided in collector.
1. New optional plugins in agent.
+1. New features/services in collector, as the integration.
--
To stop receiving notification emails like this one, please contact
wusheng@apache.org.