<?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 REST API for Stream Monitoring in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13415#M8106</link>
    <description>&lt;P&gt;Hi, everyone. I just recently started using Databricks on Azure so my question is probably very basic but I am really stuck right now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to capture some streaming metrics (&lt;I&gt;number of input rows and their time&lt;/I&gt;)  so I tried using the Spark Rest Api , however I get the following error: "&lt;I&gt;&lt;U&gt;no streaming listener attached to Databricks Shell&lt;/U&gt;&lt;/I&gt;". I tried different solutions I have seen in videos or tutorials but none have worked so far (this only happens when I try to get the stream statistics, if I use the API for jobs or stages, I get the json as expected). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code I am trying to run:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import requests
import json
&amp;nbsp;
driverIp = spark.conf.get('spark.driver.host')
port = spark.conf.get("spark.ui.port")
temp_url = F"http://{driverIp}:{port}/api/v1/applications"
temp_r = request.get(temp_url, timeout=10.0)
content_r = json.load(temp_r.content)
app_id = content_r[0][ïd"]
&amp;nbsp;
url = F"http://{driverIp}:{port}/api/v1/applications/{app_id}/streaming/statistics"
r = requests.get(url)
print(r.content)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I understand that I should attach the streaming listener in order to get the metrics I need but I still did not understand how to implement it in the code. Could someone please help me on this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance&lt;/P&gt;</description>
    <pubDate>Thu, 14 Oct 2021 13:42:04 GMT</pubDate>
    <dc:creator>Baldrez</dc:creator>
    <dc:date>2021-10-14T13:42:04Z</dc:date>
    <item>
      <title>REST API for Stream Monitoring</title>
      <link>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13415#M8106</link>
      <description>&lt;P&gt;Hi, everyone. I just recently started using Databricks on Azure so my question is probably very basic but I am really stuck right now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to capture some streaming metrics (&lt;I&gt;number of input rows and their time&lt;/I&gt;)  so I tried using the Spark Rest Api , however I get the following error: "&lt;I&gt;&lt;U&gt;no streaming listener attached to Databricks Shell&lt;/U&gt;&lt;/I&gt;". I tried different solutions I have seen in videos or tutorials but none have worked so far (this only happens when I try to get the stream statistics, if I use the API for jobs or stages, I get the json as expected). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code I am trying to run:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import requests
import json
&amp;nbsp;
driverIp = spark.conf.get('spark.driver.host')
port = spark.conf.get("spark.ui.port")
temp_url = F"http://{driverIp}:{port}/api/v1/applications"
temp_r = request.get(temp_url, timeout=10.0)
content_r = json.load(temp_r.content)
app_id = content_r[0][ïd"]
&amp;nbsp;
url = F"http://{driverIp}:{port}/api/v1/applications/{app_id}/streaming/statistics"
r = requests.get(url)
print(r.content)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I understand that I should attach the streaming listener in order to get the metrics I need but I still did not understand how to implement it in the code. Could someone please help me on this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot in advance&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 13:42:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13415#M8106</guid>
      <dc:creator>Baldrez</dc:creator>
      <dc:date>2021-10-14T13:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: REST API for Stream Monitoring</title>
      <link>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13416#M8107</link>
      <description>&lt;P&gt;Hi @Roberto Baldrez​&amp;nbsp;- My name is Piper and I'm one of the community moderators. Thanks for your question. Let's give it a bit to see what the community says. Thank you for your patience. &lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 16:28:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13416#M8107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-10-15T16:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: REST API for Stream Monitoring</title>
      <link>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13417#M8108</link>
      <description>&lt;P&gt;Hi @Roberto Baldrez​&amp;nbsp;, you will need to add the below configs to the cluster &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.sql.streaming.metricsEnabled true
*.sink.servlet.class org.apache.spark.metrics.sink.MetricsServlet
*.sink.servlet.path /metrics/json
master.sink.servlet.path /metrics/master/json
applications.sink.servlet.path /metrics/applications/json&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;URL will change to  "http://&amp;lt;driverIP&amp;gt;:&amp;lt;port&amp;gt;/metrics/json/" the one you mentioned is for DStream application&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;note:&lt;/B&gt; This gives limited streaming metrics. If you need all metrics you will need to add metrics sink to the cluster. &lt;/P&gt;&lt;P&gt;&lt;B&gt;More info &lt;/B&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html#reporting-metrics-programmatically-using-asynchronous-apis" alt="https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html#reporting-metrics-programmatically-using-asynchronous-apis" target="_blank"&gt;https://spark.apache.org/docs/latest/structured-streaming-programming-guide.html#reporting-metrics-programmatically-using-asynchronous-apis&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://spark.apache.org/docs/latest/monitoring.html#metrics" alt="https://spark.apache.org/docs/latest/monitoring.html#metrics" target="_blank"&gt;https://spark.apache.org/docs/latest/monitoring.html#metrics&lt;/A&gt;&lt;/LI&gt;&lt;LI&gt;&lt;A href="https://www.datadoghq.com/blog/databricks-monitoring-datadog/" target="test_blank"&gt;https://www.datadoghq.com/blog/databricks-monitoring-datadog/&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 20 Oct 2021 23:23:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13417#M8108</guid>
      <dc:creator>User16763506477</dc:creator>
      <dc:date>2021-10-20T23:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: REST API for Stream Monitoring</title>
      <link>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13418#M8109</link>
      <description>&lt;P&gt;hi @Roberto Baldrez​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you think that @Gaurav Rupnar​&amp;nbsp;solved your question, then please select it as best response to it can be moved to the top of the topic and it will help more users in the future.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 23:55:31 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/13418#M8109</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2021-10-26T23:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: REST API for Stream Monitoring</title>
      <link>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/61381#M31777</link>
      <description>&lt;P&gt;Could you please tell us where is the&amp;nbsp;&lt;SPAN&gt;configs to the cluster? I cannot find it. Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2024 17:08:22 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/rest-api-for-stream-monitoring/m-p/61381#M31777</guid>
      <dc:creator>lixing</dc:creator>
      <dc:date>2024-02-21T17:08:22Z</dc:date>
    </item>
  </channel>
</rss>

