Package google.monitoring.v3

Index

MetricService

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

CreateMetricDescriptor

rpc CreateMetricDescriptor(CreateMetricDescriptorRequest) returns (MetricDescriptor)

Creates a new metric descriptor. The creation is executed asynchronously. User-created metric descriptors define custom metrics. The metric descriptor is updated if it already exists, except that metric labels are never removed.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring
  • https://www.googleapis.com/auth/monitoring.write

For more information, see the Authentication Overview.

CreateTimeSeries

rpc CreateTimeSeries(CreateTimeSeriesRequest) returns (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.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring
  • https://www.googleapis.com/auth/monitoring.write

For more information, see the Authentication Overview.

DeleteMetricDescriptor

rpc DeleteMetricDescriptor(DeleteMetricDescriptorRequest) returns (Empty)

Deletes a metric descriptor. Only user-created custom metrics can be deleted.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring

For more information, see the Authentication Overview.

GetMetricDescriptor

rpc GetMetricDescriptor(GetMetricDescriptorRequest) returns (MetricDescriptor)

Gets a single metric descriptor.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring
  • https://www.googleapis.com/auth/monitoring.read
  • https://www.googleapis.com/auth/monitoring.write

For more information, see the Authentication Overview.

GetMonitoredResourceDescriptor

rpc GetMonitoredResourceDescriptor(GetMonitoredResourceDescriptorRequest) returns (MonitoredResourceDescriptor)

Gets a single monitored resource descriptor.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring
  • https://www.googleapis.com/auth/monitoring.read
  • https://www.googleapis.com/auth/monitoring.write

For more information, see the Authentication Overview.

ListMetricDescriptors

rpc ListMetricDescriptors(ListMetricDescriptorsRequest) returns (ListMetricDescriptorsResponse)

Lists metric descriptors that match a filter.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring
  • https://www.googleapis.com/auth/monitoring.read
  • https://www.googleapis.com/auth/monitoring.write

For more information, see the Authentication Overview.

ListMonitoredResourceDescriptors

rpc ListMonitoredResourceDescriptors(ListMonitoredResourceDescriptorsRequest) returns (ListMonitoredResourceDescriptorsResponse)

Lists monitored resource descriptors that match a filter.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring
  • https://www.googleapis.com/auth/monitoring.read
  • https://www.googleapis.com/auth/monitoring.write

For more information, see the Authentication Overview.

ListTimeSeries

rpc ListTimeSeries(ListTimeSeriesRequest) returns (ListTimeSeriesResponse)

Lists time series that match a filter.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/monitoring
  • https://www.googleapis.com/auth/monitoring.read

For more information, see the Authentication Overview.

QueryService

The QueryService API is used to manage time series data in Cloud Monitoring. Time series data is a collection of data points that describes the time-varying values of a metric.

QueryTimeSeries

The method google.monitoring.v3.QueryService.QueryTimeSeries is not available in Trusted Cloud by S3NS.

Aggregation

Describes how to combine multiple time series to provide a different view of the data. Aggregation of time series is done in two steps. First, each time series in the set is aligned to the same time interval boundaries, then the set of time series is optionally reduced in number.

Alignment consists of applying the per_series_aligner operation to each time series after its data has been divided into regular alignment_period time intervals. This process takes all of the data points in an alignment period, applies a mathematical transformation such as averaging, minimum, maximum, delta, etc., and converts them into a single data point per period.

Reduction is when the aligned and transformed time series can optionally be combined, reducing the number of time series through similar mathematical transformations. Reduction involves applying a cross_series_reducer to all the time series, optionally sorting the time series into subsets with group_by_fields, and applying the reducer to each subset.

The raw time series data can contain a huge amount of information from multiple sources. Alignment and reduction transforms this mass of data into a more manageable and representative collection of data, for example "the 95% latency across the average of all tasks in a cluster". This representative data can be more easily graphed and comprehended, and the individual time series data is still available for later drilldown. For more details, see Filtering and aggregation.

Fields
alignment_period

Duration

The alignment_period specifies a time interval, in seconds, that is used to divide the data in all the time series into consistent blocks of time. This will be done before the per-series aligner can be applied to the data.

The value must be at least 60 seconds. If a per-series aligner other than ALIGN_NONE is specified, this field is required or an error is returned. If no per-series aligner is specified, or the aligner ALIGN_NONE is specified, then this field is ignored.

The maximum value of the alignment_period is 104 weeks (2 years) for charts, and 90,000 seconds (25 hours) for alerting policies.

per_series_aligner

Aligner

An Aligner describes how to bring the data points in a single time series into temporal alignment. Except for ALIGN_NONE, all alignments cause all the data points in an alignment_period to be mathematically grouped together, resulting in a single data point for each alignment_period with end timestamp at the end of the period.

Not all alignment operations may be applied to all time series. The valid choices depend on the metric_kind and value_type of the original time series. Alignment can change the metric_kind or the value_type of the time series.

Time series data must be aligned in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified and not equal to ALIGN_NONE and alignment_period must be specified; otherwise, an error is returned.

cross_series_reducer

Reducer

The reduction operation to be used to combine time series into a single time series, where the value of each data point in the resulting series is a function of all the already aligned values in the input time series.

Not all reducer operations can be applied to all time series. The valid choices depend on the metric_kind and the value_type of the original time series. Reduction can yield a time series with a different metric_kind or value_type than the input time series.

Time series data must first be aligned (see per_series_aligner) in order to perform cross-time series reduction. If cross_series_reducer is specified, then per_series_aligner must be specified, and must not be ALIGN_NONE. An alignment_period must also be specified; otherwise, an error is returned.

group_by_fields[]

string

The set of fields to preserve when cross_series_reducer is specified. The group_by_fields determine how the time series are partitioned into subsets prior to applying the aggregation operation. Each subset contains time series that have the same value for each of the grouping fields. Each individual time series is a member of exactly one subset. The cross_series_reducer is applied to each subset of time series. It is not possible to reduce across different resource types, so this field implicitly contains resource.type. Fields not specified in group_by_fields are aggregated away. If group_by_fields is not specified and all the time series have the same resource type, then the time series are aggregated into a single output time series. If cross_series_reducer is not defined, this field is ignored.

Aligner

The Aligner specifies the operation that will be applied to the data points in each alignment period in a time series. Except for ALIGN_NONE, which specifies that no operation be applied, each alignment operation replaces the set of data values in each alignment period with a single value: the result of applying the operation to the data values. An aligned time series has a single data value at the end of each alignment_period.

An alignment operation can change the data type of the values, too. For example, if you apply a counting operation to boolean values, the data value_type in the original time series is BOOLEAN, but the value_type in the aligned result is INT64.

Enums
ALIGN_NONE No alignment. Raw data is returned. Not valid if cross-series reduction is requested. The value_type of the result is the same as the value_type of the input.
ALIGN_DELTA

Align and convert to DELTA. The output is delta = y1 - y0.

This alignment is valid for CUMULATIVE and DELTA metrics. If the selected alignment period results in periods with no data, then the aligned value for such a period is created by interpolation. The value_type of the aligned result is the same as the value_type of the input.

ALIGN_RATE

Align and convert to a rate. The result is computed as rate = (y1 - y0)/(t1 - t0), or "delta over time". Think of this aligner as providing the slope of the line that passes through the value at the start and at the end of the alignment_period.

This aligner is valid for CUMULATIVE and DELTA metrics with numeric values. If the selected alignment period results in periods with no data, then the aligned value for such a period is created by interpolation. The output is a GAUGE metric with value_type DOUBLE.

If, by "rate", you mean "percentage change", see the ALIGN_PERCENT_CHANGE aligner instead.

ALIGN_INTERPOLATE Align by interpolating between adjacent points around the alignment period boundary. This aligner is valid for GAUGE metrics with numeric values. The value_type of the aligned result is the same as the value_type of the input.
ALIGN_NEXT_OLDER Align by moving the most recent data point before the end of the alignment period to the boundary at the end of the alignment period. This aligner is valid for GAUGE metrics. The value_type of the aligned result is the same as the value_type of the input.
ALIGN_MIN Align the time series by returning the minimum value in each alignment period. This aligner is valid for GAUGE and DELTA metrics with numeric values. The value_type of the aligned result is the same as the value_type of the input.
ALIGN_MAX Align the time series by returning the maximum value in each alignment period. This aligner is valid for GAUGE and DELTA metrics with numeric values. The value_type of the aligned result is the same as the value_type of the input.
ALIGN_MEAN Align the time series by returning the mean value in each alignment period. This aligner is valid for GAUGE and DELTA metrics with numeric values. The value_type of the aligned result is DOUBLE.
ALIGN_COUNT Align the time series by returning the number of values in each alignment period. This aligner is valid for GAUGE and DELTA metrics with numeric or Boolean values. The value_type of the aligned result is INT64.
ALIGN_SUM Align the time series by returning the sum of the values in each alignment period. This aligner is valid for GAUGE and DELTA metrics with numeric and distribution values. The value_type of the aligned result is the same as the value_type of the input.
ALIGN_STDDEV Align the time series by returning the standard deviation of the values in each alignment period. This aligner is valid for GAUGE and DELTA metrics with numeric values. The value_type of the output is DOUBLE.
ALIGN_COUNT_TRUE Align the time series by returning the number of True values in each alignment period. This aligner is valid for GAUGE metrics with Boolean values. The value_type of the output is INT64.
ALIGN_COUNT_FALSE Align the time series by returning the number of False values in each alignment period. This aligner is valid for GAUGE metrics with Boolean values. The value_type of the output is INT64.
ALIGN_FRACTION_TRUE Align the time series by returning the ratio of the number of True values to the total number of values in each alignment period. This aligner is valid for GAUGE metrics with Boolean values. The output value is in the range [0.0, 1.0] and has value_type DOUBLE.
ALIGN_PERCENTILE_99 Align the time series by using percentile aggregation. The resulting data point in each alignment period is the 99th percentile of all data points in the period. This aligner is valid for GAUGE and DELTA metrics with distribution values. The output is a GAUGE metric with value_type DOUBLE.
ALIGN_PERCENTILE_95 Align the time series by using percentile aggregation. The resulting data point in each alignment period is the 95th percentile of all data points in the period. This aligner is valid for GAUGE and DELTA metrics with distribution values. The output is a GAUGE metric with value_type DOUBLE.
ALIGN_PERCENTILE_50 Align the time series by using percentile aggregation. The resulting data point in each alignment period is the 50th percentile of all data points in the period. This aligner is valid for GAUGE and DELTA metrics with distribution values. The output is a GAUGE metric with value_type DOUBLE.
ALIGN_PERCENTILE_05 Align the time series by using percentile aggregation. The resulting data point in each alignment period is the 5th percentile of all data points in the period. This aligner is valid for GAUGE and DELTA metrics with distribution values. The output is a GAUGE metric with value_type DOUBLE.
ALIGN_PERCENT_CHANGE

Align and convert to a percentage change. This aligner is valid for GAUGE and DELTA metrics with numeric values. This alignment returns ((current - previous)/previous) * 100, where the value of previous is determined based on the alignment_period.

If the values of current and previous are both 0, then the returned value is 0. If only previous is 0, the returned value is infinity.

A 10-minute moving mean is computed at each point of the alignment period prior to the above calculation to smooth the metric and prevent false positives from very short-lived spikes. The moving mean is only applicable for data whose values are >= 0. Any values < 0 are treated as a missing datapoint, and are ignored. While DELTA metrics are accepted by this alignment, special care should be taken that the values for the metric will always be positive. The output is a GAUGE metric with value_type DOUBLE.

Reducer

A Reducer operation describes how to aggregate data points from multiple time series into a single time series, where the value of each data point in the resulting series is a function of all the already aligned values in the input time series.

Enums
REDUCE_NONE No cross-time series reduction. The output of the Aligner is returned.
REDUCE_MEAN Reduce by computing the mean value across time series for each alignment period. This reducer is valid for DELTA and GAUGE metrics with numeric or distribution values. The value_type of the output is DOUBLE.
REDUCE_MIN Reduce by computing the minimum value across time series for each alignment period. This reducer is valid for DELTA and GAUGE metrics with numeric values. The value_type of the output is the same as the value_type of the input.
REDUCE_MAX Reduce by computing the maximum value across time series for each alignment period. This reducer is valid for DELTA and GAUGE metrics with numeric values. The value_type of the output is the same as the value_type of the input.
REDUCE_SUM Reduce by computing the sum across time series for each alignment period. This reducer is valid for DELTA and GAUGE metrics with numeric and distribution values. The value_type of the output is the same as the value_type of the input.
REDUCE_STDDEV Reduce by computing the standard deviation across time series for each alignment period. This reducer is valid for DELTA and GAUGE metrics with numeric or distribution values. The value_type of the output is DOUBLE.
REDUCE_COUNT Reduce by computing the number of data points across time series for each alignment period. This reducer is valid for DELTA and GAUGE metrics of numeric, Boolean, distribution, and string value_type. The value_type of the output is INT64.
REDUCE_COUNT_TRUE Reduce by computing the number of True-valued data points across time series for each alignment period. This reducer is valid for DELTA and GAUGE metrics of Boolean value_type. The value_type of the output is INT64.
REDUCE_COUNT_FALSE Reduce by computing the number of False-valued data points across time series for each alignment period. This reducer is valid for DELTA and GAUGE metrics of Boolean value_type. The value_type of the output is INT64.
REDUCE_FRACTION_TRUE Reduce by computing the ratio of the number of True-valued data points to the total number of data points for each alignment period. This reducer is valid for DELTA and GAUGE metrics of Boolean value_type. The output value is in the range [0.0, 1.0] and has value_type DOUBLE.
REDUCE_PERCENTILE_99 Reduce by computing the 99th percentile of data points across time series for each alignment period. This reducer is valid for GAUGE and DELTA metrics of numeric and distribution type. The value of the output is DOUBLE.
REDUCE_PERCENTILE_95 Reduce by computing the 95th percentile of data points across time series for each alignment period. This reducer is valid for GAUGE and DELTA metrics of numeric and distribution type. The value of the output is DOUBLE.
REDUCE_PERCENTILE_50 Reduce by computing the 50th percentile of data points across time series for each alignment period. This reducer is valid for GAUGE and DELTA metrics of numeric and distribution type. The value of the output is DOUBLE.
REDUCE_PERCENTILE_05 Reduce by computing the 5th percentile of data points across time series for each alignment period. This reducer is valid for GAUGE and DELTA metrics of numeric and distribution type. The value of the output is DOUBLE.

CreateMetricDescriptorRequest

The CreateMetricDescriptor request.

Fields
name

string

Required. The project on which to execute the request. The format is: 4 projects/[PROJECT_ID_OR_NUMBER]

metric_descriptor

MetricDescriptor

Required. The new custom metric descriptor.

CreateTimeSeriesError

DEPRECATED. Used to hold per-time-series error status.

Fields
time_series
(deprecated)

TimeSeries

DEPRECATED. Time series ID that resulted in the status error.

status
(deprecated)

Status

DEPRECATED. The status of the requested write operation for time_series.

CreateTimeSeriesRequest

The CreateTimeSeries request.

Fields
name

string

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

time_series[]

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.

CreateTimeSeriesSummary

Summary of the result of a failed request to write data to a time series.

Fields
total_point_count

int32

The number of points in the request.

success_point_count

int32

The number of points that were successfully written.

errors[]

Error

The number of points that failed to be written. Order is not guaranteed.

Error

Detailed information about an error category.

Fields
status

Status

The status of the requested write operation.

point_count

int32

The number of points that couldn't be written because of status.

DeleteMetricDescriptorRequest

The DeleteMetricDescriptor request.

Fields
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".

DroppedLabels

A set of (label, value) pairs that were removed from a Distribution time series during aggregation and then added as an attachment to a Distribution.Exemplar.

The full label set for the exemplars is constructed by using the dropped pairs in combination with the label values that remain on the aggregated Distribution time series. The constructed full label set can be used to identify the specific entity, such as the instance or job, which might be contributing to a long-tail. However, with dropped labels, the storage requirements are reduced because only the aggregated distribution values for a large group of time series are stored.

Note that there are no guarantees on ordering of the labels from exemplar-to-exemplar and from distribution-to-distribution in the same stream, and there may be duplicates. It is up to clients to resolve any ambiguities.

Fields
label

map<string, string>

Map from label to its value, for all labels dropped in any aggregation.

GetMetricDescriptorRequest

The GetMetricDescriptor request.

Fields
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".

GetMonitoredResourceDescriptorRequest

The GetMonitoredResourceDescriptor request.

Fields
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.

LabelValue

A label value.

Fields
Union field value. The label value can be a bool, int64, or string. value can be only one of the following:
bool_value

bool

A bool label value.

int64_value

int64

An int64 label value.

string_value

string

A string label value.

ListMetricDescriptorsRequest

The ListMetricDescriptors request.

Fields
name

string

Required. The project 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 specifies which metric descriptors are to be returned. For example, the following filter matches all custom metrics:

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

page_size

int32

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

bool

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.

ListMetricDescriptorsResponse

The ListMetricDescriptors response.

Fields
metric_descriptors[]

MetricDescriptor

The metric descriptors that are available to the project and that match the value of filter, if present.

next_page_token

string

If 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.

ListMonitoredResourceDescriptorsRequest

The ListMonitoredResourceDescriptors request.

Fields
name

string

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

filter

string

An optional filter describing the descriptors to be returned. The filter can reference the descriptor's type and labels. For example, the following filter returns only Trusted Cloud Compute Engine descriptors that have an id label:

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

int32

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.

ListMonitoredResourceDescriptorsResponse

The ListMonitoredResourceDescriptors response.

Fields
resource_descriptors[]

MonitoredResourceDescriptor

The monitored resource descriptors that are available to this project and that match filter, if present.

next_page_token

string

If 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.

ListTimeSeriesRequest

The ListTimeSeries request.

Fields
name

string

Required. The project, 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 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

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.

aggregation

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.

secondary_aggregation

Aggregation

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

TimeSeriesView

Required. Specifies which information is returned about the time series.

page_size

int32

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.

TimeSeriesView

Controls which fields are returned by ListTimeSeries*.

Enums
FULL Returns the identity of the metric(s), the time series, and the time series data.
HEADERS Returns the identity of the metric and the time series resource, but not the time series data.

ListTimeSeriesResponse

The ListTimeSeries response.

Fields
time_series[]

TimeSeries

One or more time series that match the filter included in the request.

next_page_token

string

If 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.

execution_errors[]

Status

Query execution errors that may have caused the time series data returned to be incomplete.

unit

string

The 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}".

