<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic 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. in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33079#M24166</link>
    <description>&lt;P&gt;&lt;B&gt;Issue&lt;/B&gt;:&lt;B&gt; Spark structured streaming application&lt;/B&gt;&lt;/P&gt;&lt;P&gt;After adding the listener jar file in the cluster init script, the listener is working (From what I see in the stdout/log4j logs)&lt;/P&gt;&lt;P&gt;But when I try to hit the &lt;/P&gt;&lt;P&gt;'Content-Type: application/json' &lt;A href="http://host:port/api/v1/applications/app-id/streaming/statistics" alt="http://host:port/api/v1/applications/app-id/streaming/statistics" target="_blank"&gt;http://host:port/api/v1/applications/app-id/streaming/statistics&lt;/A&gt; end point&lt;/P&gt;&lt;P&gt;It is showing&lt;B&gt; no streaming listener attached to spark application&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Details:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;We have created a jar file with the class file containing below code and have made it available to cluster using below shell script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Shell script:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;P&gt;cp /dbfs/FileStore/jars/my_jar.jar /databricks/jars&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;mySparkListener class:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryListener&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryListener._&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryProgress&lt;/P&gt;&lt;P&gt;import org.apache.log4j.Logger&lt;/P&gt;&lt;P&gt;import org.joda.time.DateTime&lt;/P&gt;&lt;P&gt;import scala.collection.JavaConverters._&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class mySparkListener extends StreamingQueryListener {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryStarted(queryStarted: QueryStartedEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query started: " + &lt;A href="https://queryStarted.id" alt="https://queryStarted.id" target="_blank"&gt;queryStarted.id&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryTerminated(queryTerminated: QueryTerminatedEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query terminated: " + &lt;A href="https://queryTerminated.id" alt="https://queryTerminated.id" target="_blank"&gt;queryTerminated.id&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryProgress(queryProgress: QueryProgressEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query made progress: " + queryProgress.progress)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val listener = new&amp;nbsp;mySparkListener()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;spark.streams.addListener(listener)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Note: I have already added following configs to the cluster&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;spark.sql.streaming.metricsEnabled true&lt;/LI&gt;&lt;LI&gt;*.sink.servlet.class org.apache.spark.metrics.sink.MetricsServlet&lt;/LI&gt;&lt;LI&gt;*.sink.servlet.path /metrics/json&lt;/LI&gt;&lt;LI&gt;master.sink.servlet.path /metrics/master/json&lt;/LI&gt;&lt;LI&gt;applications.sink.servlet.path /metrics/applications/json&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Aug 2022 17:24:49 GMT</pubDate>
    <dc:creator>swetha</dc:creator>
    <dc:date>2022-08-30T17:24:49Z</dc:date>
    <item>
      <title>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.</title>
      <link>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33079#M24166</link>
      <description>&lt;P&gt;&lt;B&gt;Issue&lt;/B&gt;:&lt;B&gt; Spark structured streaming application&lt;/B&gt;&lt;/P&gt;&lt;P&gt;After adding the listener jar file in the cluster init script, the listener is working (From what I see in the stdout/log4j logs)&lt;/P&gt;&lt;P&gt;But when I try to hit the &lt;/P&gt;&lt;P&gt;'Content-Type: application/json' &lt;A href="http://host:port/api/v1/applications/app-id/streaming/statistics" alt="http://host:port/api/v1/applications/app-id/streaming/statistics" target="_blank"&gt;http://host:port/api/v1/applications/app-id/streaming/statistics&lt;/A&gt; end point&lt;/P&gt;&lt;P&gt;It is showing&lt;B&gt; no streaming listener attached to spark application&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Details:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;We have created a jar file with the class file containing below code and have made it available to cluster using below shell script&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Shell script:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;#!/bin/bash&lt;/P&gt;&lt;P&gt;cp /dbfs/FileStore/jars/my_jar.jar /databricks/jars&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;mySparkListener class:&lt;/B&gt;&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryListener&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryListener._&lt;/P&gt;&lt;P&gt;import org.apache.spark.sql.streaming.StreamingQueryProgress&lt;/P&gt;&lt;P&gt;import org.apache.log4j.Logger&lt;/P&gt;&lt;P&gt;import org.joda.time.DateTime&lt;/P&gt;&lt;P&gt;import scala.collection.JavaConverters._&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class mySparkListener extends StreamingQueryListener {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryStarted(queryStarted: QueryStartedEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query started: " + &lt;A href="https://queryStarted.id" alt="https://queryStarted.id" target="_blank"&gt;queryStarted.id&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryTerminated(queryTerminated: QueryTerminatedEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query terminated: " + &lt;A href="https://queryTerminated.id" alt="https://queryTerminated.id" target="_blank"&gt;queryTerminated.id&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;override def onQueryProgress(queryProgress: QueryProgressEvent): Unit = {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;println("Query made progress: " + queryProgress.progress)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;val listener = new&amp;nbsp;mySparkListener()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;spark.streams.addListener(listener)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Note: I have already added following configs to the cluster&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;spark.sql.streaming.metricsEnabled true&lt;/LI&gt;&lt;LI&gt;*.sink.servlet.class org.apache.spark.metrics.sink.MetricsServlet&lt;/LI&gt;&lt;LI&gt;*.sink.servlet.path /metrics/json&lt;/LI&gt;&lt;LI&gt;master.sink.servlet.path /metrics/master/json&lt;/LI&gt;&lt;LI&gt;applications.sink.servlet.path /metrics/applications/json&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 17:24:49 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33079#M24166</guid>
      <dc:creator>swetha</dc:creator>
      <dc:date>2022-08-30T17:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: 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.</title>
      <link>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33081#M24168</link>
      <description>&lt;P&gt;Hi @Kaniz Fatma​&amp;nbsp;, 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&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 14:55:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33081#M24168</guid>
      <dc:creator>swetha</dc:creator>
      <dc:date>2022-09-07T14:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: 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.</title>
      <link>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33082#M24169</link>
      <description>&lt;P&gt;I would like to share the following docs &lt;A href="https://docs.databricks.com/structured-streaming/stream-monitoring.html" target="test_blank"&gt;https://docs.databricks.com/structured-streaming/stream-monitoring.html&lt;/A&gt; please let us know if it helps or not&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 23:49:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33082#M24169</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2022-09-09T23:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: 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.</title>
      <link>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33083#M24170</link>
      <description>&lt;P&gt;Hi @swetha kadiyala​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We'd love to hear from you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Sep 2022 07:36:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/33083#M24170</guid>
      <dc:creator>Vidula</dc:creator>
      <dc:date>2022-09-17T07:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error: no streaming listener attached to the  spark app is the error we are observing post acces</title>
      <link>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/99526#M40012</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Have you found the solution? Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 15:07:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/error-no-streaming-listener-attached-to-the-spark-app-is-the/m-p/99526#M40012</guid>
      <dc:creator>INJUSTIC</dc:creator>
      <dc:date>2024-11-20T15:07:25Z</dc:date>
    </item>
  </channel>
</rss>

