Class Monitoring.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<Monitoring.Builder>
com.google.api.Monitoring.Builder
All Implemented Interfaces:
MonitoringOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
Monitoring

public static final class Monitoring.Builder extends com.google.protobuf.GeneratedMessage.Builder<Monitoring.Builder> implements MonitoringOrBuilder
 Monitoring configuration of the service.

 The example below shows how to configure monitored resources and metrics
 for monitoring. In the example, a monitored resource and two metrics are
 defined. The `library.googleapis.com/book/returned_count` metric is sent
 to both producer and consumer projects, whereas the
 `library.googleapis.com/book/num_overdue` metric is only sent to the
 consumer project.

 monitored_resources:
 - type: library.googleapis.com/Branch
 display_name: "Library Branch"
 description: "A branch of a library."
 launch_stage: GA
 labels:
 - key: resource_container
 description: "The Cloud container (ie. project id) for the Branch."
 - key: location
 description: "The location of the library branch."
 - key: branch_id
 description: "The id of the branch."
 metrics:
 - name: library.googleapis.com/book/returned_count
 display_name: "Books Returned"
 description: "The count of books that have been returned."
 launch_stage: GA
 metric_kind: DELTA
 value_type: INT64
 unit: "1"
 labels:
 - key: customer_id
 description: "The id of the customer."
 - name: library.googleapis.com/book/num_overdue
 display_name: "Books Overdue"
 description: "The current number of overdue books."
 launch_stage: GA
 metric_kind: GAUGE
 value_type: INT64
 unit: "1"
 labels:
 - key: customer_id
 description: "The id of the customer."
 monitoring:
 producer_destinations:
 - monitored_resource: library.googleapis.com/Branch
 metrics:
 - library.googleapis.com/book/returned_count
 consumer_destinations:
 - monitored_resource: library.googleapis.com/Branch
 metrics:
 - library.googleapis.com/book/returned_count
 - library.googleapis.com/book/num_overdue
 
