Repository navigation
feat(googlepolicy): add LogTransformPolicy (LogAdd) compiler and evaluator - #703
Draft
rafaelwestphal wants to merge 1 commit into
Draft
rafaelwestphal wants to merge 1 commit into
rafaelwestphal wants to merge 1 commit into
Conversation
rafaelwestphal
force-pushed
the
westphalrafael/log-transform-policy
branch
3 times, most recently
from
October 13, 2026 18:16
7785eb8 to
dc3716d
Compare
rafaelwestphal
force-pushed
the
westphalrafael/log-transform-policy
branch
5 times, most recently
from
October 16, 2026 18:32
8e71da9 to
b7aef05
Compare
…cessor stage ordering
rafaelwestphal
force-pushed
the
westphalrafael/log-transform-policy
branch
from
October 17, 2026 00:00
b7aef05 to
d04e30c
Compare
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
Implements
LogTransformPolicy(LogAddoperation) end-to-end across protobuf definitions,pkg/googlepolicy,googlepolicyprocessor,googlecontrolplaneprovider, and the policy integration test suite:proto/policy/v1alpha1/log_transform_policy.proto): DefinesLogTransformPolicy(id,repeated LogMatcher matches,repeated LogAdd add) andLogAdd(LogFieldSelector target,Value value,bool upsert) with generated Go bindings and wire/protojsonround-trip tests.pkg/googlepolicy/internal/matcher):CompiledLogMatcher,CompileLogMatcher, andCompileLogExtractorintointernal/matcher/log.gosologfilterandlogtransformshare log matching logic as peers without sibling imports.CompilePathSetter(supporting nestedAttributePathmap creation without leaving partial maps whenupsert: falserejects an existing leaf or non-map ancestor) andCompileValueSetter.pkg/googlepolicy/logtransform):googlepolicy.LogTransformPolicyEvaluator(TransformLog(ctx LogContext) TransformResultreturningTransformNoMatch | TransformModified) forPolicyType = "log_transform".LogFieldSelectortargets (log_attribute,resource_attribute,scope_attribute,record_field[BODY,SEVERITY_TEXT,SEVERITY_NUMBER,TRACE_ID,SPAN_ID], andscope_field[NAME,VERSION;SCHEMA_URLis rejected at compile time]).policy_test.go, 98.9% coverage) and fuzz tests (fuzz_test.go,FuzzLogTransformPolicy).googlepolicyprocessor):log_filter) before Stage 2 (log_transform) in deterministicPolicyName()order; dropped log records never enter Stage 2.result="transformed"onprocessor_googlepolicy_recordsandprocessor_googlepolicy_policy_records(while preservingresult="kept"onprocessor_googlepolicy_policy_recordswhen a record is exempted by anACTION_KEEPfilter policy and subsequently transformed).integration_test/policy_test):testdata/log_transform_and_filter_orderingandTestLogFilterKeepAndTransformSelfMetrics.