provide cassandra java driver 3.x plugin#3410
Conversation
| List<InetSocketAddress> inetSocketAddresses = (List<InetSocketAddress>) allArguments[1]; | ||
| StringBuilder hosts = new StringBuilder(); | ||
| for (InetSocketAddress inetSocketAddress : inetSocketAddresses) { | ||
| hosts.append(inetSocketAddress.getHostName() + ":" + inetSocketAddress.getPort() + ","); |
There was a problem hiding this comment.
It does not matter, but I suggest to do like that.
hosts.append(inetSocketAddress.getHostName()).append(":").append(inetSocketAddress.getPort()).append(",");
...assandra/java/driver/v3/SessionManagerExecuteAndExecuteAsyncWithStatementArgInterceptor.java
Outdated
Show resolved
Hide resolved
|
@dmsolr Any update? @zhaoyuguang Please run this codes test case again. I want to see any good luck this time. |
|
@wu-sheng, I think you want to ping @stone-wlg , right? |
|
@dmsolr I was really pinging you, to make sure you don't have a further review to do. Why are you still awake at this moment? |
|
@stone-wlg Do you update this PR to support |
|
haha, a glace before sleep. @wu-sheng , have a good dream. |
yes, we have. |
But I could not find |
No, the async key is the getUninterruptibly method. it likes lazy mode or cursor of database. |
OK. That is another story. I am thinking about this too. But not related to this PR, could be done in a different way. |
Currently, i intercept getUninterruptibly method by LOCAL METHOD in skywalking. So we can get accurate execution time whatever sync or async way. |
|
Let's wait for test case and 6.4.0 shipped. We are only fixing bugs before 6.4.0 release. |
Make sense for now. I am thinking about a special tag for this kind of OP(cursor reading) |
ok |
Got it. |
|
@wu-sheng Currently, i am working monitor whatever log, metric and trace. i am thinking that is it necessary to add MQ(kafka) between skywalking agent and OAP? this is maybe another topic, i just want to know in a short word, thanks |
Most APM didn't do this, because it doesn't necessarily. If you want to discuss detail, feel free to open an issue, we could discuss there and move it to FAQ in case others want to know too. |
kezhenxu94
left a comment
There was a problem hiding this comment.
Just for reminder, it seems that there are pairs of async and sync methods in Cassandra, so please consider both of them when you intercept methods (consider whether they have async counterparts or not).
To name a few:
com.datastax.driver.core.Cluster#connect()vscom.datastax.driver.core.Cluster#connectAsync()com.datastax.driver.core.SessionManager#executevscom.datastax.driver.core.SessionManager#executeAsync
P.S. seems that the sync version simply calls the async version and wait for the result, so it should be able to just intercept the async version, maybe I'm wrong? Just a hint :)
| @Override | ||
| public ElementMatcher<MethodDescription> getMethodsMatcher() { | ||
| return named("execute").and(takesArgumentWithType(0, "com.datastax.driver.core.Statement")) | ||
| .or(named("executeAsync").and(takesArgumentWithType(0, "com.datastax.driver.core.Statement"))); |
There was a problem hiding this comment.
executeAsync calls execute at the bottom, so you should be able to only intercept execute (minor issue)
There was a problem hiding this comment.
i think the key is the or method. Does it intercept both execute and executeAsync methods, or only intercept execute methods. right ?
but my test result is both.
...che/skywalking/apm/plugin/cassandra/java/driver/v3/define/SessionManagerInstrumentation.java
Show resolved
Hide resolved
...org/apache/skywalking/apm/plugin/cassandra/java/driver/v3/define/ClusterInstrumentation.java
Show resolved
Hide resolved
exactly. sync version call async version and wait for results.
|
Depend on what kind of codes you are written, basically, override happens. If
If you only did this, you could just don't separate the |
|
@stone-wlg Your comment format is not clear. Could you reformat it? |
OK |
|
You need to update this PR and test cases. |
Ok, Done |
|
I think the plugins supporting more versions, right? Just in test case, we plan to merge one version. @zhaoyuguang run tests again. @kezhenxu94 recheck please. |
yes, i have tested 4 versions, all of them are passed on my pc. |
|
I had triggered the auto tests, let's wait for the result |
|
Here is the test report and validate logs |
|
@stone-wlg Welcome to be 156th contributor. Look forward to more contributions from you. |
| * [Solr](https://github.com/apache/lucene-solr/) | ||
| * [SolrJ](https://github.com/apache/lucene-solr/tree/master/solr/solrj) 7.x | ||
| * [Cassandra](https://github.com/apache/cassandra) 3.x | ||
| * [cassandra-java-driver](https://github.com/datastax/java-driver) 3.7.2 |
There was a problem hiding this comment.
One nit, we should list all you tested version, don't need to leave 3.7.2 due to test issue.
Thanks, 156 is a good number for me |
|
/run e2e |
|
/run ci |
|
/run e2e |
|
@stone-wlg The twitter belongs to you, https://twitter.com/ASFSkyWalking/status/1172288313559928832 |
Cool, thanks. Happy Mid-Autumn Festival |


Please answer these questions before submitting pull request
_
New feature or improvement