Cloud Monitoring in Google Cloud

Cloud Monitoring in Google Cloud

A complete, friendly guide to the service that watches your applications and infrastructure, draws their health on charts, and wakes the right person when something goes wrong: how it collects data, how to build dashboards and alerts, how to set reliability goals, and how to keep it useful and affordable.

Imagine driving a car with no dashboard. No speedometer, no fuel gauge, no warning lights. You would only learn about a problem when the car stopped moving, probably in an inconvenient place. Software without monitoring is exactly like that car. It runs happily until something breaks, and then your customers, not your tools, tell you about it.

Cloud Monitoring is the Google Cloud service that gives your systems a dashboard. It continuously collects numbers about how things are doing: how busy a server is, how fast a website answers, how many errors occur each minute. It draws those numbers as charts, checks them against rules you write, and sends a message to the right people when a rule is broken.

In this guide you will begin with the very basics of what monitoring means, then build up through metrics, dashboards, alerts, uptime checks, and reliability goals, and finish with security, cost, and real-world designs. Every new word is explained the first time it appears, with a comparison from everyday life.

1What Is Cloud Monitoring?

Before any details, let us form one clear picture of what Cloud Monitoring is, what it does, and why it matters.

Cloud Monitoring is a managed service on Google Cloud that collects, stores, displays, and analyzes metrics from your cloud resources, your applications, and even systems outside Google Cloud. A metric is simply a measurement taken again and again over time, such as “this server is using forty percent of its processor right now”.

It does four main jobs.

  • Collect: Gather measurements from many sources, automatically for Google Cloud services and with a little set-up for your own programs.
  • Show: Draw the measurements as charts and group them into dashboards that people can read at a glance.
  • Alert: Compare measurements against rules and notify people or systems when something looks wrong.
  • Judge: Track whether your service meets the reliability promises you made, using service level objectives.

You do not install or run a monitoring server. Google runs the storage, the query engine, and the alerting system. You decide what to watch and what counts as trouble.

Everyday analogy

Think of the nurse station in a hospital. Every patient has sensors for heart rate, temperature, and oxygen. The readings flow to a central screen where nurses can see everyone at once. If a reading goes outside the safe range, an alarm sounds and the right nurse comes running. Cloud Monitoring is that central screen, your applications are the patients, and the alerts are the alarms.

1000s
Built-in measurements from Google Cloud services
24/7
Watching without anyone staring at a screen
0
Monitoring servers for you to manage

What people use it for

See

Health at a glance

Dashboards showing whether servers, databases, and applications are healthy right now.

Warn

Early warning

Alerts that fire before customers notice, such as a disk that is nearly full.

Find

Troubleshooting

Looking back at charts to see exactly when a problem started and what else changed.

Plan

Capacity planning

Spotting growth trends so you add resources before you run out.

Promise

Reliability goals

Measuring whether you keep promises such as “99.9 percent of requests succeed”.

Save

Cost awareness

Noticing idle or oversized resources through their usage patterns.

i
Tip

Cloud Monitoring started life under the name Stackdriver, and the family of tools around it has been renamed more than once. Older articles may use those old names. They refer to the same family of services you will read about here.

2Monitoring Basics: The Words You Need

A small vocabulary from the world of operations makes everything else easy to follow.

Data

Metric

A named measurement, such as processor use or request count, recorded over time.

Data

Time series

The stream of values for one metric from one source, each with a time stamp. Plotted, it becomes a line on a chart.

Data

Log

A written record of an event, such as “user signed in” or “payment failed”, with a time and details.

Data

Trace

The path one request takes through many services, showing how long each stop took.

Idea

Monitoring

Watching known measurements and rules to learn when something is wrong.

Idea

Observability

How well you can understand what is happening inside a system by looking at the data it gives out: metrics, logs, and traces together.

Action

Alert

An automatic message sent when a rule is broken.

Action

Incident

A record that a problem is happening, opened by an alert and closed when it is resolved.

Action

On-call

The person responsible for responding to alerts during a given period.

Promise

SLI

Service level indicator: a measurement of how well the service is doing, such as the share of requests that succeed.

Promise

SLO

Service level objective: the target for an SLI, such as “99.9 percent over thirty days”.

Promise

SLA

Service level agreement: a formal contract with consequences, often money back, if the promise is broken.

The three pillars of observability

SignalWhat it tells youGood atWeak at
MetricsNumbers over timeSpotting that something is wrong; trends; alertsExplaining exactly why
LogsDetailed event recordsExplaining what happened in one caseSeeing big-picture trends cheaply
TracesThe journey of one requestFinding which service made a request slowLong-term trends

Cloud Monitoring is mainly about metrics, but it works hand in hand with Cloud Logging for logs and Cloud Trace for traces. Together they are often called Google Cloud’s observability tools.

Everyday analogy

Imagine a delivery company. Metrics are the overall numbers on the wall chart: parcels delivered per hour and average delay. Logs are the driver’s diary entry for each stop. Traces are the tracking history of one parcel from warehouse to doorstep. The wall chart tells you a problem exists, the tracking history shows where one parcel got stuck, and the diary explains why.

!
Good to know

Monitoring answers the questions you thought of in advance, such as “is the server busy?”. Observability aims to help you answer questions you did not think of, such as “why is this one customer’s checkout slow only on Tuesdays?”. You need both.

3A Short History and Where Monitoring Fits

Understanding how monitoring grew up explains why Cloud Monitoring looks the way it does.

01

Watching single machines

Early administrators logged into each server and looked at it by hand. Simple scripts mailed a message when a disk filled up.

02

Network monitoring tools

Tools such as Nagios polled machines on a schedule and recorded whether they answered. They were great for “is it up?” but limited for rich measurements.

03

Time-series databases and dashboards

Tools that stored measurements over time and drew colorful charts made trends easy to see. Open-source projects such as Prometheus and Grafana became popular, especially in the container world.

04

Cloud-native monitoring

As systems moved to the cloud and split into many small services, monitoring had to follow machines that appear and disappear within minutes. A managed service that knows about cloud resources became attractive.

05

Stackdriver and Cloud Operations

Google’s monitoring, logging, tracing, and error tools were brought together under one family. Over the years the family has been renamed, with the current branding being Google Cloud Observability. Check the documentation for today’s names.

06

Open standards

Support grew for Prometheus-style collection and for OpenTelemetry, a vendor-neutral way to produce metrics, logs, and traces, so that your instrumentation is not locked to one vendor.

Where Cloud Monitoring sits in Google Cloud

  • Cloud Logging stores logs, and can turn log patterns into metrics.
  • Cloud Trace follows requests across services to find slow steps.
  • Error Reporting groups similar errors from your applications into readable lists.
  • Cloud Profiler shows which parts of your code use the most processor and memory.
  • Managed Service for Prometheus collects and stores Prometheus-style metrics without you running the storage.
  • Pub/Sub, email, chat, and paging tools receive notifications.
  • Every other Google Cloud service automatically sends its metrics to Cloud Monitoring.
i
Tip

Product names, features, query languages, limits, and prices in this area change often. Use this guide to learn the ideas, and confirm current details in the official documentation before you finalize a design.

4Core Concepts of Cloud Monitoring

A handful of ideas explain how almost everything in Cloud Monitoring fits together.

What

Monitored resource

The thing being measured, such as a virtual machine, a database, a container, or a load balancer. Each type of resource has identifying labels like project, zone, and instance name.

What

Metric type

The name and meaning of a measurement, for example processor utilization of a virtual machine. Google publishes a very large catalog of these.

Detail

Labels

Extra tags on a metric that add detail, such as the response code or the region. They let you slice data, for example “errors by region”.

Data

Time series

The stream of points for one combination of metric type, resource, and label values.

Scope

Metrics scope

The set of projects whose data you can see together from one place. One project hosts the scope, and others are added to it.

View

Dashboard

A page of charts and other widgets arranged to tell a story about a system.

