title: Spark streaming custom metrics
body: <p>I'm working on a Spark Streaming program which retrieves a Kafka stream, does very basic transformation on the stream and then inserts the data to a DB (voltdb if it's relevant).
  I'm trying to measure the rate in which I insert rows to the DB. I think <a href="http://metrics.dropwizard.io/3.1.0/manual/" rel="noreferrer">metrics</a> can be useful (using JMX). However I can't find how to add custom metrics to Spark. I've looked at Spark's source code and also found <a href="http://apache-spark-developers-list.1001551.n3.nabble.com/Registering-custom-metrics-td9030.html#a9968" rel="noreferrer">this thread</a> however it doesn't work for me. I also enabled the JMX sink in the conf.metrics file. What's not working is I don't see my custom metrics with JConsole.</p>
  
  <p>Could someone explain how to add custom metrics (preferably via JMX) to spark streaming? Or alternatively how to measure my insertion rate to my DB (specifically VoltDB)?
  I'm using spark with Java 8.</p>