Google Cloud Monitoring & Logging

Google Cloud's operations suite (formerly Stackdriver) provides full-stack visibility into your applications. It helps you understand health, performance, and availability by collecting signals from your entire cloud infrastructure.

Google Cloud Monitoring & Logging

1. Cloud Monitoring (Metrics)

Monitoring is about numbers over time. It tracks metrics like CPU usage, memory consumption, and request latency to show you the "health" of your system.

  • Dashboards: Visual charts to spot trends.
  • Alerting: Notifications (Email, Slack, SMS) when a threshold is crossed (e.g., CPU > 90%).
  • Uptime Checks: Probes that check if your website is reachable from different global locations.

2. Cloud Logging (Events)

Logging is about records of events. It stores text-based records of what happened, when it happened, and who did it. It is your primary tool for debugging and auditing.

  • Log Explorer: A powerful interface to search and filter through millions of log entries.
  • Log Sinks: Export logs to BigQuery (for analysis) or Cloud Storage (for long-term archiving).
  • Audit Logs: Records of administrative actions for security compliance.
Cloud  Logging (Events)

3. Key Differences

Feature Cloud Monitoring Cloud Logging
Data TypeNumerical MetricsTextual Events/Entries
Main GoalHealth & PerformanceTroubleshooting & Auditing
Use Case"How much CPU am I using?""Why did the server crash at 2 AM?"
ResponseTriggers AlertsProvides Context for Debugging

Operations Quiz

1. Which tool would you use to see a chart of your website's traffic for the last 30 days?
A) Cloud Logging | B) Cloud Monitoring

2. If you want to find the specific error message generated during a failed login, you use:
A) Cloud Logging | B) Cloud Monitoring

3. What feature allows you to send logs to BigQuery for long-term data analysis?
A) Uptime Checks | B) Dashboards | C) Log Sinks