alnzng commented on code in PR #103:
URL: https://github.com/apache/flink-agents/pull/103#discussion_r2267645487


##########
api/src/main/java/org/apache/flink/agents/api/logger/EventLogger.java:
##########
@@ -0,0 +1,116 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api.logger;
+
+import org.apache.flink.agents.api.Event;
+import org.apache.flink.agents.api.EventContext;
+import org.apache.flink.agents.api.EventFilter;
+
+/**
+ * Interface for logging action events in the Flink Agents framework.
+ *
+ * <p>EventLogger provides a unified interface for capturing, filtering, and 
persisting events as
+ * they flow through the agent execution pipeline. Implementations can target 
different storage
+ * backends such as Flink state, external databases, or file systems.

Review Comment:
   Great questions.
   
   I was thinking that we could leverage on Flink internal state mechanism to 
help event log replay or time travel kind of requierments. The end users should 
be able to store these (event log) states into (centrialized) remote 
storage(e.g. hdfs, s3, etc) and build query on top of it.
   
   Yes, it doesn't have the retention policy setup in this PR, so you are right 
on that the size will keep increasing. I thought it is possible that we apply 
some retention policy(e.g. Flink State TTL `StateTtlConfig` or implement a new 
one either time or size based) on it, and I was thinking we can enable this in 
the next iteration.
   
   Good point. Agreed that event logs could be lost in these failure scenarios, 
and I can understand your concern here. From event processing perspective, this 
doesn't look like a concern. But from event logging perspective, seems we'd 
better to record all the occurred events and this is important in general in 
the scenarios that event processing failed.
   
   This PR provides an implementation `FlinkStateEventLogger`, and it is not 
enabled by default. But with above reasonable concern on data loss, Let me 
remove it. Technically, the end users are still be able to implement a similar 
solution by themselves, but it's their responsibilities to maintain it.
   
   Sounds good on offering a default File based event logger, and agree that we 
should also have rolling / retention strategies for the log files supportted, 
similar like log4j offerring.
   



-- 
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