<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Dinesh on Medium]]></title>
        <description><![CDATA[Stories by Dinesh on Medium]]></description>
        <link>https://medium.com/@d_inesh?source=rss-f05f3601f374------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*5Sp4viCObfR-oiWY</url>
            <title>Stories by Dinesh on Medium</title>
            <link>https://medium.com/@d_inesh?source=rss-f05f3601f374------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 10:44:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@d_inesh/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Digging into the Snowflake OpenFlow Telemetry/Event table for Data Provenance]]></title>
            <link>https://medium.com/@d_inesh/digging-into-the-snowflake-openflow-telemetry-event-table-for-data-provenance-01e6b3eb4f9f?source=rss-f05f3601f374------2</link>
            <guid isPermaLink="false">https://medium.com/p/01e6b3eb4f9f</guid>
            <category><![CDATA[snowflake-openflow]]></category>
            <category><![CDATA[data-provenance]]></category>
            <category><![CDATA[apache-nifi]]></category>
            <category><![CDATA[events]]></category>
            <category><![CDATA[logging]]></category>
            <dc:creator><![CDATA[Dinesh]]></dc:creator>
            <pubDate>Fri, 08 Aug 2025 11:07:37 GMT</pubDate>
            <atom:updated>2025-08-08T11:07:37.885Z</atom:updated>
            <content:encoded><![CDATA[<p>Snowflake OpenFlow is an integration service and is designed to move data efficiently and reliably from point A to point B, capable of connecting to any source and destination while offering a wide range of connectors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/596/1*svpL1s2aP7cWBvVFuQsl8w.png" /></figure><p>OpenFlow is Snowflake’s hosted version of Apache NiFi. The Apache NiFi is an open-source project that’s been around for years and serves as a universal data distribution system, capable of moving data across diverse sources and destinations with ease. Snowflake hosting the OpenFlow, it provides enterprise-grade security and governance, Snowflake native connectors for seamless application Integration to handle change data and schema changes, and is turbocharged for AI with native connectivity to handle multi-model data processing.</p><p>As of today, Snowflake OpenFlow can be hosted only in AWS Commercial Regions and in the BYOC(Bring Your Own Cloud) deployment model. Deployment with other cloud providers and Snowflake-managed deployment options are not available yet.</p><p>As part of the Snowflake OpenFlow BYOC setup, Snowflake provides the YAML, which has to be used in an AWS CloudFormation template that creates the necessary resources for the OpenFlow, such as EKS Cluster, EC2 Instances, VPC, etc. Check more in the Snowflake Official Documentation on the setup — <a href="https://docs.snowflake.com/en/user-guide/data-integration/openflow/setup-openflow">https://docs.snowflake.com/en/user-guide/data-integration/openflow/setup-openflow</a></p><p><strong>Apache NiFi/Snowflake OpenFlow Logging Mechanism</strong></p><p>Apache NiFi generally writes logs in the nifi-app file.</p><p>As part of the Snowflake OpenFlow setup, we set up the Telemetry table at the account level or an Event Table for the OpenFlow logs. So, instead of the nifi-app log file, here the logs are captured in the telemetry/event table.</p><p>The use case I have now is to match the Data Provenance that I see in the OpenFlow UI with the data that is populated in the telemetry/event table.</p><p><strong>So, what is Data Provenance?</strong></p><p>Data Provenance is the built-in feature that lets us see the history of each piece of data (called a FlowFile) as it moves through your NiFi flow.</p><p>Let us take this simple process flow in OpenFlow. As part of this process flow, we list and fetch the files from an S3 bucket and move them to another S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*f8JQCr7OVDzQqz7xg_bUUQ.png" /></figure><p>When the complete flow is run once, we can see the lineage in Data Provenance for a flow file 4b6b7f0f-a395–4c9f-98e3–56278da0eb9a.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*P1moQBfgi2ky5wj_I7_M7A.png" /></figure><p>Here we can see where the flow file was created and how it flowed during different processes.</p><p>OpenFlow writes the logs to the telemetry/event table in Snowflake that has been configured during the OpenFlow setup. We can use the table to fetch the Data Provenance data that we see in the UI of OpenFlow. The SQL query is provided at the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hbWFxGZGBG46CmKVljoXiA.png" /></figure><p>The results matched the UI view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yv_V8bzvWYgF1eD9FxNziw.png" /></figure><p>Even though I was able to match the Data Provenance data between the UI and Event table, there are a few things that I noticed during the process that have to be considered.</p><p><strong>Observations &amp; Caveats</strong></p><p>In the OpenFlow Telemetry/Event Table,</p><ul><li>The same record is repeated multiple times; this can be ignored as it is part of the OpenFlow logging mechanism.</li><li>For each event, notice the Event Time and the timestamp. Timestamp denotes the time when the record was loaded into the OpenFlow log table in Snowflake. Some records loaded after 10 minutes from the Event Time, some around 30 minutes, and some around 12+ hours.</li><li>The loading of the provenance data into the OpenFlow logging area is still a grey area, which needs more analysis</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*aeLeXCgx1Q1mKdqsYLhQWg.png" /></figure><ul><li>One row in the OpenFlow log might have multiple event type records belonging to different flow IDs. Based on the number of events in a row, a dynamic query should be built to handle the multiple events in a single row.</li><li>For the time being, the current query provided at the end of the document is formed to handle a single FlowFile of data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*7lHq3Fqt00cvUVzxOq06eQ.png" /></figure><ul><li>For multiple events belonging to the same processor, they will have the same timestamp. To preserve the order, it should be displayed in the order in which it is inserted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*h2s3iTtUugqKaeSWn77xmw.png" /></figure><p><strong>SQL Query to check the Data Provenance:</strong></p><pre>with event_level_1 as <br>(<br>  select  distinct<br>      try_parse_json(value):formattedMessage as formatted_msg,<br>      REGEXP_SUBSTR(formatted_msg, &#39;eventId=([a-zA-Z0-9\-]+)&#39;, 1, 1, &#39;e&#39;, 1) AS eventId,<br>      REGEXP_SUBSTR(formatted_msg, &#39;eventType=([A-Z_]+)&#39;, 1, 1, &#39;e&#39;, 1) AS eventType,<br>      TO_TIMESTAMP_NTZ(REGEXP_SUBSTR(formatted_msg, &#39;eventTime=([A-Za-z]{3} [A-Za-z]{3} [0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} GMT [0-9]{4})&#39;, 1, 1, &#39;e&#39;, 1),&#39;DY MON DD HH24:MI:SS &quot;GMT&quot; YYYY&#39;) AS eventTime,<br>    REGEXP_SUBSTR(formatted_msg, &#39;uuid=([a-z0-9\\-]+)&#39;, 1, 1, &#39;e&#39;, 1) AS uuid,<br>    REGEXP_SUBSTR(formatted_msg, &#39;componentId=([a-z0-9\\-]+)&#39;, 1, 1, &#39;e&#39;, 1) AS componentId<br>  from  <br>      OPENFLOW.OPENFLOW.OPENFLOW_EVENTS  <br>  where <br>          timestamp &gt;= &#39;2025-07-07 04:16:33.298&#39; <br>    and<br>          try_parse_json(value):loggerName::VARCHAR  in <br>          (<br>          &#39;org.apache.nifi.provenance.index.lucene.IndexDirectoryManager&#39;,<br>          &#39;org.apache.nifi.web.api.ProvenanceEventResource&#39;,<br>          &#39;org.apache.nifi.provenance.index.lucene.LuceneEventIndex&#39;,<br>          &#39;org.apache.nifi.provenance.serialization.CompressableRecordReader&#39;,<br>          &#39;org.apache.nifi.provenance.lucene.StandardIndexManager&#39;<br>          ) <br>      and <br>          value ilike &#39;%4b6b7f0f-a395-4c9f-98e3-56278da0eb9a%&#39; --Flow File id<br> ),<br><br> event_level_2 as <br> (<br>  select  distinct<br>      try_parse_json(value):formattedMessage as formatted_msg,<br>      REGEXP_SUBSTR(formatted_msg, &#39;eventId=([a-zA-Z0-9\-]+)&#39;, 1, 2, &#39;e&#39;, 1) AS eventId,<br>      REGEXP_SUBSTR(formatted_msg, &#39;eventType=([A-Z_]+)&#39;, 1, 2, &#39;e&#39;, 1) AS eventType,<br>      TO_TIMESTAMP_NTZ(REGEXP_SUBSTR(formatted_msg, &#39;eventTime=([A-Za-z]{3} [A-Za-z]{3} [0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2} GMT [0-9]{4})&#39;,  1, 2, &#39;e&#39;, 1),&#39;DY MON DD HH24:MI:SS &quot;GMT&quot; YYYY&#39;) AS eventTime,<br>      REGEXP_SUBSTR(formatted_msg, &#39;uuid=([a-z0-9\\-]+)&#39;, 1, 2, &#39;e&#39;, 1) AS uuid,<br>      REGEXP_SUBSTR(formatted_msg, &#39;componentId=([a-z0-9\\-]+)&#39;, 1, 2, &#39;e&#39;, 1) AS componentId<br>  from  <br>      OPENFLOW.OPENFLOW.OPENFLOW_EVENTS  <br>  where <br>          timestamp &gt;= &#39;2025-07-07 04:16:33.298&#39; <br>     and<br>          try_parse_json(value):loggerName::VARCHAR  in <br>           (<br>          &#39;org.apache.nifi.provenance.index.lucene.IndexDirectoryManager&#39;,<br>          &#39;org.apache.nifi.web.api.ProvenanceEventResource&#39;,<br>          &#39;org.apache.nifi.provenance.index.lucene.LuceneEventIndex&#39;,<br>          &#39;org.apache.nifi.provenance.serialization.CompressableRecordReader&#39;,<br>          &#39;org.apache.nifi.provenance.lucene.StandardIndexManager&#39;<br>          ) <br>      and <br>          value ilike &#39;%4b6b7f0f-a395-4c9f-98e3-56278da0eb9a%&#39;  --Flow File id<br> ),<br> <br> event_union as (<br>  select * exclude  formatted_msg from event_level_2<br>  union<br>  select * exclude formatted_msg from event_level_1<br><br>)<br><br> select * from event_union  order by eventTime;<br><br></pre><p>I managed to match the results, but the flow of Data Provenance records to the Telemetry/Event table isn’t real-time, and its frequency remains unclear. That wraps up the digging for this blog.</p><p>NiFi and Snowflake OpenFlow are both unfamiliar territories for me, but they’ve already sparked my curiosity about how they work and the kinds of challenges they can tackle. I’m excited to dive deeper, experiment, and see what else they have up their sleeve. NiFi/OpenFlow experts — I’d love to hear your thoughts in the comments! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=01e6b3eb4f9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>