This is a MongoDB plugin for Spring Insight
Spring Insight runs in the SpringSource tc Server. See http://www.springsource.org/insight for details. This plugin adds instrumentation to for web applications that use MongoDB (http://www.mongodb.org) through the MongoDB Java driver, which typically works outside the normal ORM flow.
What does it do?
It instruments calls to MongoDB from the Java driver. Typical calls on the DBCollection class are traced, as are the DB.command() calls that are not covered by these.
Some attempt is made to decode parameters and return values, although it’s not very good.
Installing the plugin
Pull the code:
git clone git://github.com/NogbadTheBad/insight-plugin-mongodb.git
Now build it:
cd insight-plugin-mongodb mvn clean package
You’ll need to have tc Server Developer Edition installed. Let’s call the location of that
Now copy the plugin jar to the right place under
cp target/insight-plugin-mongodb-x.x.jar tcServer/spring-insight-instance/insight/collection-plugins
Running the plugin
- Start up Spring Insight Server as usual (see the Spring tc Server Developer Edition documentation) and make sure your WAR file is loaded. Start your application and make sure it’s running.
- Browse to http://localhost:8080/insight to see the Spring Insight dashboard. Click on the Administration button and then Collection Plug-ins under Reports and Statistics.
- If you can see the mongodb plugin it’s installed and running.
- Run through your application in a way you’re sure exercises MongoDB. Then go back to the Spring Insight dashboard to see the traces.
Have fun! And let me know what doesn’t work well.
- Morphia support
- Argument decoding is weak
- The collection name is not available from DBCursor, so we can’t see which collection we’re calling next() on.
Stephen Harrison (stephen [at] harrison [dot] org)