Closed simonw closed 3 years ago
Two other questions I haven't answered for myself yet:
I figured out how to tail logs using the gcloud alpha logging tail
command - I wrote up my notes here: https://til.simonwillison.net/cloudrun/tailing-cloud-run-request-logs
Fundamentally that's where logs for all GCP products go, so it's not special.
I didn't make note of it because when you click LOGS tab on Cloud Run you get a link to the Logs Viewer UI you mentioned.
- Is there a cost associated with storing logs, or querying them, or exporting them?
- How long are logs retained for?
These are in the pricing page for Cloud Logging product, I believe.
I managed to use Cloud Run for the best part of two years before I found the logs, which is why I checked the FAQ after I found them!
IMO that's a peculiar case :) I'm inclined to think most people try to see their application logs first time they deploy –you might be an outlier. :)
Part of it might be that the other serverless providers I use, Heroku and Vercel, don't provide effectively unlimited log storage and querying - so I had a baked in assumption that serverless meant logs were an optional (likely paid) extra.
That's a fair point. It's likely the distinction is a "cloud provider" vs "PaaS provider" distinction, as all cloud platforms have their own APM suite that includes logging and all their products log there, so people expect to find logs at a centralized place.
I am not sold this warrants FAQ entry as it's pretty prominent in the Cloud Console Web UI and there are docs. :)
The section on "Monitoring and Logging" doesn't currently talk about the Logs explorer. It wasn't initially obvious to me that there were detailed logs in there - then I stumbled across https://console.cloud.google.com/logs/query;query=resource.type%3D"cloud_run_revision" and was really impressed at how much information there was.
Tips on filtering for
resource.type="cloud_run_revision"
would be useful - from there it's pretty discoverable how to filter do just request logs and then further by service name.