Rule

Alerting policy

A saved rule describing a bad situation and who to tell about it.

Route

Notification channel

A destination for alerts: email, chat, a paging service, a mobile app, a web address, or a message topic.

Check

Uptime check

A probe that regularly tries to reach your service from outside, to see whether it is up and fast.

Goal

Service and SLO

A description of something you run and the reliability target you set for it.

How a measurement is named

Every metric type has a long name that looks like a path. The first part says who owns it, and the later parts say what it measures. Google Cloud’s own metrics begin with the address of the service that produces them. Your own custom metrics live under a special custom prefix. A name such as “compute virtual machine, instance, processor utilization” tells you the service, the kind of resource, and the measurement. You do not need to memorize these. The console lets you search the catalog by plain words.

Automatic and manual

Most Google Cloud services send metrics to Cloud Monitoring on their own, with no setup, as soon as you create them. These are called system metrics or built-in metrics. Anything you add yourself, such as “orders placed per minute”, is a custom metric and needs a little work to produce.

Everyday analogy

A metric is like a thermometer reading. The monitored resource is the room it is in, the labels are the sticky notes saying “second floor, east side”, and the time series is the logbook of readings through the day. A metrics scope is the building manager’s office that has screens for several buildings at once.

i
Tip

Start by exploring metrics that already exist for the services you use. Many problems can be watched using only built-in metrics, and you can add custom ones later where you truly need them.

Retention and resolution

Measurements are not kept at full detail forever. Recent data is stored at its original sampling interval so you can zoom into a short spike. Older data is kept for a long time as well, but at a coarser resolution, which is enough for trends and capacity planning. The exact periods depend on the metric type and have changed over the years, so if you must answer questions about last year, check the documented retention for the metrics involved. If you need to keep data for a very long time or analyze it deeply, you can export it to another store such as BigQuery for further analysis.

Groups and labels for organization

As your estate grows, you will want to talk about “all the production web servers” instead of naming each one. Cloud Monitoring lets you use resource labels, user-defined labels, and groups to select sets of resources. Choosing a consistent labeling scheme for environment, team, and application on every resource pays off later, because dashboards and alerts can then filter on those labels and automatically include new resources as they are created.

5Architecture and Components

Here is the bigger picture of how measurements travel from your systems to a chart on a screen or a phone call at night.

flowchart LR
    SRC1["Google Cloud services: built-in metrics"] --> ING["Monitoring ingestion"]
    SRC2["VMs with the Ops Agent"] --> ING
    SRC3["Kubernetes with Prometheus collection"] --> ING
    SRC4["Your code with custom metrics or OpenTelemetry"] --> ING
    SRC5["Cloud Logging: log-based metrics"] --> ING
    ING --> STORE["Time-series storage"]
    STORE --> QRY["Query engine"]
    QRY --> DASH["Dashboards and Metrics Explorer"]
    QRY --> ALERT["Alerting engine"]
    ALERT --> CH["Notification channels"]
    CH --> PEOPLE["People and systems"]
    STORE --> SLO["SLO tracking"]
    
Figure 1: Data flows from many sources into one store, and from there to charts, alerts, and reliability tracking.

The main components

ComponentRoleWho manages it
IngestionReceives measurements and checks they are validGoogle
Time-series storageKeeps measurements for charting and alertingGoogle
Query engineAnswers questions about stored dataGoogle
Agents and collectorsGather measurements from machines and containersYou install them; Google maintains the software
DashboardsShow the dataYou design them
Alerting policies and channelsDetect trouble and notify peopleYou define them
Uptime checksProbe services from outsideGoogle runs the probes; you configure the targets
Services and SLOsTrack reliability promisesYou define them

Push and pull

Measurements can arrive in two ways. In push style, the thing being measured sends numbers to the monitoring system, like a patient’s sensor sending readings to the nurse station. In pull style, the monitoring system visits the thing at regular intervals and reads its numbers, like a nurse walking the ward and checking each bedside chart. Google Cloud’s built-in metrics arrive by Google’s own internal means. Agents and the Prometheus collection can scrape numbers by pulling from your applications and then send them on to Cloud Monitoring.

Everyday analogy

Think of a city weather service. Many stations around the city report temperature and wind (sources). A central office collects and stores everything (ingestion and storage). Meteorologists look at maps and charts (dashboards), and the storm warning system sends texts to people when the readings cross a danger line (alerting).

6Internal Working: From Measurement to Chart

Let us follow a single measurement on its journey, and watch what happens when it crosses an alert line.

sequenceDiagram
    participant R as Resource or Agent
    participant I as Ingestion
    participant S as Time-series Storage
    participant A as Alerting Engine
    participant N as Notification Channel
    participant P as On-call Person
    R->>I: Send measurement with labels and time
    I->>I: Validate name, labels and type
    I->>S: Store as a point in a time series
    A->>S: Evaluate policy conditions regularly
    S-->>A: Recent values
    A->>A: Condition true for the required duration?
    A->>N: Open incident and send notification
    N->>P: Email, chat message or page
    
Figure 2: One measurement from the source to a person’s phone. Charts read from the same store, so what you see is what the alert sees.

The stages in plain words

1

Measure

A resource reports a number: for example, a database says “twelve connections in use”. The report includes the metric type, the resource it came from, any labels, and the time.

2

Ingest

Cloud Monitoring checks that the report is well formed. For custom metrics, the first report can also create the metric definition automatically.

3

Store

The point is added to the right time series. Fine-grained points are kept for a while, and older data is kept at lower detail, depending on the retention rules.

4

Query

When you open a chart, the query engine reads the points, lines them up in time, and combines them as you asked, for example averaging across all servers.

5

Evaluate

The alerting engine runs each policy’s query at regular intervals and checks if the condition holds.

6

Notify

If the condition has been true long enough, an incident opens and the chosen channels receive messages. When the condition clears, the incident closes and, if set up, a recovery message is sent.

Delay, in honesty

Monitoring is close to real time but not instant. There is a small delay between something happening and its measurement being visible, and another small delay for an alert to be evaluated. For many metrics the total is on the order of a minute or two, and some metrics are reported less often than others. Do not expect second-by-second precision from every chart, and design alerts with this delay in mind.

Everyday analogy

It is like the postal service sorting office. A letter (measurement) arrives, is checked and filed in the right pigeonhole (time series), and a clerk who walks past every few minutes (alert evaluation) raises the alarm if too many urgent letters have piled up. The system is quick, but not magic.

!
Watch out

If a source stops sending data completely, a chart simply shows a gap, and a normal “too high” rule will never fire. To catch a silent failure, use a rule that treats missing data as a problem, which we cover in the alerting chapter.

7Metric Kinds, Value Types, and Time Series

Not all numbers behave alike. Knowing the kind of a metric tells you how to read and combine it correctly.

Metric kinds

KindMeaningExampleHow to think of it
GaugeA value at one instant that can go up or downMemory in use, queue length, temperatureA thermometer reading
DeltaThe change during a time intervalRequests received in the last minuteThe number of cars passing in each minute
CumulativeA running total that only grows, until a resetTotal bytes sent since the server startedA car’s odometer

Cumulative values are usually turned into a rate before you look at them. The total number of requests since last year is not very helpful, but requests per second is. Cloud Monitoring’s tools can do this conversion for you through the aligner setting, explained in the querying chapter.

Value types

Number

Integer and decimal

Whole numbers and numbers with fractions, used for counts, sizes, and percentages.

Flag

Boolean

True or false, such as whether a service is healthy.

Spread

Distribution

A summary of many values placed into buckets, such as how many requests took under 100 milliseconds, how many took under 200, and so on. Perfect for response times.

Text

String

Rarely used for metrics. Mostly for describing, not measuring.

Why distributions matter