unreachable[]

string

Cloud regions that were unreachable which may have caused incomplete data to be returned.

Point

A single data point in a time series.

Fields
interval

TimeInterval

The time interval to which the data point applies. For GAUGE metrics, the start time is optional, but if it is supplied, it must equal the end time. For DELTA metrics, the start and end time should specify a non-zero interval, with subsequent points specifying contiguous and non-overlapping intervals. For CUMULATIVE metrics, the start and end time should specify a non-zero interval, with subsequent points specifying the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points.

value

TypedValue

The value of the data point.

QueryError

An error associated with a query in the time series query language format.

Fields
locator

TextLocator

The location of the time series query language text that this error applies to.

message

string

The error message.

QueryErrorList

This is an error detail intended to be used with INVALID_ARGUMENT errors.

Fields
errors[]

QueryError

Errors in parsing the time series query language text. The number of errors in the response may be limited.

error_summary

string

A summary of all the errors.

QueryTimeSeriesRequest

The QueryTimeSeries request. For information about the status of Monitoring Query Language (MQL), see the MQL deprecation notice.

Fields
name

string

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]
query

string

Required. The query in the Monitoring Query Language format. The default time zone is in UTC.

page_size

int32

A positive number that is the maximum number of time_series_data 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.

QueryTimeSeriesResponse

