# Cloud Monitoring V3 API - Class Google::Cloud::Monitoring::V3::MetricService::Client (v1.10.0)

1.10.0 (latest) 1.9.0 1.8.0 1.7.1 1.6.1 1.5.1 1.4.0 1.3.0 1.2.0 1.1.0 1.0.1 0.18.0 0.17.0 0.16.0 0.15.2 0.14.0 0.13.0 0.12.1 0.11.0 0.10.0 0.9.0 0.8.0 0.7.1 Reference documentation and code samples for the Cloud Monitoring V3 API class Google::Cloud::Monitoring::V3::MetricService::Client.

Client for the MetricService service.


<br />

Manages metric descriptors, monitored resource descriptors, and
time series data.

## Inherits

- Object

## Includes

- [Google::Cloud::Monitoring::V3::MetricService::Paths](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Paths)

## Methods

### .configure

    def self.configure() { |config| ... } -> Client::Configuration

Configure the MetricService Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client-Configuration "Google::Cloud::Monitoring::V3::MetricService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client-Configuration))
**Example**

```ruby
# Modify the configuration for all MetricService clients
::Google::Cloud::Monitoring::V3::MetricService::Client.configure do |config|
  config.timeout = 10.0
end
```

### #configure

    def configure() { |config| ... } -> Client::Configuration

Configure the MetricService Client instance.


