feat(inspection): add NodeNameDiscoveryTask for k8snode and k8scontainer log parsers - #860
Merged
Merged
Conversation
…ner log parsers - Add NodeNameDiscoveryTask for googlecloudlogk8snode to discover node names from K8sNodeLogCommonFieldSet.NodeName - Add NodeNameDiscoveryTask for googlecloudlogk8scontainer to discover node names from GCPContainerLogNodeNameLabelFieldSet.NodeName - Register NodeNameDiscoveryTask to each TailTask dependencies to include them in the inspection task graph - Update dry-run query placeholder comments in googlecloudlogcomputeapiaudit and googlecloudlogserialport
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces node name discovery tasks for both Kubernetes container logs and node logs to extract node names and register them to the node name inventory. It also updates the query generation logic for Compute API and Serial Port logs to indicate that instance name filters are determined after node name discovery. I have no feedback to provide as there are no review comments.
kyasbal
marked this pull request as ready for review
August 4, 2026 05:43
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
August 4, 2026 05:43
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
Compute Engine API log parser (
googlecloudlogcomputeapiaudit) and Serial Port log parser (googlecloudlogserialport) depend on the node name inventory (NodeNameInventoryTask) to query logs for relevant nodes/instances.Previously, only Kubernetes audit logs (
commonlogk8saudit_impl.NodeNameDiscoveryTask) were capable of discovering node names. This PR adds newNodeNameDiscoveryTaskimplementations togooglecloudlogk8snodeandgooglecloudlogk8scontainerso that node names can also be discovered from Node logs and Container log labels, ensuring complete node name coverage even when audit logs are absent.Key Changes
pkg/task/inspection/googlecloudlogk8snode:NodeNameDiscoveryTaskIDand implementedNodeNameDiscoveryTaskto extract node names fromK8sNodeLogCommonFieldSet.NodeName.NodeNameDiscoveryTaskID.Ref()toTailTaskdependencies to ensure the discovery task is automatically included in the inspection DAG when node logs are inspected.nodename_discovery_task_test.go).pkg/task/inspection/googlecloudlogk8scontainer:NodeNameDiscoveryTaskIDand implementedNodeNameDiscoveryTaskto extract node names fromGCPContainerLogNodeNameLabelFieldSet.NodeName(labels."compute.googleapis.com/resource_name").NodeNameDiscoveryTaskID.Ref()toTailTaskdependencies to ensure the discovery task is automatically included in the inspection DAG when container logs are inspected.nodename_discovery_task_test.go).pkg/task/inspection/googlecloudlogcomputeapiaudit&googlecloudlogserialport:-- instance name filters to be determined after audit log queryto-- instance name filters to be determined after node name discovery.Verification
NodeNameDiscoveryTaskimplementations:go test ./pkg/task/inspection/googlecloudlogk8snode/impl -run TestNodeNameDiscoveryTask-> PASSgo test ./pkg/task/inspection/googlecloudlogk8scontainer/impl -run TestNodeNameDiscoveryTask-> PASSgo test ./pkg/task/inspection/googlecloudlogcomputeapiaudit/impl -run TestGenerateComputeAPIQuery-> PASSgo test ./pkg/task/inspection/googlecloudlogserialport/impl -run TestGenerateSerialPortQuery-> PASSmake build-go-> PASSmake test-go-> PASSmake pre-commit-> PASS (no linter/formatting issues)