Protobuf type google.api.Monitoring
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<Monitoring.Builder>
    • clear

      public Monitoring.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<Monitoring.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Monitoring.Builder>
    • getDefaultInstanceForType

      public Monitoring getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public Monitoring build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Monitoring buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public Monitoring.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Monitoring.Builder>
    • mergeFrom

      public Monitoring.Builder mergeFrom(Monitoring other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<Monitoring.Builder>
    • mergeFrom

      public Monitoring.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Monitoring.Builder>
      Throws:
      IOException
    • getProducerDestinationsList

      public List<Monitoring.MonitoringDestination> getProducerDestinationsList()
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
      Specified by:
      getProducerDestinationsList in interface MonitoringOrBuilder
    • getProducerDestinationsCount

      public int getProducerDestinationsCount()
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
      Specified by:
      getProducerDestinationsCount in interface MonitoringOrBuilder
    • getProducerDestinations

      public Monitoring.MonitoringDestination getProducerDestinations(int index)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
      Specified by:
      getProducerDestinations in interface MonitoringOrBuilder
    • setProducerDestinations

      public Monitoring.Builder setProducerDestinations(int index, Monitoring.MonitoringDestination value)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • setProducerDestinations

      public Monitoring.Builder setProducerDestinations(int index, Monitoring.MonitoringDestination.Builder builderForValue)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • addProducerDestinations

      public Monitoring.Builder addProducerDestinations(Monitoring.MonitoringDestination value)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • addProducerDestinations

      public Monitoring.Builder addProducerDestinations(int index, Monitoring.MonitoringDestination value)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • addProducerDestinations

      public Monitoring.Builder addProducerDestinations(Monitoring.MonitoringDestination.Builder builderForValue)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • addProducerDestinations

      public Monitoring.Builder addProducerDestinations(int index, Monitoring.MonitoringDestination.Builder builderForValue)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • addAllProducerDestinations

      public Monitoring.Builder addAllProducerDestinations(Iterable<? extends Monitoring.MonitoringDestination> values)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • clearProducerDestinations

      public Monitoring.Builder clearProducerDestinations()
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • removeProducerDestinations

      public Monitoring.Builder removeProducerDestinations(int index)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • getProducerDestinationsBuilder

      public Monitoring.MonitoringDestination.Builder getProducerDestinationsBuilder(int index)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • getProducerDestinationsOrBuilder

      public Monitoring.MonitoringDestinationOrBuilder getProducerDestinationsOrBuilder(int index)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
      Specified by:
      getProducerDestinationsOrBuilder in interface MonitoringOrBuilder
    • getProducerDestinationsOrBuilderList

      public List<? extends Monitoring.MonitoringDestinationOrBuilder> getProducerDestinationsOrBuilderList()
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
      Specified by:
      getProducerDestinationsOrBuilderList in interface MonitoringOrBuilder
    • addProducerDestinationsBuilder

      public Monitoring.MonitoringDestination.Builder addProducerDestinationsBuilder()
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • addProducerDestinationsBuilder

      public Monitoring.MonitoringDestination.Builder addProducerDestinationsBuilder(int index)
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • getProducerDestinationsBuilderList

      public List<Monitoring.MonitoringDestination.Builder> getProducerDestinationsBuilderList()
       Monitoring configurations for sending metrics to the producer project.
       There can be multiple producer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination producer_destinations = 1;
    • getConsumerDestinationsList

      public List<Monitoring.MonitoringDestination> getConsumerDestinationsList()
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
      Specified by:
      getConsumerDestinationsList in interface MonitoringOrBuilder
    • getConsumerDestinationsCount

      public int getConsumerDestinationsCount()
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
      Specified by:
      getConsumerDestinationsCount in interface MonitoringOrBuilder
    • getConsumerDestinations

      public Monitoring.MonitoringDestination getConsumerDestinations(int index)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
      Specified by:
      getConsumerDestinations in interface MonitoringOrBuilder
    • setConsumerDestinations

      public Monitoring.Builder setConsumerDestinations(int index, Monitoring.MonitoringDestination value)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • setConsumerDestinations

      public Monitoring.Builder setConsumerDestinations(int index, Monitoring.MonitoringDestination.Builder builderForValue)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • addConsumerDestinations

      public Monitoring.Builder addConsumerDestinations(Monitoring.MonitoringDestination value)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • addConsumerDestinations

      public Monitoring.Builder addConsumerDestinations(int index, Monitoring.MonitoringDestination value)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • addConsumerDestinations

      public Monitoring.Builder addConsumerDestinations(Monitoring.MonitoringDestination.Builder builderForValue)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • addConsumerDestinations

      public Monitoring.Builder addConsumerDestinations(int index, Monitoring.MonitoringDestination.Builder builderForValue)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • addAllConsumerDestinations

      public Monitoring.Builder addAllConsumerDestinations(Iterable<? extends Monitoring.MonitoringDestination> values)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • clearConsumerDestinations

      public Monitoring.Builder clearConsumerDestinations()
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • removeConsumerDestinations

      public Monitoring.Builder removeConsumerDestinations(int index)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • getConsumerDestinationsBuilder

      public Monitoring.MonitoringDestination.Builder getConsumerDestinationsBuilder(int index)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • getConsumerDestinationsOrBuilder

      public Monitoring.MonitoringDestinationOrBuilder getConsumerDestinationsOrBuilder(int index)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
      Specified by:
      getConsumerDestinationsOrBuilder in interface MonitoringOrBuilder
    • getConsumerDestinationsOrBuilderList

      public List<? extends Monitoring.MonitoringDestinationOrBuilder> getConsumerDestinationsOrBuilderList()
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
      Specified by:
      getConsumerDestinationsOrBuilderList in interface MonitoringOrBuilder
    • addConsumerDestinationsBuilder

      public Monitoring.MonitoringDestination.Builder addConsumerDestinationsBuilder()
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • addConsumerDestinationsBuilder

      public Monitoring.MonitoringDestination.Builder addConsumerDestinationsBuilder(int index)
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;
    • getConsumerDestinationsBuilderList

      public List<Monitoring.MonitoringDestination.Builder> getConsumerDestinationsBuilderList()
       Monitoring configurations for sending metrics to the consumer project.
       There can be multiple consumer destinations. A monitored resource type may
       appear in multiple monitoring destinations if different aggregations are
       needed for different sets of metrics associated with that monitored
       resource type. A monitored resource and metric pair may only be used once
       in the Monitoring configuration.
       
      repeated .google.api.Monitoring.MonitoringDestination consumer_destinations = 2;