The average hides pain. Suppose a website answers 99 requests in one tenth of a second and one request in ten seconds. The average looks fine, but one visitor had a terrible time. A distribution lets you ask about percentiles. The ninety-fifth percentile is the response time that ninety-five percent of requests beat. The ninety-ninth percentile shows the slow tail. Experts watch these tail percentiles because the slowest requests are what unhappy customers remember.

Anatomy of a time series

  • Identity: metric type, resource type, resource labels, and metric labels together identify one stream.
  • Points: each point has a value and a time, or a start and end time for interval kinds.
  • Cardinality: the number of different streams that exist. Every new combination of label values creates another stream. This number must be kept in check, as explained in the cost chapter.
Everyday analogy

A gauge is the fuel gauge: it shows how much is there now. A cumulative metric is the odometer: it only ever counts upward, and you learn about speed by seeing how fast the numbers change. A distribution is the school report showing how many students scored in each grade band, rather than just the class average.

i
Tip

When a chart of a counter looks like an ever-rising staircase, you are looking at a cumulative total. Change the aligner to a rate to see actual activity.

8Collecting Data: Many Ways In

Data can enter Cloud Monitoring in several ways. Choosing the right one for each source keeps things simple.

Automatic

Built-in system metrics

Services such as Compute Engine, Cloud Run, Cloud SQL, load balancers, and Pub/Sub report their own metrics. No setup is needed, and they are generally free to ingest.

Agent

The Ops Agent

A small program installed on virtual machines. It collects detailed machine metrics such as memory and disk use, which the hypervisor cannot see from outside, plus logs, and can be configured to collect data from common software like databases and web servers.

Containers

Managed Service for Prometheus

Collects Prometheus-style metrics from Kubernetes and other environments and stores them in Google’s own large store, so you do not run Prometheus servers yourself.

Open standard

OpenTelemetry

A vendor-neutral way for your applications to produce metrics, traces, and logs, which can then be sent to Cloud Monitoring.

Your own

Custom metrics through the API

Your programs send their own numbers directly, for example orders per minute or items in a work queue.

From logs

Log-based metrics

Cloud Logging counts log entries that match a pattern, or extracts numbers from them, and turns the result into a metric.

Outside

Other clouds and on-premises

Agents and collectors can also gather data from servers outside Google Cloud, so one place can show a mixed estate.

Log-based metrics in more detail

Sometimes the number you need is hidden in logs. For example, your application writes a log line each time a payment fails. A log-based metric counts those lines and turns the count into a time series, so you can chart it and alert on it like any other metric. There are two shapes. A counter simply counts matching entries. A distribution extracts a number from each matching entry, such as the time taken, and builds a spread of values. Google also provides some system log-based metrics automatically.

Choosing the right path

SituationBest choice
Using a Google Cloud managed serviceBuilt-in metrics. Nothing to install
Need memory and disk details of virtual machinesOps Agent
Applications already expose Prometheus-style numbersManaged Service for Prometheus
Building new instrumented applications and want portabilityOpenTelemetry
A business number your code knows, such as sign-upsCustom metric
The signal exists only as a log lineLog-based metric
Everyday analogy

Collecting data is like installing sensors in a house. Some rooms already come with smart thermostats (built-in metrics). For others you fit a small sensor (the Ops Agent). You may also ask family members to write down the garden rainfall each evening (custom metrics), and read the visitors’ book at the front door to count guests (log-based metrics).

!
Watch out

Memory and disk usage of a virtual machine are not visible to Google from outside the machine. If you want them, you need the agent. Many people wonder why these charts are empty until they install it.

Installing and trusting the Ops Agent

The Ops Agent runs as a small background service on each virtual machine. It needs two things to work: permission to write metrics and logs, which comes from the machine’s service account, and a network path to the Google Cloud interfaces. Teams with many machines usually install it by policy, so every new machine gets the agent without anyone remembering. Google provides ways to roll it out and keep it updated across a fleet. After installation, check that data appears for the new machine within a few minutes, and confirm that the agent itself is monitored, so you hear if it stops.

Sending your own numbers

When your code sends a custom metric, it must choose a name under the custom prefix, decide the kind and the value type, pick a small set of labels, and decide how often to report. A good habit is to report at a steady, modest interval and to name metrics so that a stranger can guess their meaning. A name like “orders placed” is better than “counter7”. Avoid changing the meaning of an existing metric, because history and alerts built on it will quietly become wrong.

9Metrics Explorer and Querying

Raw numbers are not very useful until you slice and combine them. This chapter shows how queries turn data into answers.

Metrics Explorer is the workbench in the console for exploring any metric. You pick a metric, choose how to filter and group it, and see a chart immediately. It is also the best place to prototype a chart before putting it on a dashboard or turning it into an alert.

The main knobs

Choose

Metric and resource

Which measurement, from which kind of thing.

Narrow

Filter

Keep only some streams, for example just the production project or just one zone.

Line up

Aligner and alignment period

How to turn the points in each time window into one value: average, maximum, rate, percentile, and so on. The alignment period is the width of each window, such as one minute.

Combine

Reducer and group by

How to merge many streams into fewer lines: sum across servers, average per region, or the highest of all.

Compare

Time shift and ratios

Compare now with the same time last week, or divide one metric by another, for example errors divided by total requests.

flowchart TD
    A["Many raw time series"] --> B["Filter: keep the streams you care about"]
    B --> C["Align: one value per time window using an aligner such as rate or mean"]
    C --> D["Reduce: combine streams using a reducer such as sum, with a group by"]
    D --> E["Result: a few clear lines"]
    E --> F["Show on a chart or use in an alert"]
    
Figure 3: How a query turns many raw streams into a few readable lines.

Query languages

The point-and-click builder covers most needs. For advanced work there are query languages. Cloud Monitoring supports PromQL, the popular query language of the Prometheus world, which lets you query both Prometheus metrics and many Google Cloud metrics. Google has also offered its own Monitoring Query Language in the past. Google’s guidance on which language is preferred has been shifting toward PromQL, so check the current documentation before investing in the older one.

Worked idea: error rate

Suppose you want to know what share of web requests are failing. You take the count of requests with an error response, aligned as a rate, summed across all servers. You do the same for all requests. Then you divide the first by the second. The result is a ratio between zero and one that you can show as a percentage. The same idea powers alerts and reliability objectives.

Everyday analogy

Imagine a huge pile of receipts from all the shops in a city. Filtering is choosing only the bakeries. Aligning is adding up each shop’s sales per day. Reducing is adding the shops together per neighborhood. The final tidy table is something a mayor can read in seconds.

i
Tip

Always check the time range and the alignment period on a chart. A very long range with a coarse period can smooth away a short but important spike.

10Dashboards: Telling the Story of a System

A good dashboard answers “is everything okay, and if not, where do I look?” in a few seconds.

Where dashboards come from

Ready

Automatic dashboards

Many Google Cloud services get ready-made dashboards that appear without any effort, showing the usual health measures.

Library

Sample dashboards

A collection of templates for popular software and services that you can install and adjust.

Yours

Custom dashboards

Dashboards you design for your own systems and teams. They can be created by hand or defined as code and shared between projects.

Common building blocks

  • Line charts for trends over time.
  • Stacked area and bar charts for showing parts of a whole, such as traffic by region.
  • Heatmaps for distributions, such as response time buckets over time.
  • Scorecards for single big numbers, such as the current error rate with a color that turns red above a threshold.
  • Gauges for a value within a range.
  • Text panels for notes, links to runbooks, and explanations.
  • Log panels and alert lists to show recent logs and open incidents beside the charts.

Designing a dashboard people use

1

Pick an audience

A dashboard for on-call engineers looks different from one for managers. Make one for each, rather than one for everyone.

2

Start with the big picture

Put overall health at the top: traffic, errors, speed, and saturation of the main service.

3

Drill down below

Further down, show details by component, so someone seeing a problem at the top can find the cause below.

4

Mark the promises

Draw threshold lines for SLO targets or alert limits so everyone sees how close they are.

5

Add context

