CertSafari
    Databricks Certified Data Engineer Professional - October 9 onwards· Lessons

    Domain 4 · Lesson 24/45

    Pipeline event log queries for health and data quality

    Use Pipeline event logs to monitor pipeline health and data quality.

    22 min read
    2% of exam
    5 sources
    Published 22 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Query a pipeline's hidden event log with the event_log() function, and publish it as a named Unity Catalog table so other teams can read it
    • Filter the event log by event_type and parse the details JSON to read update and flow status, throughput and backlog
    • Find a single failing flow by filtering on origin.flow_name and flow_progress status, then reading the error field
    • Read per-expectation passed and failed counts and dropped-record counts from flow_progress events
    • Trace lineage from flow_definition events, and know when the pipeline_events system table is the better source

    Key concept

    Pipeline event log — A Delta table that every pipeline writes to as it runs. Each row is one event, labelled with an event_type and carrying a details JSON payload. Update outcomes, per-flow progress, row counts, expectation results and lineage all come from querying this table by event_type.

    1.What the pipeline event log records

    Each Lakeflow Spark Declarative Pipeline records what it does in its own event log. Pipeline monitoring has three layers. The Jobs & Pipelines list shows the result of the last five runs. The monitoring UI shows the graph, row counts and data quality for the selected update. The event log sits under both, and it is what you query when you need history, trends or anything programmatic. Questions like "which table stopped loading at 3 a.m.?" or "how many rows has this expectation flagged this week?" are answered there.

    The log holds audit records (who started or cancelled an update), data quality results, progress for the update and for each flow, and lineage. You can view the same entries in three places: the pipeline monitoring UI, the Pipelines REST API, or a SQL query against the table. In the UI, when an update has errors, a View logs button opens the event log for that run. Querying the table directly is the skill this lesson builds, because it is the only option that supports joins, aggregates and history.

    Every row has the same top-level columns: id, sequence, origin, timestamp (UTC), message, level, maturity_level, error, details and event_type. Two of these do most of the work. event_type tells you what kind of event the row is. details holds a JSON payload whose shape depends on that type. The origin object tells you where the event came from: pipeline_id, update_id, flow_name, dataset_name and similar.

    Checkpoint 1 of 11· Match them up

    Match each pipeline monitoring layer to what it gives you

    Tap a term, then the definition that fits it.

    Sources12

    2.Reading the hidden log with event_log() and publishing it

    Every pipeline has an event log from its first run. No configuration is needed to start it. A pipeline writes the log to a hidden Delta table in its default catalog and schema, named event_log_{pipeline_id}, with the dashes in the pipeline UUID replaced by underscores. The table is listed in system.information_schema.tables, but Catalog Explorer and other workspace UI pages do not show it. The supported way in is the event_log() table-valued function, called with the pipeline ID from a notebook or SQL editor. Nothing about the pipeline changes and no admin step is needed.

    Reading a pipeline's hidden event log by pipeline IDsql
    SELECT * FROM event_log(<pipelineId>);

    Access is the catch. By default only the pipeline's run-as user can query the hidden table. That is fine for the engineer who owns the pipeline. It does not work for an analytics team that wants to build dashboards with ordinary Unity Catalog permissions. For them, publish the event log. In the pipeline's Advanced settings, give the log a table name and, optionally, a catalog and schema. The log then becomes a named Unity Catalog table that you can grant access to.

    Pipeline settings that publish the event log to a named catalog, schema and tablejson
    {
      "id": "ec2a0ff4-d2a5-4c8c-bf1d-d9f12f10e749",
      "name": "billing_pipeline",
      "event_log": {
        "catalog": "catalog_name",
        "schema": "schema_name",
        "name": "event_log_table_name"
      }
    }

    Before you hand out privileges, put a view over the published table and grant access on the view. If the table itself is shared, some compute settings can let users reach schema metadata. The view avoids that. Views in Unity Catalog also support streaming reads, so spark.readStream.table("event_log_raw") can tail the log continuously. The rest of this lesson queries a view named event_log_raw, defined over either the published table or event_log(<pipelineId>).

    A view over the event log table. The example queries below read from this viewsql
    CREATE VIEW event_log_raw
    AS SELECT * FROM <catalog_name>.<schema_name>.<event_log_table_name>;

    Checkpoint 2 of 11· Check yourself

    An analytics team that is not the pipeline's run-as user wants to build dashboards on a pipeline's event log, using ordinary Unity Catalog permissions. What is the recommended setup?

    Checkpoint 3 of 11· Exam question

    A data engineer wants to inspect the event log of a running Lakeflow Declarative Pipeline directly from a notebook, without changing any pipeline settings or waiting for an admin to configure anything. The pipeline ID is known. Which approach reads the event log data with no configuration change required?

    Checkpoint 4 of 11· Exam question

    A platform team wants analysts outside the pipeline's owning team to build dashboards over event log data using standard SQL permissions in Unity Catalog, without granting them access to the pipeline's internal hidden storage. What should the team configure?

    Sources1

    3.Event types and parsing the details JSON

    Almost every useful query begins with WHERE event_type = '...', because each event type carries a different details shape. details is a JSON string, and you read fields from it with the : operator. For example, details:flow_progress.status returns a flow's status, and details:flow_progress.metrics.num_output_rows returns its output row count. Arrays inside the JSON, such as the expectations list, need from_json with a schema before you can explode them.

    The event types used most for health, data quality and lineage
    event_typeWhat its details object describesTypical use
    create_updateThe complete configuration used to start an updateFind the latest update_id; mark an update's start time
    update_progressThe lifecycle of a whole pipeline update, from starting and running to completed or failedRun history, update duration, final state
    flow_progressThe lifecycle of one flow, from starting and running to completed or failedPer-table status, row counts, backlog, expectation metrics
    flow_definitionThe schema and query plan of a flow; the edges of the dataflow DAGLineage between datasets
    user_actionUser actions such as creating the pipeline or starting or cancelling an updateAuditing who did what
    planning_informationPlanning details for incremental and full refreshes of materialized view and REPLACE WHERE flowsFinding out why a materialized view was fully recomputed
    operation_progressProgress of an operation, including Auto Loader listing and backfillAuto Loader file discovery
    autoscale / cluster_resourcesAutoscaling and cluster resource metrics, populated for classic compute onlySizing pipelines that do not run on serverless

    Two other columns decide how far you can rely on a row. level is INFO, WARN, ERROR or METRICS. METRICS marks high-volume events that are stored only in the Delta table and never shown in the pipelines UI. A METRICS row is a measurement, not a diagnosis, so scanning those rows' free-text message for a table name is a poor way to find a failure. maturity_level says whether an event's schema is STABLE, EVOLVING or DEPRECATED. Build monitoring and alerts only on stable fields, because an evolving schema can change and a deprecated event may stop being produced.

    Checkpoint 5 of 11· Check yourself

    You are building a production alert that fires when any table in a pipeline stops loading. Which event log query design is the sound one?

    Sources3

    4.Pipeline health: update state and per-flow status

    Health has two levels, and each has its own event type. An update is one run of the pipeline; its origin.update_id is the equivalent of a run ID. update_progress events trace that run through its states. The last one, such as COMPLETED, FAILED or CANCELED, is the run's outcome. To get each update's latest state, keep the newest update_progress row per update_id.

    Latest state of each pipeline update, taken from update_progress eventssql
    with last_status_per_update AS (
        SELECT
            origin.pipeline_id AS pipeline_id,
            origin.pipeline_name AS pipeline_name,
            origin.update_id AS pipeline_update_id,
            FROM_JSON(details, 'struct<update_progress: struct<state: string>>').update_progress.state AS last_update_state,
            timestamp,
            ROW_NUMBER() OVER (
                PARTITION BY origin.update_id
                ORDER BY timestamp DESC
            ) AS rn
        FROM event_log_raw
        WHERE event_type = 'update_progress'
        QUALIFY rn = 1

    Each flow is tracked separately. Every table that a flow writes gets its own flow_progress events, identified by origin.flow_name. When one table goes quiet and its neighbours keep loading, filter on that flow name and read its details:flow_progress.status. A terminal value of FAILED, STOPPED, SKIPPED or EXCLUDED tells you how the flow ended. When something actually broke, the row's top-level error column holds the details. That answers the question directly, with no guessing from messages and no full refresh just to see whether the table catches up.

    Taking each flow's final status from its most recent terminal flow_progress eventsql
        MAX_BY(status, timestamp) FILTER (
          WHERE status IN ('COMPLETED', 'FAILED', 'CANCELLED', 'EXCLUDED', 'SKIPPED', 'STOPPED', 'IDLE')
        ) AS final_status,

    origin.flow_id is a quieter health signal. A flow keeps the same flow_id across updates for as long as it refreshes incrementally. The ID changes when a materialized view fully refreshes, a checkpoint resets, or a full recomputation happens. If a flow's flow_id changes unexpectedly between two updates, that flow was rebuilt from scratch. The planning_information events for that update record why.

    Checkpoint 6 of 11· Fill the gap

    This query should return one row per pipeline run, showing that run's latest state. Which column belongs in the PARTITION BY clause?

    with last_status_per_update AS (
        SELECT
            origin.pipeline_id AS pipeline_id,
            origin.pipeline_name AS pipeline_name,
            origin.update_id AS pipeline_update_id,
            FROM_JSON(details, 'struct<update_progress: struct<state: string>>').update_progress.state AS last_update_state,
            timestamp,
            ROW_NUMBER() OVER (
                PARTITION BY  ? 
                ORDER BY timestamp DESC
            ) AS rn
        FROM event_log_raw
        WHERE event_type = 'update_progress'
        QUALIFY rn = 1

    Checkpoint 7 of 11· Exam question

    An engineer is debugging why a Lakeflow Declarative Pipeline update stopped producing new data for one table overnight, while other tables in the same pipeline kept updating. Where in the event log should they look first to isolate the cause to that one flow?

    Sources3

    5.Throughput and backlog from flow_progress metrics

    The same flow_progress events that carry a flow's status also carry its volume. details:flow_progress.metrics holds num_output_rows, num_upserted_rows and num_deleted_rows. Each value is a count for one micro-batch, so you get throughput by summing them over a time window. A single event shows only one batch. Wrapping each value in TRY_CAST(... AS BIGINT) keeps one malformed value from failing the whole query.

    Extracting status, row counts and expectation metrics from flow_progress eventssql
        details:flow_progress.status AS status,
        TRY_CAST(details:flow_progress.metrics.num_output_rows AS BIGINT)      AS num_output_rows,
        TRY_CAST(details:flow_progress.metrics.num_upserted_rows AS BIGINT)    AS num_upserted_rows,
        TRY_CAST(details:flow_progress.metrics.num_deleted_rows AS BIGINT)     AS num_deleted_rows,
        TRY_CAST(details:flow_progress.data_quality.dropped_records AS BIGINT) AS num_expectation_dropped_rows,
        FROM_JSON(
          details:flow_progress.data_quality.expectations,
          SCHEMA_OF_JSON("[{'name':'str', 'dataset':'str', 'passed_records':42, 'failed_records':42}]")
        ) AS expectations_array

    Backlog shows whether a streaming flow is keeping up. It is reported as details:flow_progress.metrics.backlog_bytes. A value that keeps growing means data is arriving faster than the flow processes it. When a flow reaches COMPLETED it has caught up, so treat its backlog as 0 rather than carrying forward an old reading. Backlog is not always reported: whether it appears depends on the data source type and the Databricks Runtime version. A missing value means the metric was not reported, not that the backlog is empty.

    Two narrower signals sit beside these. Auto Loader file discovery shows up as operation_progress events with type AUTO_LOADER_LISTING or AUTO_LOADER_BACKFILL, carrying duration_ms and num_files_listed. On classic compute with enhanced autoscaling, autoscale events record cluster resize requests. Serverless pipelines do not produce those.

    Checkpoint 8 of 11· Fill the gap

    You want hourly throughput for each table, so you need the per-micro-batch upsert count from flow_progress events. Which object in the details path holds it?

        details:flow_progress.status AS status,
        TRY_CAST(details:flow_progress.metrics.num_output_rows AS BIGINT)      AS num_output_rows,
        TRY_CAST(details:flow_progress. ? .num_upserted_rows AS BIGINT)    AS num_upserted_rows,
        TRY_CAST(details:flow_progress.metrics.num_deleted_rows AS BIGINT)     AS num_deleted_rows,
        TRY_CAST(details:flow_progress.data_quality.dropped_records AS BIGINT) AS num_expectation_dropped_rows,
        FROM_JSON(
          details:flow_progress.data_quality.expectations,
          SCHEMA_OF_JSON("[{'name':'str', 'dataset':'str', 'passed_records':42, 'failed_records':42}]")
        ) AS expectations_array

    Sources41

    6.Expectation pass, fail and drop counts

    Expectations are the declarative row checks that keep, drop or fail on violating records (see Pipeline expectations (expect, expect_or_drop, expect_or_fail)). Their results are reported in flow_progress events, the same event type that carries flow status. Two fields matter, and they sit at different depths in the JSON.

    Where each data quality metric lives inside a flow_progress event
    MetricMeaningPath in details
    passed_recordsRecords that passed this expectationdetails:flow_progress.data_quality.expectations (one array entry per expectation)
    failed_recordsRecords that failed this expectationdetails:flow_progress.data_quality.expectations (one array entry per expectation)
    dropped_recordsRecords dropped because they failed one or more expectationsdetails:flow_progress.data_quality

    expectations is an array. Each entry carries name, dataset, passed_records and failed_records. To count per expectation, parse the array with from_json, explode it into one row per expectation, then group by dataset and expectation name. dropped_records is a single total for the flow, not a per-rule figure. One record that breaks three drop rules is counted once there but adds one to the failed_records of each of the three expectations.

    Exploding the expectations array of flow_progress events for the latest updatesql
        SELECT
          explode(
            from_json(
              details:flow_progress:data_quality:expectations,
              "array<struct<name: string, dataset: string, passed_records: int, failed_records: int>>"
            )
          ) row_expectations
        FROM
          event_log_raw,
          latest_update
        WHERE
          event_type = 'flow_progress'
          AND origin.update_id = latest_update.latest_update_id

    When grouping, use the expectation's own dataset field. It is populated even on events where origin.dataset_name is empty, so coalesce(expectation.dataset, origin.dataset_name) is the safe key. Watch for two gaps. Some datasets do not report data quality metrics at all. An expectation that fails the update records no metrics, because the update stops when it hits an invalid record. For those rules, look for the failure in the update's error, not in a failed_records count.

    Checkpoint 9 of 11· Match them up

    A dataset has three expectations, one for each violation action. When you query its flow_progress events after a run, what does each expectation leave in the event log?

    Tap a term, then the definition that fits it.

    Sources145

    7.Lineage from flow_definition events

    The event log also records lineage. Each flow_definition event describes one edge of the pipeline's dataflow DAG. details:flow_definition.output_dataset names the dataset the flow writes, and details:flow_definition.input_datasets lists what it reads. The same object also carries flow_type and the flow's schema. Select those fields for the latest update and you have the whole graph as rows: which tables feed a failing table, and which downstream tables are affected when an upstream flow stops.

    Checkpoint 10 of 11· Check yourself

    An upstream flow has stopped. To list every downstream table it feeds, which part of the event log do you query?

    Sources1

    8.One pipeline's log versus the pipeline_events system table

    The per-pipeline event log answers questions about one pipeline. For a platform team watching dozens of pipelines, Databricks recommends the pipeline_events system table, currently in Beta. It holds events for every pipeline in every workspace in a region and uses the same event_type, origin and details concepts. To read it you need USE and SELECT on the system schemas, or both metastore admin and account admin. Its details column is read with variant_get rather than the : path syntax.

    Most recent error per pipeline over the last seven days, from the pipeline_events system tablesql
    SELECT
      workspace_id,
      pipeline_id,
      event_time,
      message,
      error.exceptions[0].error_class AS exception_error_class,
      error.exceptions[0].sql_state   AS exception_sql_state
    FROM
      system.lakeflow_pipeline_events_preview.pipeline_events
    WHERE
      level = 'ERROR'
      AND event_time >= current_timestamp() - INTERVAL 7 DAYS
    QUALIFY
      ROW_NUMBER() OVER (PARTITION BY workspace_id, pipeline_id ORDER BY event_time DESC) = 1
    ORDER BY
      event_time DESC

    Choose by scope and access. If you own one pipeline and want an answer now, event_log(<pipelineId>) needs no grants and no setup. If you are building a cross-pipeline dashboard of failures, throughput, backlog and expectation failures, use the system table, because it covers every pipeline in one query. If you are reacting to events as they happen, use event hooks, which run custom actions such as sending an alert whenever an event is logged.

    Checkpoint 11 of 11· Match them up

    A data platform has four monitoring needs. Pair each need with the event source or mechanism that fits it best.

    Tap a term, then the definition that fits it.

    Sources41

    Sources

    (5)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “The pipeline event log contains all information related to a pipeline, including audit logs, data quality checks, pipeline progress, and data lineage.”
      ↩︎ What the pipeline event log records
      “You can view event log entries in the pipeline monitoring user interface, the Pipelines REST API, or by directly querying the event log.”
      ↩︎ What the pipeline event log records
      “By default, only the pipeline's run-as user can query the event log table.”
      ↩︎ Reading the hidden log with event_log() and publishing it
      “it is not visible in Catalog Explorer or other workspace UI pages. You must access it using the event_log() function.”
      ↩︎ Reading the hidden log with event_log() and publishing it
      “You can publish the event log by editing the Advanced settings for your pipeline.”
      ↩︎ Reading the hidden log with event_log() and publishing it
      “Databricks recommends creating a view over the event log table before modifying the privileges”
      ↩︎ Reading the hidden log with event_log() and publishing it
      “Do not delete the event log or the parent catalog or schema where the event log is published.”
      ↩︎ Reading the hidden log with event_log() and publishing it
      “The event log location also serves as the schema location for any Auto Loader queries in the pipeline.”
      ↩︎ Reading the hidden log with event_log() and publishing it
      “Each pipeline tracks how much data is present in the backlog in the details:flow_progress.metrics.backlog_bytes object.”
      ↩︎ Throughput and backlog from flow_progress metrics
      “The backlog metrics might not be available depending on the pipeline's data source type and Databricks Runtime version.”
      ↩︎ Throughput and backlog from flow_progress metrics
      “For Auto Loader events, the event_type is operation_progress”
      ↩︎ Throughput and backlog from flow_progress metrics
      “the metrics for the number of records that passed and failed an expectation are stored in the details:flow_progress.data_quality.expectations object.”
      ↩︎ Expectation pass, fail and drop counts
      “Data quality metrics might not be available for some data sets.”
      ↩︎ Expectation pass, fail and drop counts
      “Events containing information about lineage have the event type flow_definition.”
      ↩︎ Lineage from flow_definition events
      “The details:flow_definition object contains the output_dataset and input_datasets defining each relationship in the graph.”
      ↩︎ Lineage from flow_definition events
      “You can also define custom actions to run when events are logged, for example, sending alerts, with event hooks.”
      ↩︎ One pipeline's log versus the pipeline_events system table
      “By default, a pipeline writes the event log to a hidden Delta table in the default catalog and schema configured for the pipeline.”
      ↩︎ Exam trap 1
      “The metric for the number of dropped records is stored in the details:flow_progress.data_quality object.”
      ↩︎ Exam trap 3
    2. 2.
      “It shows the result of the last five runs as status indicators next to each pipeline”
      ↩︎ What the pipeline event log records
      “The event log is the ground truth underneath both. It's a structured Delta table that you query for anything programmatic or historical”
      ↩︎ Key concept
      “The event log is the ground truth underneath both. It's a structured Delta table that you query for anything programmatic or historical”
      ↩︎ Checkpoint
    3. 3.
      “This is the primary field used for analyzing events. The JSON string format depends on the event_type.”
      ↩︎ Event types and parsing the details JSON
      “Databricks supports the : operator to parse JSON fields.”
      ↩︎ Event types and parsing the details JSON
      “METRICS: Used for high-volume events stored only in the Delta table, and not shown in the pipelines UI.”
      ↩︎ Event types and parsing the details JSON
      “Describes the lifecycle of a pipeline update from starting, running, to completed, or failed.”
      ↩︎ Pipeline health: update state and per-flow status
      “The id of a single execution of the pipeline. This is equivalent to run ID.”
      ↩︎ Pipeline health: update state and per-flow status
      “If an error occurred, details describing the error.”
      ↩︎ Pipeline health: update state and per-flow status
      “As long as the flow_id is the same, the flow is incrementally refreshing.”
      ↩︎ Pipeline health: update state and per-flow status
      “It is not recommended to build monitoring or alerts based on EVOLVING or DEPRECATED fields.”
      ↩︎ Exam trap 4
      “It is not recommended to build monitoring or alerts based on EVOLVING or DEPRECATED fields.”
      ↩︎ Checkpoint
      “Describes the lifecycle of a flow from starting, running, to completed or failed.”
      ↩︎ Prediction
    4. 4.
      “Each metric is a per-micro-batch count, so summing over the window gives throughput.”
      ↩︎ Throughput and backlog from flow_progress metrics
      “A COMPLETED flow is caught up, so its backlog is reported as 0.”
      ↩︎ Throughput and backlog from flow_progress metrics
      “It keys on the expectation's own dataset, which is populated even when the event's origin.dataset_name is not.”
      ↩︎ Expectation pass, fail and drop counts
      “The pipeline_events system table contains events for all pipelines across the workspaces in a region and is the recommended way to query events.”
      ↩︎ One pipeline's log versus the pipeline_events system table
      “Have USE and SELECT permissions on the system schemas.”
      ↩︎ One pipeline's log versus the pipeline_events system table
    5. 5.
      “the Data quality tab in the pipeline UI is not available. Query the event log to view expectation metrics.”
      ↩︎ Expectation pass, fail and drop counts
      “Because fail causes the update to fail when an invalid record is detected, metrics are not recorded.”
      ↩︎ Exam trap 2
      “Because fail causes the update to fail when an invalid record is detected, metrics are not recorded.”
      ↩︎ Checkpoint

    Spotted a mistake, or was something unclear? Tell us.