Ruby Client for the Cloud Monitoring V3 API
Manages your Cloud Monitoring data and configurations.
Cloud Monitoring collects metrics, events, and metadata from Google Cloud, Amazon Web Services (AWS), hosted uptime probes, and application instrumentation.
This gem is a versioned client. It provides basic client classes for a specific version of the Cloud Monitoring V3 API. Most users should consider using the main client gem, google-cloud-monitoring. See the section below titled Which client should I use? for more information.
$ gem install google-cloud-monitoring-v3
Before You Begin
In order to use this library, you first need to go through the following steps:
- Select or create a Cloud Platform project.
- Enable billing for your project.
- Enable the API.
- Set up authentication.
require "google/cloud/monitoring/v3" client = ::Google::Cloud::Monitoring::V3::AlertPolicyService::Client.new request = ::Google::Cloud::Monitoring::V3::ListAlertPoliciesRequest.new # (request fields as keyword arguments...) response = client.list_alert_policies request
View the Client Library Documentation for class and method documentation.
See also the Product Documentation for general usage information.
To enable logging for this library, set the logger for the underlying gRPC library.
The logger that you set may be a Ruby stdlib
Logger as shown below,
that will write logs to Cloud Logging. See grpc/logconfig.rb
and the gRPC spec_helper.rb for additional information.
Configuring a Ruby stdlib logger:
require "logger" module MyLogger LOGGER = Logger.new $stderr, level: Logger::WARN def logger LOGGER end end # Define a gRPC module-level logger method before grpc/logconfig.rb loads. module GRPC extend MyLogger end