Class MetricsData.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<MetricsData.Builder>
io.opentelemetry.proto.metrics.v1.MetricsData.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, MetricsDataOrBuilder, Cloneable
Enclosing class:
MetricsData

public static final class MetricsData.Builder extends com.google.protobuf.GeneratedMessage.Builder<MetricsData.Builder> implements MetricsDataOrBuilder
 MetricsData represents the metrics data that can be stored in a persistent
 storage, OR can be embedded by other protocols that transfer OTLP metrics
 data but do not implement the OTLP protocol.

 MetricsData
 └─── ResourceMetrics
 ├── Resource
 ├── SchemaURL
 └── ScopeMetrics
 ├── Scope
 ├── SchemaURL
 └── Metric
 ├── Name
 ├── Description
 ├── Unit
 └── data
 ├── Gauge
 ├── Sum
 ├── Histogram
 ├── ExponentialHistogram
 └── Summary

 The main difference between this message and collector protocol is that
 in this message there will not be any "control" or "metadata" specific to
 OTLP protocol.

 When new fields are added into this message, the OTLP request MUST be updated
 as well.
 
Protobuf type opentelemetry.proto.metrics.v1.MetricsData
  • 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<MetricsData.Builder>
    • clear

      public MetricsData.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<MetricsData.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<MetricsData.Builder>
    • getDefaultInstanceForType

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

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

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

      public MetricsData.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<MetricsData.Builder>
    • mergeFrom

      public MetricsData.Builder mergeFrom(MetricsData other)
    • isInitialized

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

      public MetricsData.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<MetricsData.Builder>
      Throws:
      IOException
    • getResourceMetricsList

      public List<ResourceMetrics> getResourceMetricsList()
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
      Specified by:
      getResourceMetricsList in interface MetricsDataOrBuilder
    • getResourceMetricsCount

      public int getResourceMetricsCount()
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
      Specified by:
      getResourceMetricsCount in interface MetricsDataOrBuilder
    • getResourceMetrics

      public ResourceMetrics getResourceMetrics(int index)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
      Specified by:
      getResourceMetrics in interface MetricsDataOrBuilder
    • setResourceMetrics

      public MetricsData.Builder setResourceMetrics(int index, ResourceMetrics value)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • setResourceMetrics

      public MetricsData.Builder setResourceMetrics(int index, ResourceMetrics.Builder builderForValue)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • addResourceMetrics

      public MetricsData.Builder addResourceMetrics(ResourceMetrics value)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • addResourceMetrics

      public MetricsData.Builder addResourceMetrics(int index, ResourceMetrics value)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • addResourceMetrics

      public MetricsData.Builder addResourceMetrics(ResourceMetrics.Builder builderForValue)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • addResourceMetrics

      public MetricsData.Builder addResourceMetrics(int index, ResourceMetrics.Builder builderForValue)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • addAllResourceMetrics

      public MetricsData.Builder addAllResourceMetrics(Iterable<? extends ResourceMetrics> values)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • clearResourceMetrics

      public MetricsData.Builder clearResourceMetrics()
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • removeResourceMetrics

      public MetricsData.Builder removeResourceMetrics(int index)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • getResourceMetricsBuilder

      public ResourceMetrics.Builder getResourceMetricsBuilder(int index)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • getResourceMetricsOrBuilder

      public ResourceMetricsOrBuilder getResourceMetricsOrBuilder(int index)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
      Specified by:
      getResourceMetricsOrBuilder in interface MetricsDataOrBuilder
    • getResourceMetricsOrBuilderList

      public List<? extends ResourceMetricsOrBuilder> getResourceMetricsOrBuilderList()
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
      Specified by:
      getResourceMetricsOrBuilderList in interface MetricsDataOrBuilder
    • addResourceMetricsBuilder

      public ResourceMetrics.Builder addResourceMetricsBuilder()
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • addResourceMetricsBuilder

      public ResourceMetrics.Builder addResourceMetricsBuilder(int index)
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;
    • getResourceMetricsBuilderList

      public List<ResourceMetrics.Builder> getResourceMetricsBuilderList()
       An array of ResourceMetrics.
       For data coming from a single resource this array will typically contain
       one element. Intermediary nodes that receive data from multiple origins
       typically batch the data before forwarding further and in that case this
       array will contain multiple elements.
       
      repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;