Repository navigation
feat(inspection): structured log query estimation and inspection log volume UI redesign - #895
Merged
Merged
Conversation
…hing and metric translation
… with incomplete query handling
… new inspection dialog
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
August 24, 2026 02:15
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a log volume estimation feature for Google Cloud Logging and Monitoring queries, refactoring various log query tasks to use a new structured query model and integrating these estimates into the frontend's 'New Inspection' dialog. The review feedback highlights several critical improvements: adding defensive nil checks in QueryMetricCount to prevent nil pointer dereferences, ensuring all active flights are cancelled in CachedStructuredLogEstimator.Close() to avoid goroutine leaks, and dynamically setting isEstimating in the frontend when some queries are incomplete but others are still estimating.
kyasbal
commented
Aug 24, 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
This PR implements structured log query estimation for Google Cloud Logging queries, introduces caching & metric-based volume estimation, migrates all 14 Google Cloud query tasks to
StructuredLogQuery, and improves the New Inspection dialog UI to display live log count estimates and progress indicators.Key Changes
Structured Log Query Estimator (
pkg/api/googlecloud/logestimator):StructuredLogQuerywith structured matchers (ResourceLabel,LogID,CustomFilter,Comment).logging.googleapis.com/log_entry_count) with fallback to probe sampling.CachedStructuredLogEstimatorwith singleflight request deduplication, LRU caching, and cancellation of outdated in-flight queries.Inspection Framework Extensions (
pkg/core/inspection/metadata,pkg/task/inspection/googlecloudcommon/contract):StructuredListLogEntriesTaskcapable of generating structured queries and estimating log volumes during dry-run mode.IncompleteandEstimatedCountmetadata fields toInspectionMetadataQuery.IsComplete()method toGoogleCloudClusterIdentityto skip estimation when required parameters are missing.Query Task Migrations (
pkg/task/inspection/googlecloud*):StructuredLogQuery(k8scontainer,k8sevent,k8snode,k8scontrolplane,k8saudit,gkeautoscaler,gkeapiaudit,computeapiaudit,networkapiaudit,onpremapiaudit,multicloudapiaudit,composerapiaudit,clustercomposer,csm,csm traffic director,serialport).Frontend UI Redesign (
web/src/app/dialogs/new-inspection):normal,warningfor >= 1M,dangerfor >= 5M).~N total logs estimated,>N logs estimated so far,Incomplete parameters).Verification
make test-go: All backend tests passed.make test-web: All 736 frontend tests passed.make pre-commit: All formatters and linters passed with 0 issues.