public com.google.api.MonitoredResource toPb() { return com.google.api.MonitoredResource.newBuilder().setType(type).putAllLabels(labels).build(); }
/** * * * <pre> * The associated metric. A fully-specified metric used to identify the time * series. * </pre> * * <code>.google.api.Metric metric = 1;</code> */ public com.google.api.Metric getMetric() { return metric_ == null ? com.google.api.Metric.getDefaultInstance() : metric_; } /**
/** * * * <pre> * A distribution value. * </pre> * * <code>.google.api.Distribution distribution_value = 5;</code> */ public com.google.api.DistributionOrBuilder getDistributionValueOrBuilder() { if (valueCase_ == 5) { return (com.google.api.Distribution) value_; } return com.google.api.Distribution.getDefaultInstance(); }
public com.google.api.MonitoredResourceDescriptor toPb() { com.google.api.MonitoredResourceDescriptor.Builder builder = com.google.api.MonitoredResourceDescriptor.newBuilder() .setType(type) .addAllLabels(Iterables.transform(labels, LabelDescriptor.TO_PB_FUNCTION)); if (name != null) { builder.setName(name); } if (displayName != null) { builder.setDisplayName(displayName); } if (description != null) { builder.setDescription(description); } return builder.build(); }
com.google.api.LabelDescriptor toPb() { com.google.api.LabelDescriptor.Builder builder = com.google.api.LabelDescriptor.newBuilder().setKey(key).setValueType(valueType.toPb()); if (description != null) { builder.setDescription(description); } return builder.build(); }
/** * * * <pre> * The associated monitored resource. Custom metrics can use only certain * monitored resource types in their time series data. * </pre> * * <code>.google.api.MonitoredResource resource = 2;</code> */ public com.google.api.MonitoredResource getResource() { return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; } /**
/** * * * <pre> * The new [custom metric](/monitoring/custom-metrics) * descriptor. * </pre> * * <code>.google.api.MetricDescriptor metric_descriptor = 2;</code> */ public com.google.api.MetricDescriptor getMetricDescriptor() { return metricDescriptor_ == null ? com.google.api.MetricDescriptor.getDefaultInstance() : metricDescriptor_; } /**
public static MonitoredResource fromPb(com.google.api.MonitoredResource descriptorPb) { return new Builder(descriptorPb.getType()).setLabels(descriptorPb.getLabelsMap()).build(); } }
/** * * * <pre> * 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. * </pre> * * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code> */ public com.google.api.MetricDescriptor.ValueType getValueType() { @SuppressWarnings("deprecation") com.google.api.MetricDescriptor.ValueType result = com.google.api.MetricDescriptor.ValueType.valueOf(valueType_); return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result; }
/** * * * <pre> * 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`. * </pre> * * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code> */ public com.google.api.MetricDescriptor.MetricKind getMetricKind() { @SuppressWarnings("deprecation") com.google.api.MetricDescriptor.MetricKind result = com.google.api.MetricDescriptor.MetricKind.valueOf(metricKind_); return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result; }
/** * * * <pre> * Output only. The associated monitored resource metadata. When reading a * a timeseries, this field will include metadata labels that are explicitly * named in the reduction. When creating a timeseries, this field is ignored. * </pre> * * <code>.google.api.MonitoredResourceMetadata metadata = 7;</code> */ public com.google.api.MonitoredResourceMetadata getMetadata() { return metadata_ == null ? com.google.api.MonitoredResourceMetadata.getDefaultInstance() : metadata_; } /**
/** * * * <pre> * Optional. The `bucket_options` are required when the logs-based metric is * using a DISTRIBUTION value type and it describes the bucket boundaries * used to create a histogram of the extracted values. * </pre> * * <code>.google.api.Distribution.BucketOptions bucket_options = 8;</code> */ public com.google.api.Distribution.BucketOptions getBucketOptions() { return bucketOptions_ == null ? com.google.api.Distribution.BucketOptions.getDefaultInstance() : bucketOptions_; } /**
/** * * * <pre> * Required. The primary monitored resource associated with this log entry. * Example: a log entry that reports a database error would be * associated with the monitored resource designating the particular * database that reported the error. * </pre> * * <code>.google.api.MonitoredResource resource = 8;</code> */ public com.google.api.MonitoredResource getResource() { return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; } /**
/** * * * <pre> * A distribution value. * </pre> * * <code>.google.api.Distribution distribution_value = 5;</code> */ public com.google.api.Distribution getDistributionValue() { if (valueCase_ == 5) { return (com.google.api.Distribution) value_; } return com.google.api.Distribution.getDefaultInstance(); } /**
/** * * * <pre> * 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. * </pre> * * <code>.google.api.MetricDescriptor.ValueType value_type = 4;</code> */ public com.google.api.MetricDescriptor.ValueType getValueType() { @SuppressWarnings("deprecation") com.google.api.MetricDescriptor.ValueType result = com.google.api.MetricDescriptor.ValueType.valueOf(valueType_); return result == null ? com.google.api.MetricDescriptor.ValueType.UNRECOGNIZED : result; } /**
/** * * * <pre> * 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`. * </pre> * * <code>.google.api.MetricDescriptor.MetricKind metric_kind = 3;</code> */ public com.google.api.MetricDescriptor.MetricKind getMetricKind() { @SuppressWarnings("deprecation") com.google.api.MetricDescriptor.MetricKind result = com.google.api.MetricDescriptor.MetricKind.valueOf(metricKind_); return result == null ? com.google.api.MetricDescriptor.MetricKind.UNRECOGNIZED : result; } /**
/** * * * <pre> * Output only. Additional metadata about the monitored resource. * Only `k8s_container`, `k8s_pod`, and `k8s_node` MonitoredResources have * this field populated. * </pre> * * <code>.google.api.MonitoredResourceMetadata metadata = 25;</code> */ public com.google.api.MonitoredResourceMetadata getMetadata() { return metadata_ == null ? com.google.api.MonitoredResourceMetadata.getDefaultInstance() : metadata_; } /**
/** * * * <pre> * Optional. A default monitored resource object that is assigned to all log * entries in `entries` that do not specify a value for `resource`. Example: * { "type": "gce_instance", * "labels": { * "zone": "us-central1-a", "instance_id": "00000000000000000000" }} * See [LogEntry][google.logging.v2.LogEntry]. * </pre> * * <code>.google.api.MonitoredResource resource = 2;</code> */ public com.google.api.MonitoredResource getResource() { return resource_ == null ? com.google.api.MonitoredResource.getDefaultInstance() : resource_; } /**
/** * * * <pre> * The [monitored * resource](https://cloud.google.com/monitoring/api/resources) associated * with the configuration. * The following monitored resource types are supported for uptime checks: * uptime_url * gce_instance * gae_app * aws_ec2_instance * aws_elb_load_balancer * </pre> * * <code>.google.api.MonitoredResource monitored_resource = 3;</code> */ public com.google.api.MonitoredResource getMonitoredResource() { if (resourceCase_ == 3) { return (com.google.api.MonitoredResource) resource_; } return com.google.api.MonitoredResource.getDefaultInstance(); } /**
/** * * * <pre> * The [monitored * resource](https://cloud.google.com/monitoring/api/resources) associated * with the configuration. * The following monitored resource types are supported for uptime checks: * uptime_url * gce_instance * gae_app * aws_ec2_instance * aws_elb_load_balancer * </pre> * * <code>.google.api.MonitoredResource monitored_resource = 3;</code> */ public com.google.api.MonitoredResourceOrBuilder getMonitoredResourceOrBuilder() { if (resourceCase_ == 3) { return (com.google.api.MonitoredResource) resource_; } return com.google.api.MonitoredResource.getDefaultInstance(); }