Closed chandresh-pancholi closed 4 years ago
How are you calling the redis client? If it is called in a new separate thread it might break the context propagation resulting in two traces.
cc) @malafeev could you please have a look?
Redis command
private final LettuceConnectionFactory redisClusterConnection;
public void set(String key, String value) {
redisClusterConnection.getClusterConnection().set(key.getBytes(), value.getBytes());
}
kafka consume
@KafkaListener(topics = "${topic}", containerFactory = "factory", groupId = "${group.id}")
public void activityConsume(ConsumerRecord<String, TestAvro> record) {
Activity activity = record.value();
repository.save();
redisCommand.set(String.format("%s:%s", "123", "456" ), 0);
}
@chandresh-pancholi how your consumer looks like? do you use @KafkaListener
annotation?
@malafeev , I have updated the comment. please check.
yes, it's a limitation. We don't intercept @KafkaListener
annotated method to activate consumer span.
It should be possible to extract span context from the record headers and then build child span of it but that's too much coding.
That's alright but why it only shows redis span but not mysql.
mysql (jdbc) span should be created, but what repository.save();
is doing? Does it use MySQL JDBC driver to persist entity?
Didn't you set
opentracing.spring.cloud.jdbc.withActiveSpanOnly
property to true
?
It should be false
because there is no active span.
Got it. Thanks @malafeev
There is a PR to implement missing support of @KafkaListener
in java-kafka-client
(see opentracing-contrib/java-kafka-client#83). Should we reopen this issue or create a new one to integrate a new version of java-kafka-client
?
Hi,
I am written spring boot application using java-spring-cloud.
Request flow
I am receiving two different traces
Mysql spans are not even generating.