Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
Showing results for 
Search instead for 
Did you mean: 

Error: no streaming listener attached to the spark app is the error we are observing post accessing streaming statistics API. Please help us with this issue ASAP. Thanks.

New Contributor III

Issue: Spark structured streaming application

After adding the listener jar file in the cluster init script, the listener is working (From what I see in the stdout/log4j logs)

But when I try to hit the

'Content-Type: application/json' http://host:port/api/v1/applications/app-id/streaming/statistics end point

It is showing no streaming listener attached to spark application


We have created a jar file with the class file containing below code and have made it available to cluster using below shell script

Shell script:


cp /dbfs/FileStore/jars/my_jar.jar /databricks/jars

mySparkListener class:

import org.apache.spark.sql.streaming.StreamingQueryListener

import org.apache.spark.sql.streaming.StreamingQueryListener._

import org.apache.spark.sql.streaming.StreamingQueryProgress

import org.apache.log4j.Logger

import org.joda.time.DateTime

import scala.collection.JavaConverters._

class mySparkListener extends StreamingQueryListener {

 override def onQueryStarted(queryStarted: QueryStartedEvent): Unit = {

   println("Query started: " +


 override def onQueryTerminated(queryTerminated: QueryTerminatedEvent): Unit = {

   println("Query terminated: " +


 override def onQueryProgress(queryProgress: QueryProgressEvent): Unit = {

   println("Query made progress: " + queryProgress.progress)




val listener = new mySparkListener()


 Note: I have already added following configs to the cluster

  1. spark.sql.streaming.metricsEnabled true
  2. *.sink.servlet.class org.apache.spark.metrics.sink.MetricsServlet
  3. *.sink.servlet.path /metrics/json
  4. master.sink.servlet.path /metrics/master/json
  5. applications.sink.servlet.path /metrics/applications/json


Community Manager
Community Manager

Hi @swetha (Customer)​, Please check this S.O thread. It may give you a few insights. Let us know if that helps.

New Contributor III

Hi @Kaniz Fatma​ , Thanks for the reply, mine is a spark structured streaming application, I am not able to access via that endpoint, do we have separate API'S to monitor a spark structured streaming application

I would like to share the following docs please let us know if it helps or not

Honored Contributor

Hi @swetha kadiyala​ 

Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help. 

We'd love to hear from you.


Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!