ahmetb / cloud-run-faq

Unofficial FAQ and everything you've been wondering about Google Cloud Run.
https://cloud.run
Creative Commons Attribution 4.0 International
2.32k stars 124 forks source link

Suggestion for expanding the logging section #153

Closed simonw closed 3 years ago

simonw commented 3 years ago

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.

simonw commented 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

ahmetb commented 3 years ago

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.

simonw commented 3 years ago

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!

ahmetb commented 3 years ago

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. :)

simonw commented 3 years ago

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.

ahmetb commented 3 years ago

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. :)