Include text with what the system does, who owns it, and where the runbook lives.

6

Keep it small

Ten clear charts beat sixty confusing ones. Remove charts nobody looks at.

Everyday analogy

A good dashboard is like an airplane cockpit panel. The most important instruments are large and in the middle. Lesser ones are grouped nearby. Warning lights are impossible to miss. A cockpit with a thousand identical dials would be useless in an emergency.

!
Watch out

Dashboards are for people looking at them. Nobody is staring at a screen at three in the morning, so a dashboard is never a substitute for an alert on the same signal.

11Alerting Policies

Alerts turn monitoring from something you look at into something that looks after you.

An alerting policy is a saved rule with three parts: a condition that describes what bad looks like, one or more notification channels that say who hears about it, and optional documentation that explains what to do. When the condition is met, Cloud Monitoring opens an incident, and when it clears, the incident closes.

Kinds of conditions

ConditionFires whenExample
Metric thresholdA value stays above or below a limit for a given timeProcessor use above ninety percent for ten minutes
Metric absenceData stops arrivingNo heartbeat from a service for five minutes
Rate of changeA value rises or falls faster than expectedDisk usage growing very fast
ForecastA trend is predicted to cross a limit soonThe disk will be full within twenty-four hours
RatioOne metric divided by another crosses a limitFailed requests as a share of all requests above one percent
Log matchA particular log entry appearsA rare but serious error message
Uptime check failureA probe from outside cannot reach the serviceThe home page does not answer from several locations
SLO burn rateThe error budget is being used up too fastA month of allowed errors will be gone within two days
Query-based (PromQL)Any expression you can write becomes trueA custom ratio from several metrics
flowchart TD
    M["Metric is evaluated each interval"] --> C{"Condition true?"}
    C -->|"No"| OK["Healthy: nothing happens"]
    C -->|"Yes"| D{"True for the whole duration window?"}
    D -->|"No"| W["Wait and re-check"]
    D -->|"Yes"| I["Open incident"]
    I --> N["Notify channels, with documentation"]
    N --> R{"Condition cleared?"}
    R -->|"No"| K["Incident stays open, may re-notify"]
    R -->|"Yes"| X["Close incident and send recovery message"]
    
Figure 4: The decision path of an alerting policy from evaluation to closed incident.

Why “for how long” matters

Many harmless blips look like emergencies for a few seconds. A processor that jumps to ninety-five percent for one moment is normal. A processor that stays there for fifteen minutes needs attention. The duration setting makes the condition wait before firing. Longer durations mean fewer false alarms but slower reaction. Choose by asking: “how long can this be bad before a customer is hurt?”

Good alert documentation

Every alert should carry a short note that says what is wrong, why it matters, how to check it, and what to try first, with links to the dashboard and the runbook. The documentation text can include placeholders that fill in details, such as the name of the failing resource. A person woken at night should not have to guess.

Everyday analogy

An alerting policy is like a smoke detector with a sensible setting. It should not scream when you make toast (a short blip), but it must scream when smoke lingers (the duration). It should also say loudly which room, and the fire plan on the wall tells everyone what to do.

i
Tip

Alert on symptoms that users feel, such as errors and slowness, more than on every possible cause. A high processor reading is only a problem if it hurts users. Symptom alerts are fewer, clearer, and catch problems you never imagined.

Severity and ownership

Not all alerts are equal. Give each alerting policy a severity level, such as critical, error, or warning, and use it to decide the channel. A critical alert means customers are hurt right now and a person must act immediately. A warning means something is trending the wrong way and can be handled during working hours. Alongside severity, every policy should have an owner, a named team that is responsible for it. Alerts without owners become orphans: they fire, nobody feels responsible, and eventually they are ignored.

Testing your alerts

An untested alert is only a hope. You can test a policy by temporarily lowering its threshold, by sending a test notification to the channel, or by deliberately causing a harmless version of the problem in a test environment. Check not only that the notification arrives, but that it contains the right link, the right documentation, and enough information for a half-asleep person to act. Repeat such tests after big changes to the system or to the monitoring setup.

12Notification Channels and Incident Handling

An alert is only useful if it reaches the right person, in the right way, with the right urgency.

Channels

Slow

Email

Good for low-urgency information and records. Easily lost in a busy inbox.

Team

Chat tools

Post to team chat rooms so everyone sees and can discuss it.

Urgent

Paging services

Connect to on-call paging tools that call or text the person on duty and escalate if nobody answers.

Mobile

Mobile app

Push notifications from the Google Cloud app for people who monitor on the go.

Systems

Webhooks and Pub/Sub

Send a message to another program, which can open a ticket, run an automatic fix, or notify other systems.

Text

SMS

Short text messages, where available, for quick personal alerts.

Match urgency to channel. A page that wakes someone should be reserved for problems that need action right now. Warnings that can wait for morning belong in email or chat.

Life of an incident

stateDiagram-v2
    [*] --> Open: condition met
    Open --> Acknowledged: person takes ownership
    Acknowledged --> Investigating: look at dashboards and logs
    Investigating --> Mitigated: user pain stopped
    Mitigated --> Resolved: condition cleared
    Open --> Resolved: condition clears by itself
    Resolved --> Reviewed: follow-up learning
    Reviewed --> [*]
    
Figure 5: A typical path of an incident from the first alert to learning afterward.

Staying sane: noise control

  • Snoozes: Temporarily silence a policy during planned work, so the team is not flooded by expected alerts.
  • Notification rate limits: Control how often a still-open incident sends reminders.
  • Auto-close: Close incidents automatically after a period, so forgotten ones do not stay open forever.
  • Grouping: Combine related alerts into one incident, rather than ten separate ones for the same root cause.
  • Review regularly: Look at which alerts fire most and which are ignored. Fix or delete the noisy ones.

After the incident

The best teams hold a short review after serious incidents, sometimes called a postmortem. It is blameless, meaning it looks for how the system and process allowed the problem, not for a person to punish. Typical outputs are a timeline, the root cause, and actions such as a new alert, a better dashboard, or a fix to the design. This is how monitoring improves over time.

Everyday analogy

Channels are like the ways a hospital calls staff: a note on the board for routine matters, a message to the team group for shared issues, and the loud emergency pager for the real emergencies. If every message used the loud pager, doctors would soon switch it off.

!
Watch out

Alert fatigue is the single biggest danger to a monitoring system. When people get too many alerts that need no action, they begin to ignore all alerts, including the real ones. Every alert should be urgent, real, and actionable, or it should not wake anyone.

13Uptime Checks and Synthetic Monitoring

Internal numbers can look perfect while customers cannot reach your site at all. Uptime checks look at your service the way a customer does: from the outside.

An uptime check is a probe that Cloud Monitoring sends to your service at regular intervals from several places around the world. It tries to connect, and records whether it succeeded and how long it took. You can alert on failures, so you learn about an outage within minutes, even if every internal metric still looks healthy.

What a check can do

Protocol

Web and TCP checks

Request a web address over HTTP or HTTPS, or simply try to open a connection to a port.

Content

Response validation

Check the response code and look for expected text, so a page that loads but shows an error message is still caught.

Security

Certificate checks

Warn before a security certificate expires, a classic cause of embarrassing outages.

Where

Several locations

Probe from multiple regions. This helps tell a global outage apart from a local network problem.

Private

Private checks

Reach services inside a private network that the public internet cannot see, using a supported private connection.

Scripted

Synthetic monitors

Run your own small test script on a schedule, for example to log in and check a multi-step journey, and report success or failure.

flowchart LR
    P1["Probe location A"] --> SVC["Your service"]
    P2["Probe location B"] --> SVC
    P3["Probe location C"] --> SVC
    SVC --> RES["Responses and timings"]
    RES --> MON["Cloud Monitoring: uptime metrics"]
    MON --> POL{"Failing from enough locations?"}
    POL -->|"Yes"| ALERT["Alert and incident"]
    POL -->|"No"| FINE["No action"]
    
