[api][runtime][python] Add minimal Event lineage#923
Open
rosemarYuan wants to merge 3 commits into
Open
Conversation
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.
Linked issue: Closes #841
Related discussions:
Purpose of change
The Event Log currently records individual Events but does not preserve enough information to reconstruct the direct causal path between an Event, the Action it triggered, and the Events emitted by that Action.
This PR implements the minimal Event-lineage phase discussed in #710.
It adds two framework-managed fields to each Event emitted by an Action:
upstreamEventId: the ID of the Event consumed by the emitting Action;upstreamActionName: the name of the Action that emitted the current Event.Together with the existing per-occurrence Event ID, these fields are sufficient to reconstruct an InputEvent-rooted Event-Action-Event causal tree from the available Event Log records.
This PR deliberately does not implement the complete execution-tracing model proposed in #900. Run identity, concrete Action invocation identity, execution hierarchy, lifecycle, retry/replay semantics, ordering, and failure details remain part of that separate design.
A real Runtime execution was verified with the following causal path:
The File Event Log contained three physical Event records:
upstreamEventIdupstreamActionName_input_eventMiddleEventaction1_output_eventaction2Running
tools/reconstruct_trace_tree.pyagainst that Runtime log produced:The JSON reconstruction contained one root, all three Event nodes, the two expected virtual Action edges, and no warnings.
Tests
Add e2e test to review Trace Tree
python/flink_agents/e2e_tests/e2e_tests_integration/python_event_logging_test.pyAPI
This PR changes the default Python Event ID generation strategy from content-derived IDs to UUIDv4.
Documentation
doc-neededdoc-not-neededdoc-included