rosemarYuan opened a new pull request, #923:
URL: https://github.com/apache/flink-agents/pull/923

   <!--
   * Thank you very much for contributing to Flink Agents.
   * Please add the relevant components in the PR title. E.g., [api], 
[runtime], [java], [python], [hotfix], etc.
   -->
   
   Linked issue: Closes #841
   
   Related discussions:
   
   - https://github.com/apache/flink-agents/discussions/710
   - https://github.com/apache/flink-agents/discussions/900
   
   Linked issue: #xxx
   
   ### 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:
   
   ```text
   InputEvent(input=1)
     -> action1
     -> MiddleEvent(num=2)
     -> action2
     -> OutputEvent(output=4)
   ```
   
   The File Event Log contained three physical Event records:
   
   | Event           | `upstreamEventId` | `upstreamActionName` |
   | --------------- | ----------------- | -------------------- |
   | `_input_event`  | absent            | absent               |
   | `MiddleEvent`   | InputEvent ID     | `action1`            |
   | `_output_event` | MiddleEvent ID    | `action2`            |
   
   Running `tools/reconstruct_trace_tree.py` against that Runtime log produced:
   
   ```text
   Trace Tree 1
     _input_event
       [Action: action1]
         MiddleEvent
           [Action: action2]
             _output_event
   ```
   
   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.py`
   
   
   ### API
   
   This PR changes the default Python Event ID generation strategy from 
content-derived IDs to UUIDv4.
   ### Documentation
   
   <!-- Do not remove this section. Check the proper box only. -->
   
   - [ ] `doc-needed` <!-- Your PR changes impact docs -->
   - [ ] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-included` <!-- Your PR already contains the necessary 
documentation updates -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to