Todas las muestras de código de Monitoring

This page contains code samples for Cloud Monitoring. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.

Back up policies

Demonstrates how to back up alerting policies.

View in documentation

Bulk enable policies that match a filter

Demonstrates how to bulk enable the alerting policies that match a filter.

View in documentation

Create a custom metric

Demonstrates how to create a custom metric.

View in documentation

Create a notification channel

Demonstrates how to create new notification channels, in the context of recreating policies from a backup.

Create an alerting policy, in the context of recreating policies from a backup.

Demonstrates how to create an alerting policy.

View in documentation

Create an uptime check

Demonstrates how to create an uptime check.

View in documentation

Delete a custom metric

Demonstrates how to delete a custom metric.

View in documentation

Delete a notification channel

Demonstrates how to delete a notification channel.

Delete an uptime check

Demonstrates how to delete an uptime check config.

View in documentation

Get a metric descriptor

Demonstrates how to get the details of a metric descriptor.

View in documentation

Get a monitored resource

Demonstrates how to get the details of a monitored resource.

View in documentation

Get an uptime check

Demonstrates how to get details of an uptime check config.

View in documentation

List alerting policies

Demonstrates how to list alerting policies.

View in documentation

List metric descriptors

Demonstrates how to list available metric descriptors.

View in documentation

List monitored resources

Demonstrates how to list monitored resources.

View in documentation

List notification channels

Demonstrates how to list notification channels.

List uptime check IP addresses

Demonstrates how to list uptime check IP addresses.

View in documentation

List uptime checks

Demonstrates how to list uptime check configs.

View in documentation

List VM instances generating metric data

Demonstrates how to list VMs that have time series data that match a given filter.

View in documentation

Read aggregated metric data

Demonstrates how to read reduced time series data.

View in documentation

Read metric data

Demonstrates how to read time series data.

View in documentation

Read metric data aligned by mean

Demonstrates how to read time series data aligned by mean.

View in documentation

Replace notification channels

Demonstrates how to replace notification channels across alerting policies.

View in documentation

Restore policies

Demonstrates how to restore alerting policies.

View in documentation

Set up an OpenCensus exporter

Samples for setting up the Cloud Monitoring exporter.

Update a notification channel

Demonstrates how to update a notification channel.

Update an uptime check

Change an update check.

View in documentation

Using the client libraries

Demonstrates how to write time series data to custom sales metrics.

View in documentation

Write metric data

Demonstrates how to write time series data.

View in documentation

Write metrics with OpenCensus

Demonstrates how to write metrics with OpenCensus.

View in documentation