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

   Linked issue: #541 , https://github.com/apache/flink-agents/discussions/552
   
   ### Purpose of change
   
   Add per-event-type configurable log levels (`OFF`, `STANDARD`, `VERBOSE`) to 
the event log system, as designed in 
https://github.com/apache/flink-agents/discussions/552.
   
   **Key changes:**
   - `EventLogLevel` enum (`OFF`, `STANDARD`, `VERBOSE`) with hierarchical 
config key inheritance (`event-log.type.<EVENT_TYPE>.level`)
   - At `STANDARD` level, large content fields are truncated using configurable 
per-field thresholds (`max-string-length`, `max-array-elements`, `max-depth`) 
with JSON-parseable wrapper objects (`truncatedString`, `truncatedList`, 
`truncatedObject`)
   - Top-level `logLevel` and `eventType` fields added to JSON log record 
schema for downstream filtering
   - `EventFilter` removed — fully subsumed by the log level system
   - `eventLogTruncatedEvents` counter metric for observability
   - Python config options and E2E tests
   
   **Config options:**
   | Key | Default | Description |
   |-----|---------|-------------|
   | `event-log.level` | `STANDARD` | Root default log level |
   | `event-log.type.<EVENT_TYPE>.level` | _(inherits)_ | Per-type override |
   | `event-log.standard.max-string-length` | `2000` | Max string chars at 
STANDARD |
   | `event-log.standard.max-array-elements` | `20` | Max array elements at 
STANDARD |
   | `event-log.standard.max-depth` | `5` | Max nesting depth at STANDARD |
   
   ### Tests
   
   - `EventLogLevelResolverTest` — 11 tests: exact match, hierarchy 
inheritance, root/built-in defaults, case insensitivity, edge cases
   - `JsonTruncatorTest` — 8 tests: string/array/depth truncation, wrappers, 
protected fields, composition, disabled thresholds
   - `FileEventLoggerTest` — 7 new tests: STANDARD truncation, VERBOSE 
preservation, OFF suppression, per-type override, hierarchical inheritance, 
JSON schema fields, backward-compatible deserialization
   - Python E2E tests — 3 new: VERBOSE, OFF, STANDARD truncation
   
   ### API
   
   - **New public API**: `EventLogLevel` enum in `api` module
   - **Removed public API**: `EventFilter` interface (0.x pre-release, no known 
users)
   - **Modified**: `EventLoggerConfig` — removed `eventFilter` field/builder 
method
   
   ### Documentation
   
   - [x] `doc-needed`
   


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