The QueryTimeSeries response. For information about the status of Monitoring Query Language (MQL), see the MQL deprecation notice.

Fields
time_series_descriptor

TimeSeriesDescriptor

The descriptor for the time series data.

time_series_data[]

TimeSeriesData

The time series data.

next_page_token

string

If 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.

partial_errors[]

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.

SpanContext

The context of a span. This is attached to an Exemplar in Distribution values during aggregation.

It contains the name of a span with format:

projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID]
Fields
span_name

string

The resource name of the span. The format is:

projects/[PROJECT_ID_OR_NUMBER]/traces/[TRACE_ID]/spans/[SPAN_ID]

[TRACE_ID] is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array.

[SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array.

TextLocator

A locator for text. Indicates a particular part of the text of a request or of an object referenced in the request.

For example, suppose the request field text contains:

text: "The quick brown fox jumps over the lazy dog."

Then the locator:

source: "text" start_position { line: 1 column: 17 } end_position { line: 1 column: 19 }

refers to the part of the text: "fox".

Fields
source

string

The source of the text. The source may be a field in the request, in which case its format is the format of the google.rpc.BadRequest.FieldViolation.field field in https://documentation.s3ns.fr/apis/design/errors#error_details. It may also be be a source other than the request field (e.g. a macro definition referenced in the text of the query), in which case this is the name of the source (e.g. the macro name).

start_position

Position

The position of the first byte within the text.

end_position

Position

The position of the last byte within the text.

nested_locator

TextLocator

If source, start_position, and end_position describe a call on some object (e.g. a macro in the time series query language text) and a location is to be designated in that object's text, nested_locator identifies the location within that object.

nesting_reason

string

When nested_locator is set, this field gives the reason for the nesting. Usually, the reason is a macro invocation. In that case, the macro name (including the leading '@') signals the location of the macro call in the text and a macro argument name (including the leading '$') signals the location of the macro argument inside the macro body that got substituted away.

Position

The position of a byte within the text.

Fields
line

int32

The line, starting with 1, where the byte is positioned.

column

int32

The column within the line, starting with 1, where the byte is positioned. This is a byte index even though the text is UTF-8.

TimeInterval

Describes a time interval:

  • Reads: A half-open time interval. It includes the end time but excludes the start time: (startTime, endTime]. The start time must be specified, must be earlier than the end time, and should be no older than the data retention period for the metric.
  • Writes: A closed time interval. It extends from the start time to the end time, and includes both: [startTime, endTime]. Valid time intervals depend on the MetricKind of the metric value. The end time must not be earlier than the start time, and the end time must not be more than 25 hours in the past or more than five minutes in the future.
  • For GAUGE metrics, the startTime value is technically optional; if no value is specified, the start time defaults to the value of the end time, and the interval represents a single point in time. If both start and end times are specified, they must be identical. Such an interval is valid only for GAUGE metrics, which are point-in-time measurements. The end time of a new interval must be at least a millisecond after the end time of the previous interval.
  • For DELTA metrics, the start time and end time must specify a non-zero interval, with subsequent points specifying contiguous and non-overlapping intervals. For DELTA metrics, the start time of the next interval must be at least a millisecond after the end time of the previous interval.
  • For CUMULATIVE metrics, the start time and end time must specify a non-zero interval, with subsequent points specifying the same start time and increasing end times, until an event resets the cumulative value to zero and sets a new start time for the following points. The new start time must be at least a millisecond after the end time of the previous interval.
  • The start time of a new interval must be at least a millisecond after the end time of the previous interval because intervals are closed. If the start time of a new interval is the same as the end time of the previous interval, then data written at the new start time could overwrite data written at the previous end time.
Fields
end_time

Timestamp

Required. The end of the time interval.

start_time

Timestamp

Optional. The beginning of the time interval. The default value for the start time is the end time. The start time must not be later than the end time.

TimeSeries

A collection of data points that describes the time-varying values of a metric. A time series is identified by a combination of a fully-specified monitored resource and a fully-specified metric. This type is used for both listing and creating time series.

Fields
metric

Metric

The associated metric. A fully-specified metric used to identify the time series.

resource

MonitoredResource

The associated monitored resource. Custom metrics can use only certain monitored resource types in their time series data. For more information, see Monitored resources for custom metrics.

metadata

MonitoredResourceMetadata

Output only. The associated monitored resource metadata. When reading a time series, this field will include metadata labels that are explicitly named in the reduction. When creating a time series, this field is ignored.

metric_kind

MetricKind

The metric kind of the time series. When listing time series, this metric kind might be different from the metric kind of the associated metric if this time series is an alignment or reduction of other time series.

When creating a time series, this field is optional. If present, it must be the same as the metric kind of the associated metric. If the associated metric's descriptor must be auto-created, then this field specifies the metric kind of the new descriptor and must be either GAUGE (the default) or CUMULATIVE.

value_type

ValueType

The value type of the time series. When listing time series, this value type might be different from the value type of the associated metric if this time series is an alignment or reduction of other time series.

When creating a time series, this field is optional. If present, it must be the same as the type of the data in the points field.

points[]

Point

The data points of this time series. When listing time series, points are returned in reverse time order.

When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION.

unit

string

The units in which the metric value is reported. It is only applicable if the value_type is INT64, DOUBLE, or DISTRIBUTION. The unit defines the representation of the stored metric values. This field can only be changed through CreateTimeSeries when it is empty.

description

string

Input only. A detailed description of the time series that will be associated with the google.api.MetricDescriptor for the metric. Once set, this field cannot be changed through CreateTimeSeries.

TimeSeriesData

Represents the values of a time series associated with a TimeSeriesDescriptor.

Fields
label_values[]

LabelValue

The values of the labels in the time series identifier, given in the same order as the label_descriptors field of the TimeSeriesDescriptor associated with this object. Each value must have a value of the type given in the corresponding entry of label_descriptors.

point_data[]

PointData

The points in the time series.

PointData

A point's value columns and time interval. Each point has one or more point values corresponding to the entries in point_descriptors field in the TimeSeriesDescriptor associated with this object.

Fields
values[]

TypedValue

The values that make up the point.

time_interval

TimeInterval

The time interval associated with the point.

TimeSeriesDescriptor

A descriptor for the labels and points in a time series.

Fields
label_descriptors[]

LabelDescriptor

Descriptors for the labels.

point_descriptors[]

ValueDescriptor

Descriptors for the point data value columns.

ValueDescriptor

A descriptor for the value columns in a data point.

Fields
key

string

The value key.

value_type

ValueType

The value type.

metric_kind

MetricKind

The value stream kind.

unit

string

The unit in which time_series point values are reported. unit follows the UCUM format for units as seen in https://unitsofmeasure.org/ucum.html. unit is only valid if value_type is INTEGER, DOUBLE, DISTRIBUTION.

TypedValue

A single strongly-typed value.

Fields
Union field value. The typed value field. value can be only one of the following:
bool_value

bool

A Boolean value: true or false.

int64_value

int64

A 64-bit integer. Its range is approximately ±9.2x1018.

double_value

double

A 64-bit double-precision floating-point number. Its magnitude is approximately ±10±300 and it has 16 significant digits of precision.

string_value

string

A variable-length string value.

distribution_value

Distribution

A distribution value.