argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.56k stars 5.35k forks source link

Large binary log output in Loki #18342

Open maggie44 opened 4 months ago

maggie44 commented 4 months ago

Checklist:

Describe the bug

When viewing the JSON logs of argocd-repo-server in Loki there is a huge binary printed in &runtime.RawExtension{Raw. I have truncated the output, but it is flooding the logs and filling up the storage.

time="2024-05-21T20:37:31Z" level=info msg="manifest cache hit: &ApplicationSource{RepoURL:registry-1.docker.io,Path:,TargetRevision:8.23.4,Helm:&ApplicationSourceHelm{ValueFiles:[],Parameters:[]HelmParameter{},ReleaseName:,Values:,FileParameters:[]HelmFileParameter{},Version:,PassCredentials:false,IgnoreMissingValueFiles:false,SkipCrds:false,ValuesObject:&runtime.RawExtension{Raw:*[123 34 ...],},},Kustomize:nil,Directory:nil,Plugin:nil,Chart:bitnamicharts/kube-prometheus,Ref:,}/8.23.4"

To Reproduce

Deploy ArgoCD to Kubernetes cluster and view the logs through Loki.

Version

v2.11.1+9f40df0

agaudreault commented 3 months ago

@maggie44 can you share you Application Manifest that correspond to this application. If your application source contains a large object, it will be reflected in the log. This code is generated automatically but might be configurable to exclude some fields:

https://github.com/argoproj/argo-cd/blob/0f72c19e31481c38774a26e8147c1e3bfd5e0ecc/pkg/apis/application/v1alpha1/generated.pb.go#L18524-L18552

Another option would be to sanitize if object before logging it.