Gatling integration with Graphite not working

I am using Gatling 2.0.0-M3a via the gatling-maven-plugin-demo on Windows7. I can run a simulation successfully, however no metrics get recorded in graphite.

I have enabled the graphite writer in src/test/resources/gatling.conf:

data {
writers = “console, file, graphite”
#reader = file
console{
light = false
}
}
graphite {
#light = false
host = “myhost.net
port = 4242
protocol = “tcp” # Choose between ‘tcp’ or ‘udp’
rootPathPrefix = “gatling”
bucketWidth = 100
}

I have used ncat to manually load metrics into graphite at the same url and port to verify the Graphite server is working:

echo “foo 123 $(date +%s)” | /c/apps/ncat myhost.net 4242

I tried using ncat to listen for Gatling GraphiteDatatWriter output on my localhost. This should print to console whatever Gatling sends over TCP. I get nothing:

/c/apps/ncat -l 10.6.67.120 4242

I have run in debug mode and see the GraphiteDataWriter logging:

22:31:06.785 [INFO ] i.g.m.GraphiteDataWriter - Initializing
22:31:06.788 [INFO ] i.g.m.GraphiteDataWriter - Going on with initialization after Terminator registration
22:31:06.794 [INFO ] i.g.m.GraphiteDataWriter - Initialized
22:31:07.165 [INFO ] i.g.c.r.t.Terminator - Asking DataWriters to flush

The maven command finishes successfully, no errors are generated.

Any help would be greatly appreciated! I am completely stumped.

You’re covering the issue pretty well, hard to suggest you anything.
Still, would you be able to try with something like :

echo “gatling.foo 123 $(date +%s)” | /c/apps/ncat myhost.net 4242

Just in case there is an issue in your aggregation definitions with the gatling prefix.

Also, which version are you using?

Cheers
nicolas

Sorry, you said the version.

Would you be able to give a try to the last Snapshot version? I did some changes recently regarding this part.

I tired echo “gatling.foo 123 $(date +%s)” | /c/apps/ncat myhost.net 4242. That worked fine. I will give it a shot with lst snapshot today.

So there is hope, great!

I was able to test with 2.0.0-SNAPSHOT. I can confirm that 2.0.0-SNAPSOT publishes Graphite metrics, 2.0.0.-M3a does NOT publish Graphite metrics and in fact fails with a java.langExceptionInInitializerError. I did the test with downloaded bundles (not the gatling-maven-plugin-demo i used before).

Stack trace from 2.0.0-M3a:

Uncaught error from thread [GatlingSystem-akka.actor.default-dispatcher-2] shutting down JVM since ‘akka.jvm-exit-on-fatal-error’ is enabled for ActorSystem[GatlingSystem]
java.lang.ExceptionInInitializerError
at io.gatling.core.runner.Runner$$anonfun$3.apply(Runner.scala:59)
at io.gatling.core.runner.Runner$$anonfun$3.apply(Runner.scala:59)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:278)
at scala.concurrent.Future$$anonfun$flatMap$1.apply(Future.scala:274)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:29)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.processBatch$1(BatchingExecutor.scala:67)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:82)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
at akka.dispatch.BatchingExecutor$Batch$$anonfun$run$1.apply(BatchingExecutor.scala:59)
at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
at akka.dispatch.BatchingExecutor$Batch.run(BatchingExecutor.scala:58)
at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:137)
at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
Caused by: java.lang.ClassNotFoundException: gatling
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at io.gatling.core.result.writer.DataWriter$$anonfun$1.apply(DataWriter.scala:31)
at io.gatling.core.result.writer.DataWriter$$anonfun$1.apply(DataWriter.scala:30)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
at scala.collection.mutable.ArraySeq.foreach(ArraySeq.scala:73)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
at scala.collection.AbstractTraversable.map(Traversable.scala:105)
at io.gatling.core.result.writer.DataWriter$.(DataWriter.scala:30)
at io.gatling.core.result.writer.DataWriter$.(DataWriter.scala)

Well this is embarrassing…I had a typo in my gatling.conf. The error in my last post was me trying to add a data writer named ‘gatling’ instead of ‘graphite’.

I have both 2.0.0-M3a and 2.0.0-SNAPSHOT publishing graphite metrics. The only test left for me is to use the maven plugin to run the simulation. I will post the results of that shortly.

I was able to send graphite metrics using the maven plugin with a 2.0.0-M3a project as well. I did all this testing with the Maven archetype. I had originally used the ‘gatling-maven-plugin-demo’. I did not go back and try to get things working with the demo.
Sorry for setting off the alarm bells. I am all good now. Thanks for the quick response.

Great!
That’s a relief because we had no idea about want wouldn’t work.

Really odd, must have been ‘network’ errors. I refuse to accept it was operator error . Thanks alot for a great tool. Gatling makes me look like a genius!

Well, at some point, every bug is caused by something between the keyboard and the chair. The game is to find out whose chair… :wink:

Haha. Well spoken!