โ01-20-2026 03:36 AM
We created a Delta Live Tables (DLT) streaming pipeline to ingest data from the Bronze layer to the Silver layer using Change Data Feed (CDF) enabled.
The stream runs continuously and shows # of upserted and deleted rows at an aggregate level from the time it started. Is there a way to capture these metrics at a daily or hourly level to better understand the ingestion load on the stream?
โ01-20-2026 07:14 AM
Yesโcapture it from the DLT event log and derive it directly from the target tableโs CDF, then aggregate by time.
Options that work well
Example queries
Below are templates you can run as-is after replacing identifiers; they produce hourly metrics. Switch date_trunc('hour', ...) to 'day' for daily.
1) From the DLT event log
Notes:
2) From the Silver tableโs CDF (semantic split: insert/update/delete)
SQL: SELECT date_trunc('hour', COALESCE(_commit_timestamp, <your_event_ts>)) AS hour_bucket, SUM(CASE WHEN _change_type = 'insert' THEN 1 ELSE 0 END) AS inserts, SUM(CASE WHEN _change_type = 'delete' THEN 1 ELSE 0 END) AS deletes, SUM(CASE WHEN _change_type IN ('update_postimage') THEN 1 ELSE 0 END) AS updates FROM table_changes('<catalog>.<schema>.<silver_table>', START => '2024-12-01') GROUP BY 1 ORDER BY 1;
Tips:
When to use which
โ03-08-2026 06:04 PM
Hi @_its_akshaye,
The pipeline event log captures exactly what you need. Every Lakeflow Spark Declarative Pipeline (SDP, formerly known as DLT) records flow_progress events that include per-flow metrics with num_upserted_rows and num_deleted_rows fields. You can query these and bucket them by hour or day.
OPTION 1: QUERY THE EVENT LOG (RECOMMENDED)
The event log's flow_progress events contain a metrics object with these fields:
num_output_rows - total output rows written num_upserted_rows - rows upserted into the target num_deleted_rows - rows deleted from the target
If your pipeline is registered in Unity Catalog, use the event_log() table-valued function:
SELECT
date_trunc('hour', timestamp) AS hour_bucket,
details:flow_progress.metrics.num_upserted_rows::bigint AS upserted_rows,
details:flow_progress.metrics.num_deleted_rows::bigint AS deleted_rows,
details:flow_progress.metrics.num_output_rows::bigint AS total_output_rows,
details:flow_progress.flow_name AS flow_name
FROM event_log('<your_pipeline_id>')
WHERE event_type = 'flow_progress'
AND details:flow_progress.status = 'COMPLETED'
GROUP BY 1, 2, 3, 4, 5
ORDER BY 1
Replace '<your_pipeline_id>' with either your pipeline ID or the fully qualified table name if you have published the event log. Switch 'hour' to 'day' for daily granularity.
For Hive metastore pipelines (not Unity Catalog), you can read the event log directly as a Delta table:
SELECT
date_trunc('hour', timestamp) AS hour_bucket,
details:flow_progress.metrics.num_upserted_rows::bigint AS upserted_rows,
details:flow_progress.metrics.num_deleted_rows::bigint AS deleted_rows,
details:flow_progress.metrics.num_output_rows::bigint AS total_output_rows,
details:flow_progress.flow_name AS flow_name
FROM delta.`dbfs:/pipelines/<pipeline-id>/system/events`
WHERE event_type = 'flow_progress'
AND details:flow_progress.status = 'COMPLETED'
GROUP BY 1, 2, 3, 4, 5
ORDER BY 1
To aggregate into true hourly/daily totals (summing across multiple micro-batches), wrap the query:
SELECT
hour_bucket,
flow_name,
SUM(upserted_rows) AS total_upserted,
SUM(deleted_rows) AS total_deleted,
SUM(total_output_rows) AS total_output
FROM (
SELECT
date_trunc('hour', timestamp) AS hour_bucket,
details:flow_progress.metrics.num_upserted_rows::bigint AS upserted_rows,
details:flow_progress.metrics.num_deleted_rows::bigint AS deleted_rows,
details:flow_progress.metrics.num_output_rows::bigint AS total_output_rows,
details:flow_progress.flow_name AS flow_name
FROM event_log('<your_pipeline_id>')
WHERE event_type = 'flow_progress'
AND details:flow_progress.status = 'COMPLETED'
)
GROUP BY hour_bucket, flow_name
ORDER BY hour_bucket
OPTION 2: QUERY CHANGE DATA FEED ON THE SILVER TABLE
If you also want to see the semantic breakdown of inserts vs. updates vs. deletes from the target table's perspective, you can query the Silver table's Change Data Feed directly using table_changes():
SELECT
date_trunc('hour', _commit_timestamp) AS hour_bucket,
SUM(CASE WHEN _change_type = 'insert' THEN 1 ELSE 0 END) AS inserts,
SUM(CASE WHEN _change_type = 'update_postimage' THEN 1 ELSE 0 END) AS updates,
SUM(CASE WHEN _change_type = 'delete' THEN 1 ELSE 0 END) AS deletes
FROM table_changes('<catalog>.<schema>.<silver_table>', 1)
GROUP BY 1
ORDER BY 1
Notes on CDF:
- Count update_postimage for updates (update_preimage is the before-image).
- The second argument can be a version number or a timestamp string.
- CDF data is subject to the table's data retention and VACUUM settings, so keep that in mind for long lookback periods.
WHICH APPROACH TO USE
- Event log (Option 1): lightweight, gives you batch-level throughput numbers that match what the pipeline UI shows. Best for monitoring ingestion load over time.
- CDF (Option 2): gives you the exact semantic split of insert/update/delete at the row level from the target table. Best when you need precise operation-type breakdowns.
You can combine both for a complete picture.
DOCUMENTATION REFERENCES
Event log schema (includes the full FlowMetrics specification):
https://docs.databricks.com/aws/en/ldp/monitor-event-log-schema
Querying the event log:
https://docs.databricks.com/aws/en/ldp/monitor-event-logs
Change Data Feed:
https://docs.databricks.com/aws/en/delta/delta-change-data-feed.html
* This reply used an agent system I built to research and draft this response based on the wide set of documentation I have available and previous memory. I personally review the draft for any obvious issues and for monitoring system reliability and update it when I detect any drift, but there is still a small chance that something is inaccurate, especially if you are experimenting with brand new features.
If this answer resolves your question, could you mark it as "Accept as Solution"? That helps other users quickly find the correct fix.
4 weeks ago
One distinction worth making before choosing the hourly bucket: _commit_timestamp measures when changes landed in the table, while a source event timestamp measures when the business event happened. Late arrivals make those different reports.
For target-change counts from CDF, count update_postimage once per updated row and exclude update_preimage. If you persist metrics incrementally, make writes idempotent by table identity, commit version and change type, then aggregate those stored counts by hour. Appending totals from overlapping version ranges would count the same commits again.
For an SCD2 target, label these as target row changes: end-dating one row and inserting its successor does not represent two separate source events.
Reference: https://docs.databricks.com/aws/en/tables/features/change-data-feed
4 weeks ago
Adding to the good suggestions already shared around DLT event logs and CDF, a couple of newer Databricks capabilities may help operationalise this monitoring.
1. Lakeflow Pipeline Events system table (Beta)
Databricks now provides a centralised system table: system.lakeflow_pipeline_events_preview.pipeline_events
It captures pipeline flow_progress events across workspaces, with 13 months of documented retention and a prebuilt dashboard for throughput, backlog, errors and data quality. Reference
This could simplify multi-pipeline hourly/daily monitoring without separately querying each pipeline's event log
2. Unity Catalog metric views + Genie
With metric-view window measures now GA, aggregated upsert/delete metrics could be exposed as reusable KPIs, including rolling averages and period-over-period trends. Reference
Genie or AI/BI dashboards could then support questions such as "Which tables had the highest delete volume?"