Repository navigation
feat(logestimator): introduce EstimatedCountPreset for rough query log estimation - #926
Merged
Merged
Conversation
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
August 31, 2026 01:16
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a predefined rough estimation tier, "EstimatedCountPreset" (specifically "Few"), to bypass exact log count estimation when it is unfeasible. The changes span the backend estimators, proto definitions, and the Angular frontend to correctly propagate and display this preset (e.g., showing "Few logs estimated"). A review comment points out that the frontend check for unestimated queries is fragile because it explicitly checks against "EstimatedCountPreset.Few", which will break if more presets are added in the future; it suggests checking for undefined or unspecified presets instead.
kyasbal
commented
Aug 31, 2026
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.
Summary
Introduces
EstimatedCountPreset(includingEstimatedCountPreset.Few) to support predefined rough query volume estimation categories across backend task execution, API definitions, and frontend inspection parameter dialogs, and applies it to Compute API Audit and Serial Port log queries.Background & Motivation
In KHI dry-run mode, query volume is estimated using Cloud Monitoring metrics and time-bounded probe queries. However, queries such as Compute API Audit logs and Serial Port output match sparse or sporadic events where exact count estimation is either unfeasible prior to node discovery or unnecessary. Tagging such queries with
EstimatedCountPresetFewavoids unnecessary probe calls and clearly informs the user in the UI that few logs are expected.Key Changes
proto/api/v1/inspection.proto):enum EstimatedCountPreset(UNSPECIFIED = 0,FEW = 1).estimated_count_presetfield toInspectionQuery.pkg/api/googlecloud/logestimator/):EstimatedCountPresetenum totypes.go.StructuredLogEstimatorandCachedStructuredLogEstimatorto short-circuit estimation and return preset results immediately without remote network calls.pkg/core/inspection/metadata/,pkg/task/...):SetQueryWithPresettoQueryMetadata.googlecloudlogcomputeapiauditto tag dry-run query withEstimatedCountPresetFew.googlecloudlogserialportto tag dry-run query withEstimatedCountPresetFew.structured_listlogentries_task.goandpkg/server/api/v1/inspection.goto propagate preset to API responses.web/src/app/):inspection-converter.tsto map proto presets tometadata-types.ts.new-inspection.component.htmlto display"Few logs estimated"badge.computeTotalEstimatedLogsinnew-inspection.component.tsto treat preset queries as resolved.Verification
make pre-commitpassed with 0 errors.make build-go && make test-gopassed cleanly.make test-web(1053 tests) passed cleanly.make lint-go && make lint-webpassed with 0 issues.make lint-protopassed with 0 issues.