Skip to content

LAL: generalize extraLog type, add EnvoyAccessLogBuilder, and DSL class generator test#13736

Merged
wu-sheng merged 3 commits intomasterfrom
fix/lal-output-builder-cleanup
Mar 10, 2026
Merged

LAL: generalize extraLog type, add EnvoyAccessLogBuilder, and DSL class generator test#13736
wu-sheng merged 3 commits intomasterfrom
fix/lal-output-builder-cleanup

Conversation

@wu-sheng
Copy link
Member

Follow-up improvements to LAL v2 outputType mechanism (#13733)

These changes fix several issues discovered after the initial outputType PR and add a DSL class generator test for offline validation.

Key changes:

  1. Generalize extraLog from Message to ObjectILogAnalyzerService.doAnalysis() and the entire listener chain now use Optional<Object> instead of com.google.protobuf.Message. This removes the protobuf coupling and allows non-protobuf input types in the future.

  2. LALOutputBuilder.init() accepts Object instead of LogData — Each builder casts to its expected input type internally (e.g., LogData for standard logs, HTTPAccessLogEntry for envoy). This enables the envoy access log builder to receive the raw protobuf entry directly.

  3. Add EnvoyAccessLogBuilder — A new LALOutputBuilder implementation for envoy access logs that extends LogBuilder and serializes the raw access log entry as JSON content. Registered via SPI and declared as the default output type for the MESH layer in EnvoyHTTPLALSourceTypeProvider.

  4. Move addTag off LALOutputBuilder interfaceaddTag() was a default no-op on the interface, silently dropping tags for non-Log output types. Now it only exists on LogBuilder, and the LAL compiler validates at compile time that tag assignments are only used with LogBuilder-compatible output types.

  5. Remove dead LogSinkListenerFactory methodsaddSinkListenerFactory() and getSinkListenerFactory() on ILogAnalysisListenerManager were unused after the v2 refactoring.

  6. Remove unused ModuleManager/ModuleConfig from LogAnalyzer — Constructor now only takes ILogAnalysisListenerManager.

  7. Add DSLClassGeneratorTest — A test in server-starter that compiles all OAL, MAL, LAL, and Hierarchy scripts and dumps .class files to target/generated-dsl-classes/ for offline inspection. Documents the tool in the debugging guide.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

…e tag validation, and DSL class generator test
@wu-sheng wu-sheng requested a review from wankai123 March 10, 2026 06:55
@wu-sheng wu-sheng added this to the 10.4.0 milestone Mar 10, 2026
@wu-sheng wu-sheng added bug Something isn't working and you are sure it's a bug! backend OAP backend related. labels Mar 10, 2026
wu-sheng and others added 2 commits March 10, 2026 15:24
Keep LogData as a separate parameter so builders can populate
service/instance/layer fallback fields. The extraLog is now
Optional<Object> for null-safety and type-agnostic input.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The doAnalysis() signature now takes Optional<Object> for extraLog.
LogHandler was still passing raw null, causing NPE in the LAL pipeline.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wu-sheng wu-sheng merged commit 13a8bf4 into master Mar 10, 2026
324 of 329 checks passed
@wu-sheng wu-sheng deleted the fix/lal-output-builder-cleanup branch March 10, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. bug Something isn't working and you are sure it's a bug!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants