Skip to content

don't log raw bytes #3673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rbtr opened this issue May 19, 2025 · 0 comments · May be fixed by #3674
Open

don't log raw bytes #3673

rbtr opened this issue May 19, 2025 · 0 comments · May be fixed by #3674
Assignees
Labels
bug cns Related to CNS.

Comments

@rbtr
Copy link
Contributor

rbtr commented May 19, 2025

Request response logging in cns uses +v on structs with raw bytes which produces very hard to read nonsesne. Those bytes are really json.RawMessage which supports serializing to json so do that instead. Here's an example.

024/12/04 19:57:22 [1] [azure-cnsrequestIPConfigsHandler] Code:FailedToAllocateIpConfig, {DesiredIPAddre
sses:[] PodInterfaceID:c34a4c61-eth0 InfraContainerID:c34a4c61b6b2173f7cb62945a3e9f00ea33b99e4aa6b283e714
b095b7875a87b OrchestratorContext:[123 34 80 111 100 78 97 109 101 34 58 34 122 116 117 110 110 101 108 4
5 57 122 54 55 100 34 44 34 80 111 100 78 97 109 101 115 112 97 99 101 34 58 34 105 115 116 105 111 45 11
5 121 115 116 101 109 34 125] Ifname: SecondaryInterfacesExist:false}, &{PodIPInfo:[{PodIPConfig:{IPAddre
ss: PrefixLength:0} NetworkContainerPrimaryIPConfig:{IPSubnet:{IPAddress: PrefixLength:0} DNSServers:[] G
atewayIPAddress:} HostPrimaryIPInfo:{Gateway: PrimaryIP: Subnet:} NICType: InterfaceName: MacAddress: Ski
pDefaultRoutes:false Routes:[]}] Response:{ReturnCode:FailedToAllocateIpConfig Message:AllocateIPConfig f
ailed: not enough IPs available for 6d10e7dd-184d-4595-b598-baeba084761f, waiting on Azure CNS to allocat
e more with NC Status: , IP config request is {[] c34a4c61-eth0 c34a4c61b6b2173f7cb62945a3e9f00ea33b99e4a
a6b283e714b095b7875a87b [123 34 80 111 100 78 97 109 101 34 58 34 122 116 117 110 110 101 108 45 57 122 5
4 55 100 34 44 34 80 111 100 78 97 109 101 115 112 97 99 101 34 58 34 105 115 116 105 111 45 115 121 115
116 101 109 34 125] false}}}.

A fix was proposed in #3249 but is stale and needs to be updated.

@rbtr rbtr added bug cns Related to CNS. labels May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cns Related to CNS.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant