Service Client: Google::Monitoring::V3::MetricService::MetricServiceClient
Client stub representing the remote MetricService gRPC service. Delegates call dispatching to Google::gRPC::Client.
target
The endpoint target address. Defaults to monitoring.googleapis.com:443.
credentials
The authentication credentials provider. Defaults to application default credentials via Google::Auth.
NAME
Google::Monitoring::V3::MetricService - Compiled Protocol Buffers messages for google/monitoring/v3/metric_service.proto
SYNOPSIS
use Google::Monitoring::V3::MetricService;
my $msg = Google::Monitoring::V3::MetricService::ListMonitoredResourceDescriptorsRequest->new({
name => $name,
filter => $filter,
page_size => $page_size,
page_token => $page_token,
});
# Read or update a field
my $val = $msg->name();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Monitoring::V3::MetricService::ListMonitoredResourceDescriptorsRequest->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/monitoring/v3/metric_service.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Monitoring::V3::MetricService::ListMonitoredResourceDescriptorsRequest
The `ListMonitoredResourceDescriptors` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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]$msg->filter()/$msg->filter($value)Type:
StringAn 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$msg->page_size()/$msg->page_size($value)Type:
Int32A positive number that is the maximum number of results to return.
$msg->page_token()/$msg->page_token($value)Type:
StringIf 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.
Google::Monitoring::V3::MetricService::ListMonitoredResourceDescriptorsResponse
The `ListMonitoredResourceDescriptors` response.
Inherits from Protobuf::Message.
Accessors
$msg->resource_descriptors()/$msg->resource_descriptors($value)Type:
Message(Google::Api::MonitoredResource::MonitoredResourceDescriptor)The monitored resource descriptors that are available to this project and that match `filter`, if present.
$msg->next_page_token()/$msg->next_page_token($value)Type:
StringIf there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as `page_token` in the next call to this method.
Google::Monitoring::V3::MetricService::GetMonitoredResourceDescriptorRequest
The `GetMonitoredResourceDescriptor` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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`.
Google::Monitoring::V3::MetricService::ListMetricDescriptorsRequest
The `ListMetricDescriptors` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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]$msg->filter()/$msg->filter($value)Type:
StringOptional. 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/")$msg->page_size()/$msg->page_size($value)Type:
Int32Optional. 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.
$msg->page_token()/$msg->page_token($value)Type:
StringOptional. 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.
$msg->active_only()/$msg->active_only($value)Type:
BoolOptional. 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.
Google::Monitoring::V3::MetricService::ListMetricDescriptorsResponse
The `ListMetricDescriptors` response.
Inherits from Protobuf::Message.
Accessors
$msg->metric_descriptors()/$msg->metric_descriptors($value)Type:
Message(Google::Api::Metric::MetricDescriptor)The metric descriptors that are available to the project and that match the value of `filter`, if present.
$msg->next_page_token()/$msg->next_page_token($value)Type:
StringIf there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as `page_token` in the next call to this method.
Google::Monitoring::V3::MetricService::GetMetricDescriptorRequest
The `GetMetricDescriptor` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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"`.
Google::Monitoring::V3::MetricService::CreateMetricDescriptorRequest
The `CreateMetricDescriptor` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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]
$msg->metric_descriptor()/$msg->metric_descriptor($value)Type:
Message(Google::Api::Metric::MetricDescriptor)Required. The new [custom metric](https://cloud.google.com/monitoring/custom-metrics) descriptor.
Google::Monitoring::V3::MetricService::DeleteMetricDescriptorRequest
The `DeleteMetricDescriptor` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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"`.
Google::Monitoring::V3::MetricService::ListTimeSeriesRequest
The `ListTimeSeries` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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]$msg->filter()/$msg->filter($value)Type:
StringRequired. 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"$msg->interval()/$msg->interval($value)Type:
Message(Google::Monitoring::V3::Common::TimeInterval)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.
$msg->aggregation()/$msg->aggregation($value)Type:
Message(Google::Monitoring::V3::Common::Aggregation)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.
$msg->secondary_aggregation()/$msg->secondary_aggregation($value)Type:
Message(Google::Monitoring::V3::Common::Aggregation)Apply a second aggregation after `aggregation` is applied. May only be specified if `aggregation` is specified.
$msg->order_by()/$msg->order_by($value)Type:
StringUnsupported: must be left blank. The points in each time series are currently returned in reverse time order (most recent to oldest).
$msg->view()/$msg->view($value)Type:
Enum(Google::Monitoring::V3::ListTimeSeriesRequest::TimeSeriesView)Required. Specifies which information is returned about the time series.
$msg->page_size()/$msg->page_size($value)Type:
Int32A 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.
$msg->page_token()/$msg->page_token($value)Type:
StringIf 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.
Enum: ListTimeSeriesRequest::TimeSeriesView
FULL=>0HEADERS=>1
Google::Monitoring::V3::MetricService::ListTimeSeriesResponse
The `ListTimeSeries` response.
Inherits from Protobuf::Message.
Accessors
$msg->time_series()/$msg->time_series($value)Type:
Message(Google::Monitoring::V3::Metric::TimeSeries)One or more time series that match the filter included in the request.
$msg->next_page_token()/$msg->next_page_token($value)Type:
StringIf there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as `page_token` in the next call to this method.
$msg->execution_errors()/$msg->execution_errors($value)Type:
Message(Google::Rpc::Status::Status)Query execution errors that may have caused the time series data returned to be incomplete.
$msg->unit()/$msg->unit($value)Type:
StringThe unit in which all `time_series` point values are reported. `unit` follows the UCUM format for units as seen in https://unitsofmeasure.org/ucum.html. If different `time_series` have different units (for example, because they come from different metric types, or a unit is absent), then `unit` will be "{not_a_unit}".
Google::Monitoring::V3::MetricService::CreateTimeSeriesRequest
The `CreateTimeSeries` request.
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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]$msg->time_series()/$msg->time_series($value)Type:
Message(Google::Monitoring::V3::Metric::TimeSeries)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.
Google::Monitoring::V3::MetricService::CreateTimeSeriesError
DEPRECATED. Used to hold per-time-series error status.
Inherits from Protobuf::Message.
Accessors
$msg->time_series()/$msg->time_series($value)Type:
Message(Google::Monitoring::V3::Metric::TimeSeries)DEPRECATED. Time series ID that resulted in the `status` error.
$msg->status()/$msg->status($value)Type:
Message(Google::Rpc::Status::Status)DEPRECATED. The status of the requested write operation for `time_series`.
Google::Monitoring::V3::MetricService::CreateTimeSeriesSummary
Summary of the result of a failed request to write data to a time series.
Inherits from Protobuf::Message.
Accessors
$msg->total_point_count()/$msg->total_point_count($value)Type:
Int32The number of points in the request.
$msg->success_point_count()/$msg->success_point_count($value)Type:
Int32The number of points that were successfully written.
$msg->errors()/$msg->errors($value)Type:
Message(Google::Monitoring::V3::MetricService::CreateTimeSeriesSummary::Error)The number of points that failed to be written. Order is not guaranteed.
Google::Monitoring::V3::MetricService::QueryTimeSeriesRequest
The `QueryTimeSeries` request. For information about the status of Monitoring Query Language (MQL), see the [MQL deprecation notice](https://cloud.google.com/stackdriver/docs/deprecations/mql).
Inherits from Protobuf::Message.
Accessors
$msg->name()/$msg->name($value)Type:
StringRequired. 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]$msg->query()/$msg->query($value)Type:
StringRequired. The query in the [Monitoring Query Language](https://cloud.google.com/monitoring/mql/reference) format. The default time zone is in UTC.
$msg->page_size()/$msg->page_size($value)Type:
Int32A positive number that is the maximum number of time_series_data to return.
$msg->page_token()/$msg->page_token($value)Type:
StringIf 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.
Google::Monitoring::V3::MetricService::QueryTimeSeriesResponse
The `QueryTimeSeries` response. For information about the status of Monitoring Query Language (MQL), see the [MQL deprecation notice](https://cloud.google.com/stackdriver/docs/deprecations/mql).
Inherits from Protobuf::Message.
Accessors
$msg->time_series_descriptor()/$msg->time_series_descriptor($value)Type:
Message(Google::Monitoring::V3::Metric::TimeSeriesDescriptor)The descriptor for the time series data.
$msg->time_series_data()/$msg->time_series_data($value)Type:
Message(Google::Monitoring::V3::Metric::TimeSeriesData)The time series data.
$msg->next_page_token()/$msg->next_page_token($value)Type:
StringIf there are more results than have been returned, then this field is set to a non-empty value. To see the additional results, use that value as `page_token` in the next call to this method.
$msg->partial_errors()/$msg->partial_errors($value)Type:
Message(Google::Rpc::Status::Status)Query execution errors that may have caused the time series data returned to be incomplete. The available data will be available in the response.
Google::Monitoring::V3::MetricService::QueryErrorList
This is an error detail intended to be used with INVALID_ARGUMENT errors.
Inherits from Protobuf::Message.
Accessors
$msg->errors()/$msg->errors($value)Type:
Message(Google::Monitoring::V3::Metric::QueryError)Errors in parsing the time series query language text. The number of errors in the response may be limited.
$msg->error_summary()/$msg->error_summary($value)Type:
StringA summary of all the errors.
SEE ALSO
Protobuf, Protobuf::Message, Google::Monitoring::V3::MetricService::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.