thelastpickle / cassandra-zipkin-tracing

With Cassandra-3.4+ the tracing implementation can be replaced with zipkin tracing as provided by this project.
Apache License 2.0
47 stars 11 forks source link

Zipkin trace is not continued #3

Closed hkroger closed 7 years ago

hkroger commented 8 years ago

I'm testing out the cassandra-zipkin-tracing and I have an issue with custom payload. The application sends out the trace and custom payload existence is shown by the datastax driver:

18:39:46.888 [cluster1-nio-worker-1] TRACE com.datastax.driver.core.Message - Sending payload: {zipkin:0xBC32132774C4F39C36FD63672F7858D4138574D4E7701F030000000000000000} (44 bytes total)
18:39:46.888 [cluster1-nio-worker-1] TRACE com.datastax.driver.core.Connection - Connection[/127.0.0.1:9043-2, inFlight=1, closed=false], stream 16192, request sent successfully
18:39:46.892 [cluster1-nio-worker-1] TRACE com.datastax.driver.core.Message - Received payload: {zipkin:0xBC32132774C4F39C36FD63672F7858D4138574D4E7701F030000000000000000} (44 bytes total)

However when I added some logging as seen in the PR that I created (https://github.com/thelastpickle/cassandra-zipkin-tracing/pull/2/files), I'm getting only

TRACE [Native-Transport-Requests-3] 2016-10-23 15:42:07,465 ZipkinTracing.java:104 - No customPayload in zipkin

I'm running Cassandra 3.9 and using prepared statements (using the object mapper).

Is it a problem with Cassandra? Cassandra driver is 3.1.1.

hkroger commented 8 years ago

Hmm, might be related to https://issues.apache.org/jira/browse/CASSANDRA-11706.

michaelsembwever commented 8 years ago

@hkroger And you are sure that cassandra is running with -Dcassandra.custom_query_handler_class=org.apache.cassandra.cql3.CustomPayloadMirroringQueryHandler ?

hkroger commented 8 years ago

Yes, it turned out to be the bug in the Cassandra 3.9. It works fine with 3.10.SNAPSHOT.

hkroger commented 8 years ago

This could be fixed also in this cassandra zipkin tracing module. It was partially already done, I think but this would need to be done as well in the ZipkinTracing class as well:

     public UUID newSession(Map<String,ByteBuffer> customPayload)
     {
-        return newSession(TraceType.QUERY);
+        return newSession(
+                TimeUUIDType.instance.compose(ByteBuffer.wrap(UUIDGen.getTimeUUIDBytes())),
+                TraceType.QUERY,
+                customPayload);
     }
hkroger commented 8 years ago

This change can be seen in with

git diff cassandra-3.9..cassandra-3.X src/java/org/apache/cassandra/tracing/Tracing.java
hkroger commented 8 years ago

Actually it's not completely fixed in 3.10.SNAPSHOT. I created a JIRA ticket: https://issues.apache.org/jira/browse/CASSANDRA-12835

michaelsembwever commented 7 years ago

CASSANDRA-12835 got resolved