feat: capture write-time materialization metrics (local engine)#371
Open
Manisha4 wants to merge 2 commits into
Open
feat: capture write-time materialization metrics (local engine)#371Manisha4 wants to merge 2 commits into
Manisha4 wants to merge 2 commits into
Conversation
Add a write-time metrics capture layer for materialization (EAPC-22385), local compute engine + Cassandra first. Off by default; gated behind the ENABLE_MATERIALIZATION_METRICS env var. - MaterializationMetricsAggregator (feast/_materialization_metrics.py): accumulates rows_read_offline, rows_written_online, drop_reasons, fields_written, field_null_counts, and max_event_timestamp/lag_seconds. Invariant: rows_read - rows_written == rows_dropped == sum(drop_reasons). - ExecutionContext carries an optional metrics_collector; instantiated in ComputeEngine.get_execution_context only for a MaterializationTask when the env gate is on. - Local nodes populate it: LocalSourceReadNode (rows_read), LocalFilterNode (filter drops), LocalDedupNode (dedup drops), LocalOutputNode (rows_written, fields, null counts, freshness). All no-ops when the collector is absent. - The online store reaches the aggregator via a ContextVar the output node binds around the write (collecting()), so online_write_batch's signature is unchanged. Cassandra records ttl_expired / ttl_exceeds_max at its TTL skip points, best-effort. - Unit tests for the aggregator and the node hooks, incl. the contextvar store-drop seam. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…olume metrics (EAPC-22385) Extend the write-time materialization metrics collector to the Spark compute engine and add the remaining Layer-1 volume metrics. - Spark path: MaterializationStatsAccumulatorParam merges per-executor stats (via the pure, commutative merge_stats) back to the driver; map_in_arrow builds a per-partition aggregator bound through collecting() so the online store's TTL-skip drops are captured on the executor. - merge_from_dict folds the accumulator result into the driver-side collector. - Volume metrics: bytes_written (Arrow nbytes, both engines) and distinct_entity_keys (exact via pyarrow group_by on the local engine; left unset on Spark to avoid a second DAG-re-executing pass -- HLL follow-up). - Layer-1 -> job bridge (record_run_result / drain_run_results) so the materialization job can drain write-time stats after store.materialize(). - Env-gated (ENABLE_MATERIALIZATION_METRICS), no-op when disabled. Tests: collector merge/volume/bridge + Spark accumulator path (pyspark-guarded). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a write-time metrics capture layer for materialization (EAPC-22385), local compute engine + Cassandra first. Off by default; gated behind the ENABLE_MATERIALIZATION_METRICS env var.
What this PR does / why we need it:
Which issue(s) this PR fixes:
Misc