Figure 6: Probes from several places check the service, and an alert fires when enough of them fail.

Design tips

  • Point checks at a lightweight health address that actually touches the important dependencies, such as the database, so it reports real health.
  • Do not check only the home page. Include one or two important journeys, such as login or search.
  • Alert when several locations fail, not just one, to avoid false alarms from a single network hiccup.
  • Allow the probes through firewalls if your service is restricted, and take care not to expose private pages in a public check.
  • Combine external checks with internal metrics. External tells you that it is broken, and internal helps tell you why.
Everyday analogy

An uptime check is a mystery shopper. The shop manager may think everything is fine because the tills are working, but the mystery shopper actually walks in, finds the door locked, and reports back. The shopper checks in from different streets to confirm it is the shop, not the road.

!
Watch out

A health address that always returns “OK” without checking anything gives false comfort. Make sure it really tests what customers need.

What to do with the results

Uptime check results are metrics too, so you can chart them, alert on them, and include them in SLOs. Many teams build an availability indicator from them: the share of probes that succeeded over a month. Because probes come from outside, this number is close to what real visitors experience. Compare it with the internal error rate. If the outside view is much worse than the inside view, something between your servers and your visitors, such as a network setting, a certificate, or a content delivery layer, is probably at fault.

14Service Level Objectives and Error Budgets

The most mature use of monitoring is not “is the server busy?” but “are we keeping our promise to users?”

The building blocks

Measure

Service level indicator

A measurement of user experience, usually a ratio of good events to all events. For example, requests that succeeded and finished under half a second, divided by all requests.

Target

Service level objective

The goal for that indicator over a time window. For example, 99.9 percent of requests are good, measured over 30 days.

Allowance

Error budget

The small amount of failure the objective allows. If the target is 99.9 percent, the budget is the other 0.1 percent: the room you have for mistakes, releases, and experiments.

Speed

Burn rate

How fast the budget is being used compared with the planned pace. A burn rate of one means you will just run out at the end of the window. Ten means you will run out in a tenth of the time.

flowchart TD
    S["Define the service"] --> I["Choose an SLI: good events divided by all events"]
    I --> O["Set an SLO target and window"]
    O --> B["Error budget = allowed bad events"]
    B --> M["Monitor remaining budget and burn rate"]
    M --> D{"Budget healthy?"}
    D -->|"Yes"| R["Ship features and take reasonable risks"]
    D -->|"No"| F["Slow releases and focus on reliability work"]
    F --> M
    R --> M
    
Figure 7: The loop of defining a promise, measuring it, and letting the remaining budget guide decisions.

How Cloud Monitoring helps

Cloud Monitoring lets you define a service, which is a description of a thing you operate (for example a Cloud Run service, a Kubernetes workload, or a custom service), and attach one or more SLOs to it. It can calculate the indicator from built-in metrics for common service types, or from your own metrics. It then shows the current attainment, the remaining error budget, and how fast it is burning. You can create alerts on burn rate.

Why burn-rate alerts are smart

A simple alert on “error rate above one percent” can be too noisy or too slow. A burn-rate alert asks a better question: “at the current pace, will we break our promise?” Teams often use two alerts together. A fast alert catches a sudden big problem, using a short window and a high burn rate, and pages someone at once. A slow alert catches a gentle leak that would drain the budget over days, using a long window and a lower burn rate, and opens a ticket instead of paging.

AlertLooks atCatchesAction
Fast burnShort window, high burn rateSudden outages and big spikesPage someone now
Slow burnLong window, lower burn rateQuiet, steady problemsCreate a ticket for the working day

Choosing good objectives

  • Pick indicators users actually feel: availability and speed of important actions.
  • Do not aim for one hundred percent. It is nearly impossible and extremely expensive, and it leaves no room to change anything.
  • Set the target slightly better than what users will tolerate, not better than the best you have ever achieved.
  • Agree on objectives together with product owners, so the budget becomes a shared decision tool.
Everyday analogy

An error budget is like a monthly spending allowance. If you have spent only a little by mid-month, you can afford some treats, which means shipping new features. If the money is almost gone by the tenth, you stop spending and focus on essentials, which means fixing reliability. Burn rate is how quickly you are spending compared with the calendar.

i
Tip

Start with one or two SLOs for your most important user journey. A few meaningful objectives are more useful than dozens that nobody remembers.

15Metrics Scopes, Access, and Security

Monitoring data can reveal a lot about your business. Decide carefully who can see it, change it, and receive it.

Metrics scopes: one view over many projects

Most organizations have many Google Cloud projects, for example one per team or per environment. A metrics scope is the group of projects whose metrics you can see together. One project is chosen as the scoping project that hosts the scope, and other projects are added as monitored projects. From the scoping project you can build dashboards and alerts across all of them.

DesignHow it worksGood forWatch for
Each project monitors itselfEvery project is its own scopeSmall setups and strict separationNo cross-project view
One central scoping projectA dedicated project sees many othersPlatform and operations teamsLarge number of projects may need splitting
Scope per environmentSeparate scopes for production and non-productionClear separation of noisy test data from live dataMore scopes to manage
Scope per teamEach team sees only its own projectsLarge organizations with ownership boundariesShared systems need shared dashboards

Limits on how many projects one scope can hold exist, and they can change, so check the documentation when planning big estates.

Who can do what: IAM

IAM, Identity and Access Management, is Google Cloud’s system for deciding who may do what. For monitoring, roles typically fall into groups.

Read

Viewer

Can see metrics, dashboards, and alerts, but not change them. Good for most developers and managers.

Change

Editor

Can create and edit dashboards, alerting policies, and channels. Good for the people who own the monitoring setup.

Manage

Admin

Full control, including scope and access settings. Keep this group small.

Write

Metric writer

Lets a program or agent send metrics without any right to read or change anything else. This is what agents and applications need.

Practical protection

  • Least privilege: Give agents and applications only the writer permission, not editor or admin.
  • Sensitive data in labels: Never put personal data, passwords, or customer secrets into metric labels or alert text. Metrics are widely visible and long-lived.
  • Alert content: Notifications can pass through chat tools and email. Keep details short and link to the console, where access is controlled.
  • Notification channels: Treat webhooks and paging tokens as secrets. Anyone who can change a channel can redirect alerts, or silence them.
  • Audit logs: Changes to policies, channels, and access are recorded, so you can see who silenced or changed an alert.
  • Network and perimeter controls: Organizations with strict rules can include the monitoring service in a protective boundary, so data cannot easily leave.
  • Review access on a schedule, and remove people when roles change.
Everyday analogy

A metrics scope is like a control room that has screens for several buildings. The roles decide who can only watch the screens, who can rearrange them, and who can control the camera hardware. You would not give every visitor the keys to the cameras, and you would not write a customer’s home address on the wall chart.

!
Watch out

One of the quietest attacks on a system is turning off its alarms. Protect the ability to edit alerting policies and channels as carefully as you protect the systems they watch.

Separating production from everything else

Test and development systems are noisy. They restart often, break on purpose, and produce odd numbers. If their metrics and alerts mix with production in the same scope, charts become cluttered and a test failure can wake an engineer for no reason. A common arrangement keeps production in its own scope with strict access and urgent channels, while development gets a separate scope with relaxed rules and gentle channels. This also makes it easier to give developers wide access to their own environment without exposing production.

16Working with Logs, Traces, and Errors

Metrics tell you that something is wrong. Logs, traces, and error reports help you find out why. The tools are designed to be used together.

sequenceDiagram
    participant O as On-call Engineer
    participant A as Alert
    participant D as Dashboard
    participant T as Trace
    participant L as Logs
    participant E as Error Reporting
    A->>O: Error rate above threshold
    O->>D: Open dashboard, see when it started
    D-->>O: Spike after a deployment
    O->>T: Look at slow or failed requests
    T-->>O: Database call is slow in one service
    O->>L: Read logs of that service at that time
    L-->>O: Connection errors
    O->>E: Check grouped errors
    E-->>O: New error type since the release
    
