Open Henery309 opened 3 years ago
Your analysis is correct. We recommend doing the same for distributed traces. 
@ahmetb what if we mark the container as keep warm. If we try to send logs after request has finished will they be dropped?
Warm containers don't mean their cpu is allocated. So you can still lose logs if they're not getting requests when the log flush timer fires.
Hi I am working on a POC for cloud run to use in our app.
I came across 1 interesting use case. The docs for google cloud logging suggest that for high throughput applications we should avoid awaiting when logging (background process takes care of it).
From my understanding - once a request is completed cloud run will immediately throttle the CPU in which case the pending logging request will be dropped. Are we able to flush the logs after the request has completed or do we have to log before returning the response? Logging request takes approximately 300ms adding this time onto the request would be an issue.
Cloud Logging Docs