Add CloudTrace support to investigate heavy tasks#371
Merged
Conversation
Member
Author
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces interceptor support for LocalRunner and InspectionTaskRunner, which is a great enhancement for adding cross-cutting concerns like tracing and logging. The implementation correctly applies the interceptor pattern and refactors the logging logic into a default interceptor. However, I've found a critical issue in the Run method of the InspectionTaskRunner related to concurrency and error handling that could lead to deadlocks and silent failures. My review includes detailed comments on how to address this.
This commit integrates Cloud Trace to visualize the execution time and details of inspection tasks. Changes: - Add `--cloud-trace` and `--cloud-trace-project-id` debug flags. - Implement InspectionTraceInterceptor to generate OpenTelemetry spans for inspections and individual tasks. - Update TaskRunner interface and LocalRunner to support dynamic interceptor registration via AddInterceptor. - Instrument key inspection tasks (LogSerializer, HistoryModifier, etc.) to add trace attributes like log counts. - Initialize OpenTelemetry provider in `DefaultInitExtension`.
kkuchima
approved these changes
Nov 20, 2025
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.
Motivation
Enable
TaskRunnerandInspectionTaskRunnerto have interceptor which enables extender to run a function before/after running a task or running an inspection. This is a prerequisite enhancement to add CloudTrace for debugging purpose.