Figure 8: A typical investigation moving from an alert to the underlying cause using several signals.

How the tools connect

  • Alert to dashboard: Alert notifications can link straight to relevant charts, showing the problem in context.
  • Chart to logs: From a spike on a chart you can jump to the logs from the same resource and time range.
  • Logs to metrics: Log-based metrics turn events into numbers you can chart and alert on.
  • Traces to services: Traces show the path of requests and which hop was slow.
  • Errors grouped: Error Reporting collects similar errors, counts them, and shows when each first appeared, which often points to a particular release.
  • Profiler: For code performance issues, a profiler shows which functions use the most time or memory.

The four golden signals

Site reliability engineers often recommend watching four signals for any user-facing service. They are a good starting point for dashboards and alerts.

SignalQuestionTypical measurement
LatencyHow long do requests take?Ninety-fifth and ninety-ninth percentile response time, separately for successes and failures
TrafficHow much demand is there?Requests per second
ErrorsHow many requests fail?Failed requests as a share of all requests
SaturationHow full is the system?Processor, memory, disk, connections, queue length

Two related shortcuts are often used. RED covers rate, errors, and duration for services. USE covers utilization, saturation, and errors for resources such as machines and disks.

Everyday analogy

When a doctor hears “I feel unwell” (the alert), they first check vital signs (metrics), then ask what happened today (logs), look at the path of the infection from one place to another (traces), and review known illness patterns (error grouping). No single test gives the whole answer, but together they usually do.

i
Tip

Put a trace identifier or request identifier into your log lines. It lets you move from one slow request to all the log lines it produced, in every service it touched.

17Understanding Cost and Quotas

Monitoring is not free at scale. A little understanding stops surprising bills.

How charges usually work

  • System metrics from Google Cloud services are generally free to ingest.
  • Custom, agent, external, and Prometheus metrics are typically charged based on the volume ingested, measured by data size or by the number of samples, depending on the metric source. There is usually a monthly free allowance.
  • Reading data through the programming interface beyond a free allowance may be charged.
  • Alerting policies and uptime checks can have their own pricing, such as a charge per condition or per check execution, beyond some free amount.
  • Logs in Cloud Logging, which feed log-based metrics, are charged separately by ingestion volume and retention.

Pricing structures, units, and free allowances change over time and differ by product. Always read the current pricing page and use the pricing calculator.

The cardinality trap

The biggest cost and performance risk is high cardinality: having a huge number of different time series. Each unique combination of label values creates a new stream. If you add a label such as “user identifier” or “request identifier” to a metric, you may create millions of streams, each needing storage and processing. Costs balloon, queries slow, and quotas are hit.

Label exampleDistinct valuesVerdict
RegionA handfulFine
Response code class (2xx, 4xx, 5xx)A fewFine
Service nameDozensFine
Customer identifierThousands or moreRisky. Use only if truly needed
User identifier or request identifierMillionsNever as a metric label. Put in logs or traces instead

Ways to lower the bill

Fewer

Keep labels small

Use labels with a limited set of values. Put unbounded details in logs.

Less

Reduce collection frequency

Not every metric needs to be sampled every few seconds. A minute is fine for many.

Filter

Exclude unneeded metrics

Configure agents and collectors to skip metrics nobody uses.

Clean

Remove unused alerts, checks, and dashboards

Old policies and probes cost money and add noise.

Watch

Budgets and usage views

Check the usage page for the biggest sources of ingestion and set budget alerts.

Choose

Use built-in first

System metrics are free, so use them before inventing custom ones that duplicate them.

Quotas and limits

Cloud Monitoring has limits, such as the number of alerting policies per project, conditions per policy, notification channels, custom metric descriptors, label counts per metric, and the rate of writes and reads. These change over time. Check the quotas page, set alerts as you approach limits, and request increases early when you expect growth.

Everyday analogy

Cardinality is like keeping a separate notebook for every single customer who walks into a shop. A few notebooks for “regulars”, “tourists”, and “online orders” are easy to manage. A notebook for every person ever seen would fill the building.

!
Warning

A single careless label in one popular metric can multiply costs overnight. Review new custom metrics before release, and watch ingestion volume after deployments.

18Advantages, Disadvantages, Trade-offs, and Alternatives

No tool is right for everyone. An honest comparison helps you decide when Cloud Monitoring fits.

Advantages

  • Fully managed: no monitoring servers to run, patch, or scale.
  • Built-in metrics for most Google Cloud services with no setup.
  • One place for metrics, alerts, uptime checks, and reliability objectives.
  • Works with logs, traces, and error reporting in the same family.
  • Supports Prometheus and OpenTelemetry, reducing lock-in.
  • Metrics scopes allow a single view over many projects.
  • Handles large volumes and long retention without storage planning.
  • Can monitor systems outside Google Cloud as well.

Disadvantages

  • Costs can grow with custom metrics and high cardinality.
  • Some metrics arrive with a delay, so it is not a tool for second-by-second control.
  • Dashboards and alert tuning take effort and care.
  • Query language options have changed over time, which can confuse learners.
  • Most natural for Google Cloud. Elsewhere you need agents and more setup.
  • Product names and features have been renamed several times.
  • Advanced analytics such as anomaly detection are more limited than in some specialist products.

Key trade-offs

ChoiceOne sideOther side
Detail versus costMore labels and frequent samples give detailFewer labels and slower sampling cost less
Sensitivity versus noiseTight thresholds catch problems earlyLoose thresholds cause fewer false alarms
Managed versus self-runNo operations workSelf-run open-source tools allow deep customization
One vendor versus manyAll tools in one place and tightly integratedBest-of-breed tools for specific needs but more integration work
Central versus per-team viewsA central view helps platform teamsPer-team views give ownership and privacy

Alternatives to consider

  • Prometheus with Grafana, self-run, is the popular open-source choice for containers. You manage storage and scaling yourself, or use Google’s managed Prometheus service to avoid that.
  • Datadog, New Relic, Dynatrace, Splunk Observability and similar commercial platforms offer rich analysis and many integrations across clouds, usually at a higher price.
  • Amazon CloudWatch and Azure Monitor are the native equivalents on other clouds, useful if you run mainly there.
  • The Elastic stack and OpenSearch are strong for logs and search, with some metrics support.
  • Zabbix and Nagios are long-standing tools for traditional infrastructure monitoring.

Many organizations mix tools. A common pattern is to use Cloud Monitoring for Google Cloud metrics and alerts, and a dedicated vendor tool for deep application analysis, with OpenTelemetry keeping the instrumentation portable.

Everyday analogy

Choosing a monitoring tool is like choosing home security. A service from your landlord, already wired into the building, is convenient (Cloud Monitoring on Google Cloud). A custom system you install and maintain yourself gives control but costs time (self-run open source). A premium service with cameras and analysts costs more but offers extras (commercial platforms).

19Design Patterns and Anti-patterns

Teams who run production systems for years end up repeating the same good ideas, and avoiding the same bad ones.

Patterns that work

Pattern

Golden signals first

Begin every service with latency, traffic, errors, and saturation before adding anything else.

Pattern

Alert on symptoms

Page for what users feel, and use causes only for dashboards and tickets.

Pattern

SLO-driven alerting

Use burn-rate alerts so pages mean “a promise is at risk”.

Pattern

Runbook in every alert

Each alert links to what it means and what to try first.

Pattern

Monitoring as code

Define dashboards, policies, and channels in version-controlled files, so they are reviewed and repeatable.

Pattern

Tiered urgency

Pages for urgent matters, chat messages for important ones, tickets for slow burns.

Pattern

Black-box plus white-box

Combine outside-in uptime checks with inside-out internal metrics.

Pattern

Dead man’s switch

A regular heartbeat metric with an absence alert, so silence of the monitoring pipeline itself is noticed.

