-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zipkin support for ActiveMQ as a collector #1990
Comments
looks like there is an implementation started here #2466 |
Let's assume we are talking about activemq (not artemis or apollo) I like that activemq has very few dependencies, however they do add 2MiB weight to the server.
Moreover, I am concerned that one of its non-annotation dependencies has not been updated since 2014: hawtbuf I'm not sure which liabilities exist here https://github.com/fusesource/hawtbuf but this library is used all over activemq. @gtully can you weigh in on this point?
|
to pre-empt an artemis question. The dependencies are a lot bigger even if you take out netty. It introduces possibly our 4th or 5th logging dep, too :P Netty is used by armeria which is ok as long as they are on compatible versions of it. However, this sortof match tends to drift over time. $ jar -tvf artemis.jar
0 Tue Mar 26 08:34:16 ICT 2019 META-INF/
214 Tue Mar 26 08:34:16 ICT 2019 META-INF/MANIFEST.MF
0 Tue Mar 26 08:34:16 ICT 2019 lib/
728105 Thu Mar 14 13:41:06 ICT 2019 lib/artemis-core-client-2.7.0.jar
2501842 Tue Feb 07 16:43:08 ICT 2017 lib/jgroups-3.6.13.Final.jar
296065 Thu Jan 17 22:45:18 ICT 2019 lib/artemis-commons-2.6.4.jar
66469 Wed Feb 14 13:23:28 ICT 2018 lib/jboss-logging-3.3.2.Final.jar
246174 Wed Sep 21 17:21:16 ICT 2016 lib/commons-beanutils-1.9.3.jar
588337 Fri Nov 13 00:10:38 ICT 2015 lib/commons-collections-3.2.2.jar
121150 Tue Dec 18 08:47:04 ICT 2018 lib/johnzon-core-1.1.11.jar
141054 Mon Jan 21 12:55:28 ICT 2019 lib/netty-transport-native-epoll-4.1.33.Final-linux-x86_64.jar
33475 Mon Jan 21 14:11:10 ICT 2019 lib/netty-transport-native-unix-common-4.1.33.Final.jar
109210 Mon Jan 21 14:16:46 ICT 2019 lib/netty-transport-native-kqueue-4.1.33.Final-osx-x86_64.jar
563528 Mon Jan 21 12:37:12 ICT 2019 lib/netty-codec-http-4.1.33.Final.jar
278556 Mon Jan 21 12:32:22 ICT 2019 lib/netty-buffer-4.1.33.Final.jar
463615 Mon Jan 21 12:34:14 ICT 2019 lib/netty-transport-4.1.33.Final.jar
32799 Mon Jan 21 12:32:46 ICT 2019 lib/netty-resolver-4.1.33.Final.jar
420905 Mon Jan 21 12:36:42 ICT 2019 lib/netty-handler-4.1.33.Final.jar
316689 Mon Jan 21 12:34:54 ICT 2019 lib/netty-codec-4.1.33.Final.jar
587588 Mon Jan 21 12:31:18 ICT 2019 lib/netty-common-4.1.33.Final.jar
$ du -k artemis.jar
8256 artemis.jar |
NEXT STEP: Active feedback from other committers or PPMC is required before proceeding IMHO. |
Due to popular demand, this adds support for ActiveMQ 5.x. This is enabled when the env variable `ACTIVEMQ_URL` is set to a valid broker. Thanks very much to @IAMTJW for early work towards this change. To try this change, you can use jitpack https://jitpack.io/#openzipkin/zipkin Ex. ```bash TAG=activemq-SNAPSHOT curl -sSL https://jitpack.io/com/github/openzipkin/zipkin/zipkin-server/${TAG}/zipkin-server-${TAG}-exec.jar > zipkin.jar ACTIVEMQ_URL=tcp://localhost:61616 java -jar zipkin.jar ``` Supercedes #2466 Fixes #1990
#2639 will implement this |
here is the java sender openzipkin/zipkin-reporter-java#149 |
I tested with authenticated, secure remote connections using the zipkin-reporter change above. There were no dropped messages or otherwise problems with a burst of 4 threads for 30s. Moreover, you can see that with concurrency level of 8, load was spread evenly across all 8 worker threads (which share the same connection) diff --git a/webmvc4/pom.xml b/webmvc4/pom.xml
index bd58632..2ad4148 100755
--- a/webmvc4/pom.xml
+++ b/webmvc4/pom.xml
@@ -16,13 +16,20 @@
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
- <spring.version>4.3.22.RELEASE</spring.version>
+ <spring.version>4.3.24.RELEASE</spring.version>
<log4j.version>2.11.2</log4j.version>
<brave.version>5.6.5</brave.version>
</properties>
<dependencyManagement>
<dependencies>
+ <dependency>
+ <groupId>io.zipkin.reporter2</groupId>
+ <artifactId>zipkin-reporter-bom</artifactId>
+ <version>2.8.5-SNAPSHOT</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
<dependency>
<groupId>io.zipkin.brave</groupId>
<artifactId>brave-bom</artifactId>
@@ -53,7 +60,7 @@
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
- <version>4.5.7</version>
+ <version>4.5.8</version>
</dependency>
<!-- Adds the MVC class and method names to server spans -->
@@ -104,7 +111,11 @@
</dependency>
<dependency>
<groupId>io.zipkin.reporter2</groupId>
- <artifactId>zipkin-sender-okhttp3</artifactId>
+ <artifactId>zipkin-reporter-spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>io.zipkin.reporter2</groupId>
+ <artifactId>zipkin-sender-activemq-client</artifactId>
</dependency>
</dependencies>
@@ -112,7 +123,7 @@
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
- <version>3.8.0</version>
+ <version>3.8.1</version>
</plugin>
<plugin>
@@ -150,7 +161,7 @@
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
- <version>9.4.15.v20190215</version>
+ <version>9.4.18.v20190429</version>
</plugin>
</plugins>
</pluginManagement>
diff --git a/webmvc4/src/main/java/brave/webmvc/TracingConfiguration.java b/webmvc4/src/main/java/brave/webmvc/TracingConfiguration.java
index 095c043..3912ec3 100644
--- a/webmvc4/src/main/java/brave/webmvc/TracingConfiguration.java
+++ b/webmvc4/src/main/java/brave/webmvc/TracingConfiguration.java
@@ -20,9 +20,10 @@ import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import zipkin2.Span;
+import zipkin2.codec.Encoding;
import zipkin2.reporter.AsyncReporter;
import zipkin2.reporter.Sender;
-import zipkin2.reporter.okhttp3.OkHttpSender;
+import zipkin2.reporter.beans.ActiveMQSenderFactoryBean;
/**
* This adds tracing configuration to any web mvc controllers or rest template clients.
@@ -37,17 +38,24 @@ import zipkin2.reporter.okhttp3.OkHttpSender;
public class TracingConfiguration extends WebMvcConfigurerAdapter {
/** Configuration for how to send spans to Zipkin */
- @Bean Sender sender() {
- return OkHttpSender.create("http://127.0.0.1:9411/api/v2/spans");
+ @Bean ActiveMQSenderFactoryBean senderFactory() {
+ ActiveMQSenderFactoryBean result = new ActiveMQSenderFactoryBean();
+ result.setUrl(
+ "failover:(ssl://b-da18ebe4-54ff-4dfc-835f-3862a6c144b1-1.mq.ap-southeast-1.amazonaws.com:61617,ssl://b-da18ebe4-54ff-4dfc-835f-3862a6c144b1-2.mq.ap-southeast-1.amazonaws.com:61617)");
+ result.setUsername("zipkin");
+ result.setPassword("zipkin12345678");
+ result.setMessageMaxBytes(1024);
+ result.setEncoding(Encoding.PROTO3);
+ return result;
}
/** Configuration for how to buffer spans into messages for Zipkin */
- @Bean AsyncReporter<Span> spanReporter() {
- return AsyncReporter.create(sender());
+ @Bean AsyncReporter<Span> spanReporter() throws Exception {
+ return AsyncReporter.create((Sender) senderFactory().getObject());
}
/** Controls aspects of tracing such as the service name that shows up in the UI */
- @Bean Tracing tracing(@Value("${zipkin.service:brave-webmvc-example}") String serviceName) {
+ @Bean Tracing tracing(@Value("${zipkin.service:brave-webmvc-example}") String serviceName) throws Exception {
return Tracing.newBuilder()
.localServiceName(serviceName)
.propagationFactory(ExtraFieldPropagation.newFactory(B3Propagation.FACTORY, "user-name")) |
#2639 includes how to test this change prior to release |
We are using ActiveMQ in our project and we don't want to go for any other queue, so it will be good if Zipkin provides support for ActiveMQ as a collector.
This issue is now closed. Until a release happens with this change, you can look at the PR description of #2639 for testing
The text was updated successfully, but these errors were encountered: