Class MetricDescriptor.Builder (2.30.0)

public static final class MetricDescriptor.Builder extends GeneratedMessageV3.Builder<MetricDescriptor.Builder> implements MetricDescriptorOrBuilder

Defines a metric type and its schema. Once a metric descriptor is created, deleting or altering it stops data collection and makes the metric type's existing data unusable.

Protobuf type google.api.MetricDescriptor

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllLabels(Iterable<? extends LabelDescriptor> values)

public MetricDescriptor.Builder addAllLabels(Iterable<? extends LabelDescriptor> values)

The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.

repeated .google.api.LabelDescriptor labels = 2;

Parameter
Name Description
values Iterable<? extends com.google.api.LabelDescriptor>
Returns
Type Description
MetricDescriptor.Builder

addAllMonitoredResourceTypes(Iterable<String> values)

public MetricDescriptor.Builder addAllMonitoredResourceTypes(Iterable<String> values)

Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.

repeated string monitored_resource_types = 13;

Parameter
Name Description
values Iterable<String>

The monitoredResourceTypes to add.

Returns
Type Description
MetricDescriptor.Builder

This builder for chaining.

addLabels(LabelDescriptor value)

public MetricDescriptor.Builder addLabels(LabelDescriptor value)

The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.

repeated .google.api.LabelDescriptor labels = 2;

Parameter
Name Description
value LabelDescriptor
Returns
Type Description
MetricDescriptor.Builder

addLabels(LabelDescriptor.Builder builderForValue)

public MetricDescriptor.Builder addLabels(LabelDescriptor.Builder builderForValue)

The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.

repeated .google.api.LabelDescriptor labels = 2;

Parameter
Name Description
builderForValue LabelDescriptor.Builder
Returns
Type Description
MetricDescriptor.Builder

addLabels(int index, LabelDescriptor value)

public MetricDescriptor.Builder addLabels(int index, LabelDescriptor value)

The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.

repeated .google.api.LabelDescriptor labels = 2;

Parameters
Name Description
index int
value LabelDescriptor
Returns
Type Description
MetricDescriptor.Builder

addLabels(int index, LabelDescriptor.Builder builderForValue)

public MetricDescriptor.Builder addLabels(int index, LabelDescriptor.Builder builderForValue)

The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.

repeated .google.api.LabelDescriptor labels = 2;

Parameters
Name Description
index int
builderForValue LabelDescriptor.Builder
Returns
Type Description
MetricDescriptor.Builder

addLabelsBuilder()

public LabelDescriptor.Builder addLabelsBuilder()

The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.

repeated .google.api.LabelDescriptor labels = 2;

Returns
Type Description
LabelDescriptor.Builder

addLabelsBuilder(int index)

public LabelDescriptor.Builder addLabelsBuilder(int index)

The set of labels that can be used to describe a specific instance of this metric type. For example, the appengine.googleapis.com/http/server/response_latencies metric type has a label for the HTTP response code, response_code, so you can look at latencies for successful responses or just for responses that failed.

repeated .google.api.LabelDescriptor labels = 2;

Parameter
Name Description
index int
Returns
Type Description
LabelDescriptor.Builder

addMonitoredResourceTypes(String value)

public MetricDescriptor.Builder addMonitoredResourceTypes(String value)

Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.

repeated string monitored_resource_types = 13;

Parameter
Name Description
value String

The monitoredResourceTypes to add.

Returns
Type Description
MetricDescriptor.Builder

This builder for chaining.

addMonitoredResourceTypesBytes(ByteString value)

public MetricDescriptor.Builder addMonitoredResourceTypesBytes(ByteString value)

Read-only. If present, then a time series, which is identified partially by a metric type and a MonitoredResourceDescriptor, that is associated with this metric type can only be associated with one of the monitored resource types listed here.

repeated string monitored_resource_types = 13;

Parameter
Name Description
value ByteString

The bytes of the monitoredResourceTypes to add.

Returns
Type Description
MetricDescriptor.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public MetricDescriptor.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field