Skip to content

Chapter 7 of 11

Observability: Monitoring and Logging

Use current Google Cloud Observability services for metrics, logs, traces, errors, and alerts.

42 minutes 10 quick checksBy Subha Prasad
Lesson 7 of 11Course navigation

Lesson content

Read, practise, then check your understanding

Observability: Monitoring and Logging

Stackdriver is the former brand for what is now Google Cloud Observability. The current suite includes Cloud Monitoring, Cloud Logging, Cloud Trace, Error Reporting, and related capabilities. Current vocabulary matters when learners search documentation or configure agents.

Core ideas

  • Cloud Monitoring stores metrics and supports dashboards, uptime checks, service monitoring, and alert policies.
  • Cloud Logging stores, searches, routes, and analyzes log entries.
  • Log-based metrics convert matching logs into numeric series for visualization and alerting.
  • The Ops Agent collects supported VM logs and metrics; OpenTelemetry supports portable application instrumentation.

Design and operating model

Define service-level indicators from user outcomes, emit structured logs with trace correlation, instrument latency and errors, create log sinks and retention from policy, and build actionable alert policies. Route central security logs to a protected project and restrict who can alter sinks.

Example

gcloud logging read \
  'resource.type="cloud_run_revision" AND severity>=ERROR' \
  --freshness=30m \
  --limit=20 \
  --format='table(timestamp,resource.labels.service_name,textPayload)'

gcloud monitoring policies list --format='table(displayName,enabled)'

Run examples in a disposable training project. Replace project IDs, Regions, identities, resource names, sizes, and policies with reviewed values, and verify current Google Cloud CLI and service requirements before production use.

Production guidance

  • Avoid unbounded labels and high-cardinality metrics that increase cost and reduce usability.
  • Give every alert an owner, severity, notification route, recovery condition, and runbook.
  • Monitor telemetry ingestion, sinks, exclusions, agent health, retention, and alert delivery itself.

The chapter quiz follows the lesson and checks both service vocabulary and architecture decisions.

Knowledge check

Answer every question correctly to complete this chapter.

Which statement correctly describes Google Cloud Observability?
Which term matches this explanation: The current suite name for monitoring, logging, tracing, profiling, and error capabilities formerly branded Stackdriver.
Which statement correctly describes Cloud Monitoring?
Which term matches this explanation: A service collecting metrics and supporting dashboards, uptime checks, and alerts.
Which statement correctly describes Cloud Logging?
Which term matches this explanation: A managed system for storing, searching, routing, and analyzing logs.
Which statement correctly describes log-based metric?
Which term matches this explanation: A metric derived from matching log entries.
Which statement correctly describes alerting policy?
Which term matches this explanation: Conditions and notification behavior used to detect unhealthy signals.

0 of 10 checks passed

Your progress is saved on this device.