Open wsargent opened 7 years ago
Hi @wsargent,
There's probably a far far easier way to expose this from within phantom, let us think of a way to include it in the next release, sounds like all you need is access to that session initialiser, we can de-couple that implementation and allow you to deal with it from within the phantom builder itself.
Regards,
Thanks! I know that working with a type safe builder pattern can be involved -- what I've done in the past has been to use a trait with an abstract type member Self:
so implementations can return the subtype:
and not the super type like you'd normally get. (There was a reason I didn't use this.type
, but I'm afraid I don't remember it right now).
@wsargent Where is the actual line where the tracer gets used? This has now become top priority and we can deliver the functionality as part of phantom, but I can't really tell rom the above code where it's interplaying with Cassandra, I'm guessing that's inside OpentracingCassandraConnection
, but that particular code is not found in the things you pasted above.
Please let me know if you can so we can push this to prod quickly for you.
The TracingCluster is part of the opentracing-cassandra-driver, so I've been mapping everything out through there. OpentracingCassandraConnection is my rendering of https://github.com/outworkers/phantom/blob/develop/phantom-connectors/src/main/scala/com/outworkers/phantom/connectors/CassandraConnection.scala
Hi @wsargent This is becoming a priority on our part soon. However, I don't really like all the open tracing code, because it's got things that work around query strings, which is necessary in the raw driver but not so much in Phantom, because we actually have complex ADTs to model all CQL data-structures and things like that. Query generation is an afterthought from the DSL structures, so we wouldn't need most of the code found in the example.
It may take a while, but if you could invest some time at least to sanity check the output in follow up PRs, I'm sure we can get this out, I know it's already been more than a while since we last discussed this.
@alexflav23 if you can point me at them I'll take a look when I have time. Fair warning, it may be a couple of weeks.
I'm looking to see how to integrate the java-cassandra-driver for opentracing with Phantom.
The Java API expects to wrap Cluster, and takes an Initializer:
https://github.com/opentracing-contrib/java-cassandra-driver#usage
But there doesn't seem to be an accessible way to do this from Phantom -- the closest I've found is extend the SessionProvider:
But from there, it doesn't seem practical to swap out the SessionProvider instantiation. I can't map it through the Cluster.Builder as the API expects the end result.
So where I am right now is...