gchux / cloud-run-tcpdump

Cloud Run packet capturing sidecar
Apache License 2.0
6 stars 0 forks source link

RemoveGAE json writer creation failure log for Cloud Run services #8

Closed thomasmburke closed 1 month ago

thomasmburke commented 1 month ago

jsondump GAE json writer creation failed: error shouldn't be logged when sidecar is run on Cloud Run

It seems we just need to omit this log if gaeDisabledErr is the writerErr

gchux commented 1 month ago

agreed, seems like the current condition is not enough:

https://github.com/gchux/cloud-run-tcpdump/blob/v1.0.0-rc55/tcpdumpw/main.go#L324-L325

the correct one should be using isGAE

so it should be something like this:

if isGAE && writerErr != nil

gchux commented 1 month ago

this one along side #7 will be addressed with release v1.0.0 when we go out of release candidate cycles.

gchux commented 1 month ago

fix: https://github.com/gchux/cloud-run-tcpdump/blob/bug/fix/tcpdumpw/main.go#L333-L335

rationale: if there is an error, but isGAE==false then the error must be gaeDisabledErr so it is safe to skip the error message