Repository navigation
Conversation
…set apply logging
dashpole
marked this pull request as ready for review
October 17, 2026 15:58
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
Adds
DEBUG-level single-lineprotojsonwire logging andINFO-level policy-set application logging to the xDS policy manager inpkg/googlepolicy:DiscoveryRequest(DEBUG): Logs"xDS DiscoveryRequest sent"(kind: "initial" | "ack" | "nack",version,response_nonce, and single-linediscovery_requestprotojson including the fullNodeanderror_detail) whenzapcore.DebugLevelis enabled.DiscoveryResponse& DecodedTelemetryCollector(DEBUG): Logs"xDS DiscoveryResponse received"(with single-linediscovery_responseprotojson and a structured JSON fallback if anAnyresource cannot be resolved) and"Decoded xDS TelemetryCollector"(policy_set_revision,revision_create_time,policy_count,policy_ids) whenzapcore.DebugLevelis enabled.INFO): Logs"Applied xDS policy set"(version,policy_set_revision,policies_loaded,policies_skipped) before sending an xDS ACK.Example Log Output
1. Initial Connect + Successful Policy Set Application (
rev-1)2. Failure Scenario A: Rejected Revision (Missing or Malformed
policy_set_revision)When a
TelemetryCollectorresource decodes but is rejected during validation (e.g. missingpolicy_set_revision),"Decoded xDS TelemetryCollector"is logged before rejection so operators can see which policies arrived, followed by the NACKDiscoveryRequestcarryingerror_detailand the previously appliedversion_info:3. Failure Scenario B: Undecodable
google.protobuf.AnyResource (Unregistered Type URL)When
DiscoveryResponsecontains anAnywhose type URL is not in the collector's proto registry (causingprotojson.Marshalto fail),"xDS DiscoveryResponse received"logs a structured single-line JSON fallback withmarshal_errorand metadata, followed by the NACKDiscoveryRequest:Testing
Verified with
go test -race ./...inpkg/googlepolicy, includingTestXDSPolicyManager_DebugProtoJSONAndAppliedPolicyLogging.