-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Neo4j plugin #942
Comments
Hi,
again, thanks for your contribution and let us know how we can assist. |
It turns out there's a new series of drivers with a different API that my instrumentation probably won't work with.
As far as I can tell the API is fairly different. The class I'm instrumenting for 1.x doesn't exist anymore in 4.0, does that mean that the current instrumentation is safe? I don't plan on instrumenting the new driver immediately as we are not using it right now, but to be safe I'll work on it sooner or later. How do plugin maintainers manage multiple incompatible API versions? |
It depends on how different the APIs are: If classes are completely unrelated, for example in different packages, then nothing is required, newer versions will just be ignored as they do not match instrumentation plugin. If classes are reusing old version API, which is frequent just to ensure easier migration, that's trickier. I'm not really familliar with neo4j driver, do you have any hints at what are the major API changes between those versions ? Also, if I understand correctly, what you worry about is having an unexpected instrumentation with the newer driver. If that's the case, there is quick and cheap test that you can do: just start a simple application that uses this driver and check agent debug logs for any instrumented class. |
Yes, that seems to be the case.
Here's the changelog; mostly of interest for future users reading this issue, since it is not very specific as to the API changes. https://github.com/neo4j/neo4j-java-driver/wiki/4.0-changelog The 1.x is bound to have active users for a good while so I guess this PR will not be completely useless. I may work on supporting the new driver if we upgrade some applications once it's officially released.
I'll do that, thanks for the tip. |
@lreuven I'm not sure what you mean here:
I took a look at these tests, they seem to handle more complex cases like runtime environments (Tomcat, Jetty etc.). I'm only instrumenting a new datastore, so I wrote some tests that stand up a database instance using testcontainers, ran some typical queries and checked that spans were being created. Do you think additional tests are required? |
That is sufficient, no need to extend the integration tests unless there's no way to test via unit tests by extending |
We use Neo4j for some use cases at work and adding basic support for tracing Cypher queries would help us debug performance issues in the services that use them.
A Neo4j plugin for tracing queries made through
org.neo4j.driver:neo4j-java-driver
seems like it wouldn't be out of scope for this project. As far as I can tell, most options for communicating with a Neo4j server use this driver behind the scenes (our spring-data repository certainly does, out of the box anyway).I have done some preliminary work on this and I got a plugin to work with our APM (7.4). I can see the traces correctly reported with some metadata attached.
I'm willing to submit a PR (though the code still needs some work) and I have also gotten a verbal agreement from my CTO regarding the CLA. Is this something that would be of interest to you?
The text was updated successfully, but these errors were encountered: