Reputation: 947
I am currently running Spring Cloud Edgware.SR2. I am migrating services from RabbitMQ to Kafka, and at this point I don't see any Zipkin traces when I run kafka-console-consumer.sh on the zipkin topic (i.e., kafka-console-consumer.sh --new-consumer --bootstrap-server localhost:9092 --topic zipkin --from-beginning
). As a result, I of course don't see any trace information in the Zipkin UI.
Following are the dependencies I have as part of the producer service:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.9.RELEASE</version>
<relativePath></relativePath>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Edgware.SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<version>1.5.9.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-stub-runner</artifactId>
<scope>test</scope>
<version>1.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-contract-verifier</artifactId>
<scope>test</scope>
<version>1.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
<version>1.4.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-kafka11</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
<version>4.3.13.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-java-dsl</artifactId>
<version>1.2.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jmx</artifactId>
<version>4.3.13.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-kafka</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
<version>1.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-zipkin</artifactId>
<version>1.3.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.restdocs</groupId>
<artifactId>spring-restdocs-mockmvc</artifactId>
<scope>test</scope>
<version>2.0.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
<version>4.2.3.RELEASE</version>
</dependency>
</dependencies>
These are the dependency overrides I had to make after pulling in the spring-cloud-stream-binder-kafka11
dependency per the instructions at the bottom of the Spring Cloud Stream project page.
I also took a look at the instructions for Sleuth with Zipkin via RabbitMQ or Kafka, and I think I have that part correct.
The documentation states If you want Sleuth over RabbitMQ add the spring-cloud-starter-zipkin and spring-rabbit dependencies.
It specifically mentions spring-cloud-starter-zipkin
is needed for RabbitMQ, but I added it even though I'm using Kafka since it didn't work without this dependency either.
Any ideas on what I'm missing or have configured incorrectly to capture Sleuth traces and send them to the Zipkin server using Kafka?
Upvotes: 1
Views: 5839
Reputation: 11149
Why are you setting the values of dependencies manually? Please use the Edgware.SR2 BOM. You have to add the kafka dependency, ensure that rabbit is not on the classpath. If you have both kafka and rabbit on the classpath you need to set the spring.zipkin.sender.type=kafka
UPDATE:
As we describe in the documentation, the Sleuth Stream support is deprecated in Edgware and removed in FInchley. If you've decided to go with the new approach of using native Zipkin messaging support, then you have to use the Zipkin Server with Kafka as described here https://github.com/openzipkin/zipkin/tree/master/zipkin-autoconfigure/collector-kafka10 . Let me copy part of the docs here
The following configuration points apply apply when KAFKA_BOOTSTRAP_SERVERS
or
zipkin.collector.kafka.bootstrap-servers
is set. They can be configured by setting an environment
variable or by setting a java system property using the -Dproperty.name=value
command line
argument. Some settings correspond to "New Consumer Configs" in
Kafka documentation.
Environment Variable | Property | New Consumer Config | Description
KAFKA_BOOTSTRAP_SERVERS
| zipkin.collector.kafka.bootstrap-servers
| bootstrap.servers | Comma-separated list of brokers, ex. 127.0.0.1:9092. No default
KAFKA_GROUP_ID
| zipkin.collector.kafka.group-id
| group.id | The consumer group this process is consuming on behalf of. Defaults to zipkin
KAFKA_TOPIC
| zipkin.collector.kafka.topic
| N/A | Comma-separated list of topics that zipkin spans will be consumed from. Defaults to zipkin
KAFKA_STREAMS
| zipkin.collector.kafka.streams
| N/A | Count of threads consuming the topic. Defaults to 1
Upvotes: 2