Acceldata
Pulse

Last updated: Dec 01, 2026 22:43 IST

Configure ODP Spark

This page helps you enable Spark metrics via the Graphite sink, allowing Pulse to capture Spark application and JVM metrics.


Configure Spark Metrics Sink

In the Ambari UI:

  1. Navigate to Spark > Configs > Advanced spark2-metrics-properties.
  2. Update the following parameters:
# Graphite sink class
*.sink.graphite.class=org.apache.spark.metrics.sink.GraphiteSink
# Location of your graphite instance
*.sink.graphite.host=localhost
*.sink.graphite.port=12003
*.sink.graphite.protocol=tcp
*.sink.graphite.prefix=spark.metrics
*.sink.graphite.period=20
master.source.jvm.class=org.apache.spark.metrics.source.JvmSource
worker.source.jvm.class=org.apache.spark.metrics.source.JvmSource
driver.source.jvm.class=org.apache.spark.metrics.source.JvmSource
executor.source.jvm.class=org.apache.spark.metrics.source.JvmSource

Steps for Spark Hook Update

  1. In the Ambari UI, navigate to Spark > Configs > Custom spark-defaults.
  2. Add or update the following properties:
"spark.ad.nats.server.host.list": "<Nats url>:4222",

 "spark.ad.monitor": "spark",
 "spark.ad.cluster": "<cluster>",
 "spark.ad.streaming.url": "http://<ad-streaming>:19005/events",
 "spark.extraListeners": "io.acceldata.spark.AdSparkListener",

"spark.ad.nats.connection.timeout.sec":2

"spark.ad.nats.circuit.max.failures":3
"spark.ad.nats.circuit.cooldown.min":5
"spark.ad.nats.max.messages":5000000
 "spark.metrics.conf.*.sink.graphite.class": "org.apache.spark.metrics.sink.GraphiteSink",

 "spark.metrics.conf.*.sink.graphite.host": "<pulsenode>",
 "spark.metrics.conf.*.sink.graphite.period": 1,
 "spark.metrics.conf.*.sink.graphite.port": 12003,
 "spark.metrics.conf.*.sink.graphite.prefix": "spark.metrics",
 "spark.metrics.conf.*.sink.graphite.protocol": "tcp",
 "spark.metrics.conf.driver.source.jvm.class": "org.apache.spark.metrics.source.JvmSource",
 "spark.metrics.conf.executor.source.jvm.class": "org.apache.spark.metrics.source.JvmSource",
 "spark.metrics.conf.master.source.jvm.class": "org.apache.spark.metrics.source.JvmSource",
 "spark.metrics.conf.worker.source.jvm.class": "org.apache.spark.metrics.source.JvmSource"

  1. Save the configuration changes.
  2. Remove the existing Spark hook JARs from the $SPARK_HOME/jars directory on all Spark client nodes.
  3. Copy the compatible Spark hook JARs (For example, version 2.1.2) to the $SPARK_HOME/jars directory on all Spark client nodes. For the supported hook version on each Pulse release, see Pulse Compatible Matrix.
  4. Restart the affected Spark services.
  5. Submit a test Spark job and verify that Spark events and metrics are successfully reported to Pulse.

Result

  • Spark sends metrics (including JVM metrics) to Graphite for Pulse ingestion.