Pattern

Review and prune

Regularly look at noisy alerts and unused dashboards and fix or remove them.

Anti-patterns to avoid

Anti-patternWhy it hurtsBetter approach
Alerting on every metricFloods people with noiseAlert on user-visible symptoms
Averages onlyHide the slow tail that unhappy users experienceUse percentiles and distributions
Alerts with no actionTeaches people to ignore alertsEvery alert needs an owner and a next step
Dashboard as the only warningNobody is watching at nightPair important charts with alerts
High-cardinality labelsCost and slownessKeep labels small; use logs for identifiers
Thresholds copied from another systemWrong for your normal behaviorBase limits on your own history and SLOs
Everything pages the same personBurnout and single point of failureUse rotations and escalation
No monitoring of the monitoringA silent failure goes unnoticedHeartbeats and absence alerts
Only internal checksMisses outages visible only to usersAdd external uptime checks
Manual console clicking onlyDrift and unrepeatable setupsDefine configuration as code
Everyday analogy

Good patterns are like the habits of a well-run ship: a clear watch rotation, instruments that matter on the bridge, a drill for every emergency, and a rule that the alarm bell must mean something. Anti-patterns are an alarm that rings for every wave until the crew stops looking up.

Making alerts self-explaining

A well-designed alert message answers five questions without opening anything: what is wrong, how bad it is, since when, where it is happening, and what to do first. Include the name of the service, the region or cluster, the current value and the limit, a link to the dashboard, and a link to the runbook. Use plain words, not codes known only to the author. A message such as “Checkout error share is 6 percent, above the 2 percent limit for 10 minutes, in the Mumbai region; open the checkout dashboard and the rollback guide” saves minutes in a real incident.

20Best Practices, Common Mistakes, and Troubleshooting

A checklist of good habits, a list of beginner mistakes, and a map of what to try when monitoring itself misbehaves.

Best practices

  • Start with built-in metrics and uptime checks, then add custom metrics where you have real questions.
  • Use the four golden signals for every user-facing service.
  • Define one or two SLOs for key user journeys and alert on burn rate.
  • Give every alert a clear name, a severity, an owner, and documentation with a runbook link.
  • Choose durations that filter blips but still protect users.
  • Route by urgency: page, chat, or ticket.
  • Use percentiles for latency, not just averages.
  • Keep labels low-cardinality and never put personal data in them.
  • Install the Ops Agent on virtual machines where you need memory and disk detail.
  • Define dashboards and alerts as code and review changes.
  • Monitor the monitoring: heartbeats, absence alerts, and notification channel tests.
  • Review alerts and dashboards on a schedule, and delete what is unused.
  • Keep an eye on ingestion volume and budgets.

Common beginner mistakes

Mistake

No alert on missing data

A crashed service stops reporting, so a “too high” rule never fires.

Mistake

Alert without notification

The policy is correct, but no channel is attached, so nobody hears it.

Mistake

Wrong aligner for counters

Charting a running total and wondering why the line only climbs.

Mistake

Duration too short

Alerts fire for every brief spike and train people to ignore them.

Mistake

Alerts sent to one person

That person is on holiday or asleep, and nobody else is told.

Mistake

Too many labels

A new label explodes the number of streams and the bill.

Troubleshooting guide

SymptomLikely causesWhat to try
Chart shows no dataWrong project or scope, wrong time range, filter too narrow, metric not enabledCheck the scope, widen the filter and range, confirm the resource is sending data
Memory or disk charts empty on a virtual machineAgent not installed or not runningInstall or restart the Ops Agent and check its permissions
Custom metric not appearingWriter lacks permission, wrong metric name format, wrong resource typeCheck the writer role and read API errors
Alert never firesThreshold or duration wrong, metric gaps, wrong filterTest the query in Metrics Explorer, add an absence condition
Alert fires too oftenDuration too short, threshold too tight, flapping valueLengthen the duration, use rates or percentiles, adjust the limit
No notification receivedChannel not verified, email in spam, webhook failing, snooze activeSend a test notification, check channel status and snoozes
Uptime check failing from some placesFirewall blocks probe addresses, regional issue, slow responseAllow the probe addresses and compare locations
Bill suddenly higherNew high-cardinality label, new verbose metric source, extra checksOpen the usage view, find the top metric, trim labels or collection
Queries are slowVery wide time range, many streams, heavy groupingNarrow the range, filter earlier, reduce streams
Wrong numbers on a ratioDifferent alignment periods or filters in numerator and denominatorUse the same filters and aligner settings for both parts
i
Tip

Test alerts on purpose. Create a harmless condition, trigger it, and confirm the right person receives the right message. An alert you have never tested is only a hope.

21Monitoring Common Google Cloud Services

Each kind of service has a few measurements that matter most. Here is a starter list you can adapt.

ServiceWatch theseTypical worry
Compute Engine virtual machinesProcessor use, memory (needs agent), disk space and input-output, network, uptimeOverload, full disks, crashed machines
Google Kubernetes EngineNode and pod resource use, restarts, pending pods, request rate and errors, cluster healthCrash loops, resource starvation, failed scheduling
Cloud RunRequest count, latency percentiles, error responses, instance count, concurrency, memory and processor useCold starts, errors after a release, hitting scaling limits
Cloud SQL and databasesConnections, processor, memory, disk, replication lag, slow queriesConnection exhaustion, disk full, lag between copies
Load balancersRequest rate, response codes, backend latency, healthy backend countBackends marked unhealthy, rising error share
Pub/SubOldest unacknowledged message age, backlog size, publish and delivery errorsConsumers falling behind
Cloud StorageRequest count, error rate, bytes stored and transferredUnexpected spikes in access or cost
BigQuerySlots used, query time, bytes processed, job errorsSlow or expensive queries
Cloud FunctionsExecutions, duration, errors, memory useTimeouts and rising error counts

A starter recipe for a new service

1

Check the automatic dashboard

Open the ready-made dashboard for the service and see what it already provides.

2

Add an uptime check

Probe the public address or health endpoint from several regions, including certificate expiry.

3

Create symptom alerts

One for error share, one for slow responses at the high percentiles, and one for missing data.

4

Add saturation warnings

Gentle warnings, sent to chat or tickets, for disks, queues, and connection pools filling up.

5

Define an SLO

Choose a success-and-speed indicator for the main user journey and a realistic target.

6

Write the runbook

A short page with how to check, how to roll back, and who to ask. Link it from every alert.

Everyday analogy

Different vehicles need different gauges: a bicycle needs little, a car needs fuel and temperature, an airplane needs a cockpit full of instruments. Each Google Cloud service has its own few gauges that matter. Learn those first rather than watching everything.

22Real-World Scenarios and a Decision Record

These illustrative situations show how the ideas combine. They are examples to learn from, not claims about any real company.

Scenario 1: A small online shop

Need: Two developers run a shop on Cloud Run with a managed database and want to know quickly if checkout breaks.

Approach: An uptime check on the home page and on a health address, an alert on server error share and on slow responses, a log-based metric counting failed payments, and a chat channel for warnings with one phone channel for urgent problems.

Lesson: A handful of well-chosen alerts beats a wall of charts. Include the business signal, such as payments, not just technical ones.

Scenario 2: Dozens of microservices on Kubernetes

Need: Many teams run services on shared clusters, and a platform team needs to see everything while each team wants its own view.

Approach: Managed Prometheus for collection, a central scoping project for the platform team, per-team dashboards and policies defined as code, and SLO burn-rate alerts for each team’s main service.

Lesson: Standard templates make monitoring repeatable across teams, while scopes give both central and local views.

Scenario 3: A data pipeline that must finish by morning

Need: A nightly pipeline loads data that the business reads at eight o’clock. Failures are silent until someone complains.

Approach: The pipeline writes a custom metric with the time of its last successful finish. An alert fires if that time is older than expected by a set hour, and a second alert fires if the metric disappears.

