openzipkin / brave-cassandra Goto Github PK
View Code? Open in Web Editor NEWTracing instrumentation for Cassandra and the DataStax Java Driver
License: Apache License 2.0
Tracing instrumentation for Cassandra and the DataStax Java Driver
License: Apache License 2.0
It would be an excellent addition to have the raw query details captured in the trace. An example of this can be found in Last Pickle's implementation.
The Datastax java driver version 4.x is not backwards compatible, and the APIs and packages are different. Therefore, the existing tracing instrumentation doesn't work with the 4.x driver, and changes to this instrumentation library will be needed.
As part of the move to the Apache Software Foundation this repository will transfer ownership to apache
and name to incubator-zipkin-brave-cassandra
.
Thanks @reta for reporting
We might want to setup jenkins windows to know we are failing here (cc @abesto)
If we used docker, probably we could avoid windows related glitches. This would imply shipping the tracing driver to the docker container though. cc @bsideup
[INFO] Running brave.cassandra.driver.ITTracingSession
20:54:13,355 WARN [main] config.DatabaseDescriptor (DatabaseDescriptor.java:556) - Only 24.977GiB free across all data volumes. Consider adding more capacity to your cluster or removing obsolete snapshots
20:54:13,363 WARN [main] config.DatabaseDescriptor (DatabaseDescriptor.java:673) - index_interval has been deprecated and should be removed from cassandra.yaml
20:54:13,364 WARN [main] config.DatabaseDescriptor (DatabaseDescriptor.java:677) - Please rename encryption_options as server_encryption_options in the yaml
20:54:14,170 ERROR [COMMIT-LOG-ALLOCATOR] utils.JVMStabilityInspector (JVMStabilityInspector.java:102) - Exiting due to error while processing commit log during initialization.
org.apache.cassandra.io.FSWriteError: java.nio.file.AccessDeniedException: target\embeddedCassandra\commitlog\CommitLog-6-1553129653826.log
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:142) ~[cassandra-all-3.11.4.jar:3.11.4]
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:159) ~[cassandra-all-3.11.4.jar:3.11.4]
at org.apache.cassandra.db.commitlog.CommitLogSegment.discard(CommitLogSegment.java:409) ~[cassandra-all-3.11.4.jar:3.11.4]
at org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager.discardAvailableSegment(AbstractCommitLogSegmentManager.java:473) ~[cassandra-all-3.11.4.jar:3.11.4]
at org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager.access$200(AbstractCommitLogSegmentManager.java:46) ~[cassandra-all-3.11.4.jar:3.11.4]
at org.apache.cassandra.db.commitlog.AbstractCommitLogSegmentManager$1.runMayThrow(AbstractCommitLogSegmentManager.java:115) ~[cassandra-all-3.11.4.jar:3.11.4]
at org.apache.cassandra.utils.WrappedRunnable.run(WrappedRunnable.java:28) ~[cassandra-all-3.11.4.jar:3.11.4]
at org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:81) ~[cassandra-all-3.11.4.jar:3.11.4]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-common-4.0.56.Final.jar:4.0.56.Final]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.nio.file.AccessDeniedException: target\embeddedCassandra\commitlog\CommitLog-6-1553129653826.log
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89) ~[?:?]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:270) ~[?:?]
at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105) ~[?:?]
at java.nio.file.Files.delete(Files.java:1141) ~[?:?]
at org.apache.cassandra.io.util.FileUtils.deleteWithConfirm(FileUtils.java:136) ~[cassandra-all-3.11.4.jar:3.11.4]
... 9 more
Does server side tracing not work with non-prepared statements?
Experimenting with using this library: as per the readme
// minimally, you need to prepare a statement and enable tracing preparedStatement.enableTracing();
Trying use non prepared statements. Dont see any traces. Does this not work with non-prepared statements?
Is it possible to have Java 8 supported for this project along with Java 11?
Lots of businesses are still using Java 8 because the official support for Cassandra came out just last year, I believe. Anyway, if their choice is between upgrading their Java (and doing all the regression testing, etc, to make sure there are no negative effects) or simply not using this project, many will likely choose to not use this, unfortunately.
I've tested the driver component a bit and its worked out well. I was even able to extend it easily to add extra spans with additional information from the ResultSet.
I wasn't able to test the server component yet but having a published driver component would allow us to start using that while we consider adding cassandra server side tracing.
Currently, the Cassandra implementation does not implement outbound tracing. This means a trace won't include spans that cross nodes within the cluster.
It would be really helpful to be able to set the Zipkin format as an environment variable / JVM Option.
It'd be particularly helpful for those of us who use 3rd party zipkin collectors so we don't have to manage the infrastructure of our tracing. The collector endpoints aren't completely the same as Zipkin so the package wouldn't be able to look at the collector URL and determine ahead of time which version of ZIpkin to send.
In this case, I believe the package is sending V1 whereas I'll need it to send V2 to work and I'm not sure how to switch it.
When the build was updated so failsafe executed integration tests (see #10), a failure was revealed in brave.cassandra.ITTracing.usesExistingTraceId
. I could reproduce this failure locally, so it seems like a genuine issue.
java.lang.AssertionError:
Expecting:
<[CLIENT]>
to contain only once:
<[SERVER, CLIENT]>
but some elements were not found:
<[SERVER]>
at brave.cassandra.ITTracing.usesExistingTraceId(ITTracing.java:98)
We currently have a hard-coded way to setup zipkin config. If spring is ok to run inside cassandra (just spring is needed, not spring boot), we can configure all the things, including sampling rate etc, without a lot of copy/paste. For example, this is how the Dubbo framework configures itself..
https://github.com/openzipkin/brave/tree/master/spring-beans
we made a change to disable root-level DEPENDENCIES file, but it seems it is not in the submodules either. We should fix this before graduation.
same as openzipkin/brave-karaf#42
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.