The configuration is set to the derived mode, meaning that values can be changed,
but structural changes (adding new fields, etc.) are not allowed. Structural changes
should be made on [Client.configure](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client#Google__Cloud__Monitoring__V3__MetricService__Client_configure_class_ "Google::Cloud::Monitoring::V3::MetricService::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client-Configuration "Google::Cloud::Monitoring::V3::MetricService::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client-Configuration))

### #create_metric_descriptor

    def create_metric_descriptor(request, options = nil) -> ::Google::Api::MetricDescriptor
    def create_metric_descriptor(name: nil, metric_descriptor: nil) -> ::Google::Api::MetricDescriptor

Creates a new metric descriptor.
The creation is executed asynchronously.
User-created metric descriptors define
[custom metrics](https://cloud.google.com/monitoring/custom-metrics).
The metric descriptor is updated if it already exists,
except that metric labels are never removed.
**Overloads**

    def create_metric_descriptor(request, options = nil) -> ::Google::Api::MetricDescriptor

Pass arguments to `create_metric_descriptor` via a request object, either of type [CreateMetricDescriptorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateMetricDescriptorRequest "Google::Cloud::Monitoring::V3::CreateMetricDescriptorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::CreateMetricDescriptorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateMetricDescriptorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_metric_descriptor(name: nil, metric_descriptor: nil) -> ::Google::Api::MetricDescriptor

Pass arguments to `create_metric_descriptor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) --- Required. The [project](https://cloud.google.com/monitoring/api/v3#project_name) on which to execute the request. The format is: 4 projects/\[PROJECT_ID_OR_NUMBER\]
- **metric_descriptor** ([::Google::Api::MetricDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MetricDescriptor), ::Hash) --- Required. The new [custom
  metric](https://cloud.google.com/monitoring/custom-metrics) descriptor.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Api::MetricDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MetricDescriptor))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Api::MetricDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MetricDescriptor))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::CreateMetricDescriptorRequest.new

# Call the create_metric_descriptor method.
result = client.create_metric_descriptor request

# The returned object is of type Google::Api::MetricDescriptor.
p result
```

### #create_service_time_series

    def create_service_time_series(request, options = nil) -> ::Google::Protobuf::Empty
    def create_service_time_series(name: nil, time_series: nil) -> ::Google::Protobuf::Empty

Creates or adds data to one or more service time series. A service time
series is a time series for a metric from a Google Cloud service. The
response is empty if all time series in the request were written. If any
time series could not be written, a corresponding failure message is
included in the error response. This endpoint rejects writes to
user-defined metrics.
This method is only for use by Google Cloud services. Use
[projects.timeSeries.create](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client#Google__Cloud__Monitoring__V3__MetricService__Client_create_time_series_instance_ "Google::Cloud::Monitoring::V3::MetricService::Client#create_time_series (method)")
instead.
**Overloads**

    def create_service_time_series(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `create_service_time_series` via a request object, either of type [CreateTimeSeriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateTimeSeriesRequest "Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateTimeSeriesRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_service_time_series(name: nil, time_series: nil) -> ::Google::Protobuf::Empty

Pass arguments to `create_service_time_series` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) ---

  Required. The
  [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
  to execute the request. The format is:

      projects/[PROJECT_ID_OR_NUMBER]

- **time_series** (::Array\<[::Google::Cloud::Monitoring::V3::TimeSeries](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-TimeSeries), ::Hash\>) --- Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each `TimeSeries` value must fully specify a unique time series by supplying all label values for the metric and the monitored resource.


  The maximum number of `TimeSeries` objects per `Create` request is 200.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest.new

# Call the create_service_time_series method.
result = client.create_service_time_series request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #create_time_series

    def create_time_series(request, options = nil) -> ::Google::Protobuf::Empty
    def create_time_series(name: nil, time_series: nil) -> ::Google::Protobuf::Empty

Creates or adds data to one or more time series.
The response is empty if all time series in the request were written.
If any time series could not be written, a corresponding failure message is
included in the error response.
This method does not support
[resource locations constraint of an organization
policy](https://cloud.google.com/resource-manager/docs/organization-policy/defining-locations#setting_the_organization_policy).
**Overloads**

    def create_time_series(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `create_time_series` via a request object, either of type [CreateTimeSeriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateTimeSeriesRequest "Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-CreateTimeSeriesRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def create_time_series(name: nil, time_series: nil) -> ::Google::Protobuf::Empty

Pass arguments to `create_time_series` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) ---

  Required. The
  [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
  to execute the request. The format is:

      projects/[PROJECT_ID_OR_NUMBER]

- **time_series** (::Array\<[::Google::Cloud::Monitoring::V3::TimeSeries](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-TimeSeries), ::Hash\>) --- Required. The new data to be added to a list of time series. Adds at most one data point to each of several time series. The new data point must be more recent than any other point in its time series. Each `TimeSeries` value must fully specify a unique time series by supplying all label values for the metric and the monitored resource.


  The maximum number of `TimeSeries` objects per `Create` request is 200.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::CreateTimeSeriesRequest.new

# Call the create_time_series method.
result = client.create_time_series request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #delete_metric_descriptor

    def delete_metric_descriptor(request, options = nil) -> ::Google::Protobuf::Empty
    def delete_metric_descriptor(name: nil) -> ::Google::Protobuf::Empty

Deletes a metric descriptor. Only user-created
[custom metrics](https://cloud.google.com/monitoring/custom-metrics) can be
deleted.
**Overloads**

    def delete_metric_descriptor(request, options = nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_metric_descriptor` via a request object, either of type [DeleteMetricDescriptorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-DeleteMetricDescriptorRequest "Google::Cloud::Monitoring::V3::DeleteMetricDescriptorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::DeleteMetricDescriptorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-DeleteMetricDescriptorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def delete_metric_descriptor(name: nil) -> ::Google::Protobuf::Empty

Pass arguments to `delete_metric_descriptor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The metric descriptor on which to execute the request. The format is:


      projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID]

  An example of `[METRIC_ID]` is:
  `"custom.googleapis.com/my_test_metric"`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Protobuf::Empty](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Protobuf-Empty))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::DeleteMetricDescriptorRequest.new

# Call the delete_metric_descriptor method.
result = client.delete_metric_descriptor request

# The returned object is of type Google::Protobuf::Empty.
p result
```

### #get_metric_descriptor

    def get_metric_descriptor(request, options = nil) -> ::Google::Api::MetricDescriptor
    def get_metric_descriptor(name: nil) -> ::Google::Api::MetricDescriptor

Gets a single metric descriptor.
**Overloads**

    def get_metric_descriptor(request, options = nil) -> ::Google::Api::MetricDescriptor

Pass arguments to `get_metric_descriptor` via a request object, either of type [GetMetricDescriptorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetMetricDescriptorRequest "Google::Cloud::Monitoring::V3::GetMetricDescriptorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::GetMetricDescriptorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetMetricDescriptorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_metric_descriptor(name: nil) -> ::Google::Api::MetricDescriptor

Pass arguments to `get_metric_descriptor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The metric descriptor on which to execute the request. The format is:


      projects/[PROJECT_ID_OR_NUMBER]/metricDescriptors/[METRIC_ID]

  An example value of `[METRIC_ID]` is
  `"compute.googleapis.com/instance/disk/read_bytes_count"`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Api::MetricDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MetricDescriptor))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Api::MetricDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MetricDescriptor))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::GetMetricDescriptorRequest.new

# Call the get_metric_descriptor method.
result = client.get_metric_descriptor request

# The returned object is of type Google::Api::MetricDescriptor.
p result
```

### #get_monitored_resource_descriptor

    def get_monitored_resource_descriptor(request, options = nil) -> ::Google::Api::MonitoredResourceDescriptor
    def get_monitored_resource_descriptor(name: nil) -> ::Google::Api::MonitoredResourceDescriptor

Gets a single monitored resource descriptor.
**Overloads**

    def get_monitored_resource_descriptor(request, options = nil) -> ::Google::Api::MonitoredResourceDescriptor

Pass arguments to `get_monitored_resource_descriptor` via a request object, either of type [GetMonitoredResourceDescriptorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetMonitoredResourceDescriptorRequest "Google::Cloud::Monitoring::V3::GetMonitoredResourceDescriptorRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::GetMonitoredResourceDescriptorRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-GetMonitoredResourceDescriptorRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def get_monitored_resource_descriptor(name: nil) -> ::Google::Api::MonitoredResourceDescriptor

Pass arguments to `get_monitored_resource_descriptor` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Required. The monitored resource descriptor to get. The format is:


      projects/[PROJECT_ID_OR_NUMBER]/monitoredResourceDescriptors/[RESOURCE_TYPE]

  The `[RESOURCE_TYPE]` is a predefined type, such as
  `cloudsql_database`.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** ([::Google::Api::MonitoredResourceDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MonitoredResourceDescriptor))
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- ([::Google::Api::MonitoredResourceDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MonitoredResourceDescriptor))
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::GetMonitoredResourceDescriptorRequest.new

# Call the get_monitored_resource_descriptor method.
result = client.get_monitored_resource_descriptor request

# The returned object is of type Google::Api::MonitoredResourceDescriptor.
p result
```

### #initialize

    def initialize() { |config| ... } -> Client

Create a new MetricService client object.
**Yields**

- (config) --- Configure the MetricService client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-MetricService-Client)) --- a new instance of Client
**Example**

```ruby
# Create a client using the default configuration
client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Monitoring::V3::MetricService::Client.new do |config|
  config.timeout = 10.0
end
```

### #list_metric_descriptors

    def list_metric_descriptors(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Api::MetricDescriptor>
    def list_metric_descriptors(name: nil, filter: nil, page_size: nil, page_token: nil, active_only: nil) -> ::Gapic::PagedEnumerable<::Google::Api::MetricDescriptor>

Lists metric descriptors that match a filter.
**Overloads**

    def list_metric_descriptors(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Api::MetricDescriptor>

Pass arguments to `list_metric_descriptors` via a request object, either of type [ListMetricDescriptorsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListMetricDescriptorsRequest "Google::Cloud::Monitoring::V3::ListMetricDescriptorsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::ListMetricDescriptorsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListMetricDescriptorsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_metric_descriptors(name: nil, filter: nil, page_size: nil, page_token: nil, active_only: nil) -> ::Gapic::PagedEnumerable<::Google::Api::MetricDescriptor>

Pass arguments to `list_metric_descriptors` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) ---

  Required. The
  [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
  to execute the request. The format is:

      projects/[PROJECT_ID_OR_NUMBER]

- **filter** (::String) ---

  Optional. If this field is empty, all custom and
  system-defined metric descriptors are returned.
  Otherwise, the [filter](https://cloud.google.com/monitoring/api/v3/filters)
  specifies which metric descriptors are to be
  returned. For example, the following filter matches all
  [custom metrics](https://cloud.google.com/monitoring/custom-metrics):

      metric.type = starts_with("custom.googleapis.com/")

- **page_size** (::Integer) --- Optional. A positive number that is the maximum number of results to return. The default and maximum value is 10,000. If a page_size \<= 0 or \> 10,000 is submitted, will instead return a maximum of 10,000 results.
- **page_token** (::String) --- Optional. If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.
- **active_only** (::Boolean) ---

  Optional. If true, only metrics and monitored resource types that have
  recent data (within roughly 25 hours) will be included in the response.
  - If a metric descriptor enumerates monitored resource types, only the monitored resource types for which the metric type has recent data will be included in the returned metric descriptor, and if none of them have recent data, the metric descriptor will not be returned.
  - If a metric descriptor does not enumerate the compatible monitored resource types, it will be returned only if the metric type has recent data for some monitored resource type. The returned descriptor will not enumerate any monitored resource types.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Api::MetricDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MetricDescriptor)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Api::MetricDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MetricDescriptor)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::ListMetricDescriptorsRequest.new

# Call the list_metric_descriptors method.
result = client.list_metric_descriptors request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Api::MetricDescriptor.
  p item
end
```

### #list_monitored_resource_descriptors

    def list_monitored_resource_descriptors(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Api::MonitoredResourceDescriptor>
    def list_monitored_resource_descriptors(name: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Api::MonitoredResourceDescriptor>

Lists monitored resource descriptors that match a filter.
**Overloads**

    def list_monitored_resource_descriptors(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Api::MonitoredResourceDescriptor>

Pass arguments to `list_monitored_resource_descriptors` via a request object, either of type [ListMonitoredResourceDescriptorsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListMonitoredResourceDescriptorsRequest "Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListMonitoredResourceDescriptorsRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_monitored_resource_descriptors(name: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Api::MonitoredResourceDescriptor>

Pass arguments to `list_monitored_resource_descriptors` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) ---

  Required. The
  [project](https://cloud.google.com/monitoring/api/v3#project_name) on which
  to execute the request. The format is:

      projects/[PROJECT_ID_OR_NUMBER]

- **filter** (::String) ---

  An optional [filter](https://cloud.google.com/monitoring/api/v3/filters)
  describing the descriptors to be returned. The filter can reference the
  descriptor's type and labels. For example, the following filter returns
  only Google Compute Engine descriptors that have an `id` label:

      resource.type = starts_with("gce_") AND resource.label:id

- **page_size** (::Integer) --- A positive number that is the maximum number of results to return.
- **page_token** (::String) --- If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Api::MonitoredResourceDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MonitoredResourceDescriptor)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Api::MonitoredResourceDescriptor](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Api-MonitoredResourceDescriptor)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::ListMonitoredResourceDescriptorsRequest.new

# Call the list_monitored_resource_descriptors method.
result = client.list_monitored_resource_descriptors request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Api::MonitoredResourceDescriptor.
  p item
end
```

### #list_time_series

    def list_time_series(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::TimeSeries>
    def list_time_series(name: nil, filter: nil, interval: nil, aggregation: nil, secondary_aggregation: nil, order_by: nil, view: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::TimeSeries>

Lists time series that match a filter.
**Overloads**

    def list_time_series(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::TimeSeries>

Pass arguments to `list_time_series` via a request object, either of type [ListTimeSeriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListTimeSeriesRequest "Google::Cloud::Monitoring::V3::ListTimeSeriesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::Monitoring::V3::ListTimeSeriesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListTimeSeriesRequest), ::Hash) --- A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- **options** (::Gapic::CallOptions, ::Hash) --- Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

    def list_time_series(name: nil, filter: nil, interval: nil, aggregation: nil, secondary_aggregation: nil, order_by: nil, view: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Monitoring::V3::TimeSeries>

Pass arguments to `list_time_series` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **name** (::String) ---

  Required. The
  [project](https://cloud.google.com/monitoring/api/v3#project_name),
  organization or folder on which to execute the request. The format is:

      projects/[PROJECT_ID_OR_NUMBER]
      organizations/[ORGANIZATION_ID]
      folders/[FOLDER_ID]

- **filter** (::String) ---

  Required. A [monitoring
  filter](https://cloud.google.com/monitoring/api/v3/filters) that specifies
  which time series should be returned. The filter must specify a single
  metric type, and can additionally specify metric labels and other
  information. For example:

      metric.type = "compute.googleapis.com/instance/cpu/usage_time" AND
          metric.labels.instance_name = "my-instance-name"

- **interval** ([::Google::Cloud::Monitoring::V3::TimeInterval](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-TimeInterval), ::Hash) --- Required. The time interval for which results should be returned. Only time series that contain data points in the specified interval are included in the response.
- **aggregation** ([::Google::Cloud::Monitoring::V3::Aggregation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Aggregation), ::Hash) --- Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series across specified labels.


  By default (if no `aggregation` is explicitly specified), the raw time
  series data is returned.
- **secondary_aggregation** ([::Google::Cloud::Monitoring::V3::Aggregation](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-Aggregation), ::Hash) --- Apply a second aggregation after `aggregation` is applied. May only be specified if `aggregation` is specified.
- **order_by** (::String) --- Unsupported: must be left blank. The points in each time series are currently returned in reverse time order (most recent to oldest).
- **view** ([::Google::Cloud::Monitoring::V3::ListTimeSeriesRequest::TimeSeriesView](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-ListTimeSeriesRequest-TimeSeriesView)) --- Required. Specifies which information is returned about the time series.
- **page_size** (::Integer) --- A positive number that is the maximum number of results to return. If `page_size` is empty or more than 100,000 results, the effective `page_size` is 100,000 results. If `view` is set to `FULL`, this is the maximum number of `Points` returned. If `view` is set to `HEADERS`, this is the maximum number of `TimeSeries` returned.
- **page_token** (::String) --- If this field is not empty then it must contain the `nextPageToken` value returned by a previous call to this method. Using this field causes the method to return additional results from the previous method call.
**Yields**

- (response, operation) --- Access the result along with the RPC operation
**Yield Parameters**

- **response** (::Gapic::PagedEnumerable\<[::Google::Cloud::Monitoring::V3::TimeSeries](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-TimeSeries)\>)
- **operation** (::GRPC::ActiveCall::Operation)
**Returns**

- (::Gapic::PagedEnumerable\<[::Google::Cloud::Monitoring::V3::TimeSeries](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-monitoring-v3/latest/Google-Cloud-Monitoring-V3-TimeSeries)\>)
**Raises**

- (::Google::Cloud::Error) --- if the RPC is aborted.
**Example**

Basic example

```ruby
require "google/cloud/monitoring/v3"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Monitoring::V3::MetricService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Monitoring::V3::ListTimeSeriesRequest.new

# Call the list_time_series method.
result = client.list_time_series request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Monitoring::V3::TimeSeries.
  p item
end
```

### #logger

    def logger() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (String)