Lesson: Monitor outcomes and freshness of work, not just whether machines are alive.

Scenario 4: Reducing alert fatigue

Need: An on-call team gets hundreds of alerts per week and most need no action.

Approach: Export a list of alerts by frequency, delete or downgrade those never acted on, lengthen durations, replace cause-based pages with symptom-based and burn-rate alerts, and add runbooks to what remains.

Lesson: Fewer, better alerts give faster responses and happier people.

An example decision record

ADR-01Accepted
Context

A company with about forty services across eight Google Cloud projects uses a mix of home-grown scripts and a self-run monitoring server that frequently runs out of disk. On-call engineers receive many noisy alerts and have no consistent view of reliability.

Decision

Adopt Cloud Monitoring as the main platform. Use a central scoping project for the operations team and per-environment scopes. Collect container metrics with managed Prometheus, install the Ops Agent on virtual machines, and add uptime checks for every public endpoint. Define SLOs for the five most important user journeys with fast and slow burn-rate alerts. Keep all dashboards and policies as code. Page only for symptom alerts that have runbooks.

Alternatives considered

Keeping the self-run server was rejected due to ongoing maintenance and capacity problems. A commercial observability platform was considered, but the team preferred to start with native integration and keep the instrumentation portable through OpenTelemetry in case the choice is revisited.

Consequences

No monitoring servers to operate and a shared view across projects. The team must learn the query language, manage metric cardinality, and watch ingestion costs. Alert counts are expected to drop sharply, and a quarterly review is scheduled to prune alerts and dashboards.

Scenario 5: Preparing for a big sales event

Need: A retailer expects ten times its normal traffic on a sale day and wants to avoid surprises.

Approach: Weeks earlier the team reviews the saturation metrics of every component, runs a load test while watching dashboards, raises quotas and scaling limits where charts show headroom is thin, tightens alert durations for the event, and sets up a temporary shared dashboard for a war-room screen. Afterward, they compare actual traffic with predictions and keep the dashboard for the next event.

Lesson: Monitoring is not only for fixing problems. It is also how you prove you are ready before a big day.

23Frequently Asked Questions

Short answers to the questions people ask most.

Q1 Do I need to install anything to use Cloud Monitoring?

For most Google Cloud services, no. Built-in metrics arrive automatically. You install the Ops Agent on virtual machines if you want memory and disk detail, and you add collectors or code for custom and Prometheus metrics.

Q2 What is the difference between Cloud Monitoring and Cloud Logging?

Monitoring is about numbers over time and the alerts built on them. Logging stores detailed event records. They are linked: logs can become metrics, and charts can jump to related logs.

Q3 How long is data kept?

Metric data is kept for a long period, with older data stored at lower detail. Exact retention depends on the metric type and can change, so check the documentation if you need long history.

Q4 Can it monitor things outside Google Cloud?

Yes. Agents and collectors can send metrics from other clouds and from on-premises servers, and uptime checks can probe any public address.

Q5 What is the Ops Agent?

A small program for virtual machines that collects detailed machine metrics and logs and sends them to Google Cloud. It replaced the older separate monitoring and logging agents.

Q6 What is a metrics scope?

The group of projects whose monitoring data you can view and alert on together from one scoping project. It is how you get a single view across many projects.

Q7 Why did my alert not fire?

Common reasons are a duration that is too long, a filter that does not match, missing data (which a threshold rule ignores), or a snooze. Test the same query in Metrics Explorer and add an absence condition.

Q8 Which is better, a threshold alert or an SLO alert?

They serve different purposes. Threshold alerts are simple and good for resource limits such as disks. SLO burn-rate alerts are better for user-facing reliability because they page only when a promise is at risk.

Q9 What is cardinality and why should I care?

It is the number of distinct time series a metric creates, driven by label values. High cardinality raises cost, slows queries, and can hit limits. Keep labels to small sets of values.

Q10 Which query language should I learn?

Start with the point-and-click builder. For advanced queries, PromQL is widely used and increasingly favored. Check the current documentation for the status of Google’s own Monitoring Query Language.

Q11 Can I create dashboards and alerts as code?

Yes. You can define them in files and manage them through the programming interface, the command-line tool, or infrastructure-as-code tools, which makes them reviewable and repeatable.

Q12 How do I avoid being flooded with alerts?

Alert on symptoms, set sensible durations, use burn-rate alerts, group related alerts, route by urgency, use snoozes during planned work, and review noisy alerts regularly.

Q13 Is it free?

Built-in system metrics are generally free, and there are free allowances for other usage. Custom, agent, and Prometheus metrics, some alert and check usage, and related logging can be charged. Check the current pricing page.

Q14 Can alerts trigger automatic fixes?

Yes, through webhook or Pub/Sub channels that call a program, which can restart a service or open a ticket. Be careful to build in safeguards, so an automatic fix cannot make a problem worse.

Q15 Where should I start?

Open the ready-made dashboard for a service you run, add an uptime check, create an alert on errors and another on missing data, connect a notification channel, and test it. Then add an SLO and refine from experience.

Q16 How often should I review my alerts?

A good rhythm is a short review every month or quarter. Look at which alerts fired most, which led to action, and which were ignored. Delete or fix the useless ones, and add alerts for any incident that was found by customers first.

Q17 Should every team have its own project for monitoring?

Not necessarily. Many organizations use one scoping project per environment or per group of teams, and rely on labels and access roles to keep views separate. Choose based on ownership, privacy needs, and how many projects you must see together.

Q18 Can I see Google Cloud service health problems in Cloud Monitoring?

Google publishes information about incidents affecting its own services in separate health pages and notifications. It is wise to subscribe to those too, so you can tell whether a problem comes from your code or from the platform.

Q19 What if my monitoring itself fails?

Plan for it. Use a heartbeat metric with an absence alert, an external uptime check on the most important service, and a second independent way to be contacted for the worst cases. Test that those paths work.

Q20 Do I need all of this on day one?

No. Start with built-in dashboards, one uptime check, and two or three symptom alerts. Add SLOs, custom metrics, and code-based configuration as your system and team grow.

24Summary and Key Takeaways

You began with a car that had no dashboard and ended with charts, alerts, uptime checks, and reliability promises. Here is the journey in a few lines.

Cloud Monitoring is Google Cloud’s managed service for collecting, storing, showing, and acting on measurements. Built-in metrics arrive automatically, the Ops Agent, Prometheus, OpenTelemetry, custom metrics, and log-based metrics fill the gaps. Metrics Explorer and dashboards turn raw streams into understanding. Alerting policies, notification channels, and incident handling make sure the right person hears about trouble. Uptime checks look from the outside, and service level objectives with error budgets measure what really matters, whether users are happy. Metrics scopes give one view across many projects, IAM protects who can see and change things, and careful label design keeps cost under control. Throughout, fewer and better alerts beat many noisy ones.

Because product names, query languages, limits, free allowances, and prices change from time to time, confirm the current details in the official Google Cloud documentation before you finalize your design.

Good monitoring is quiet most of the time. When it speaks, it tells the right person what is wrong, why it matters, and where to look first.

Key Takeaways

  • Cloud Monitoring collects metrics from Google Cloud automatically and from your own systems through the Ops Agent, Prometheus, OpenTelemetry, custom metrics, and log-based metrics.
  • Understand metric kinds and use percentiles for latency, because averages hide the slow tail that users remember.
  • Alert on symptoms users feel, with sensible durations, documentation, and the right channel for each level of urgency. Also alert on missing data.
  • Add external uptime checks from several locations, and combine them with internal metrics to see both that something is broken and why.
  • Define SLOs and watch error budget burn rate, so pages mean a promise is truly at risk and the budget guides release decisions.
  • Use metrics scopes and least-privilege IAM, keep personal data out of labels, and protect the ability to change alerts.
  • Control cost by keeping label cardinality low, trimming unused metrics and alerts, and reviewing ingestion regularly.