Class ProcessContext.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ProcessContext.Builder>
io.opentelemetry.proto.processcontext.v1development.ProcessContext.Builder
All Implemented Interfaces:
com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, ProcessContextOrBuilder, Cloneable
Enclosing class:
ProcessContext

public static final class ProcessContext.Builder extends com.google.protobuf.GeneratedMessage.Builder<ProcessContext.Builder> implements ProcessContextOrBuilder
 ProcessContext represents the payload for the process context sharing mechanism.

 This message is designed to be published by OpenTelemetry SDKs via a memory-mapped
 region, allowing external readers (such as the OpenTelemetry eBPF Profiler) to
 discover and read resource attributes from instrumented processes without requiring
 direct integration or process activity. It is not part of OTLP and is not
 exchanged via the OpenTelemetry Collector.

 See OTEP 4719 (https://github.com/open-telemetry/opentelemetry-specification/blob/main/oteps/profiles/4719-process-ctx.md)
 for details of this mechanism.

 Status: [Development]
 
Protobuf type opentelemetry.proto.processcontext.v1development.ProcessContext
  • 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<ProcessContext.Builder>
    • clear

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

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

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

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

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

      public ProcessContext.Builder mergeFrom(ProcessContext other)
    • isInitialized

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

      public ProcessContext.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<ProcessContext.Builder>
      Throws:
      IOException
    • hasResource

      public boolean hasResource()
       The resource for this process.
       If this field is not set then no resource info is known.
       
      .opentelemetry.proto.resource.v1.Resource resource = 1;
      Specified by:
      hasResource in interface ProcessContextOrBuilder
      Returns:
      Whether the resource field is set.
    • getResource

      public Resource getResource()
       The resource for this process.
       If this field is not set then no resource info is known.
       
      .opentelemetry.proto.resource.v1.Resource resource = 1;
      Specified by:
      getResource in interface ProcessContextOrBuilder
      Returns:
      The resource.
    • setResource

      public ProcessContext.Builder setResource(Resource value)
       The resource for this process.
       If this field is not set then no resource info is known.
       
      .opentelemetry.proto.resource.v1.Resource resource = 1;
    • setResource

      public ProcessContext.Builder setResource(Resource.Builder builderForValue)
       The resource for this process.
       If this field is not set then no resource info is known.
       
      .opentelemetry.proto.resource.v1.Resource resource = 1;
    • mergeResource

      public ProcessContext.Builder mergeResource(Resource value)
       The resource for this process.
       If this field is not set then no resource info is known.
       
      .opentelemetry.proto.resource.v1.Resource resource = 1;
    • clearResource

      public ProcessContext.Builder clearResource()
       The resource for this process.
       If this field is not set then no resource info is known.
       
      .opentelemetry.proto.resource.v1.Resource resource = 1;
    • getResourceBuilder

      public Resource.Builder getResourceBuilder()
       The resource for this process.
       If this field is not set then no resource info is known.
       
      .opentelemetry.proto.resource.v1.Resource resource = 1;
    • getResourceOrBuilder

      public ResourceOrBuilder getResourceOrBuilder()
       The resource for this process.
       If this field is not set then no resource info is known.
       
      .opentelemetry.proto.resource.v1.Resource resource = 1;
      Specified by:
      getResourceOrBuilder in interface ProcessContextOrBuilder
    • getAttributesList

      public List<KeyValue> getAttributesList()
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
      Specified by:
      getAttributesList in interface ProcessContextOrBuilder
    • getAttributesCount

      public int getAttributesCount()
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
      Specified by:
      getAttributesCount in interface ProcessContextOrBuilder
    • getAttributes

      public KeyValue getAttributes(int index)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
      Specified by:
      getAttributes in interface ProcessContextOrBuilder
    • setAttributes

      public ProcessContext.Builder setAttributes(int index, KeyValue value)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • setAttributes

      public ProcessContext.Builder setAttributes(int index, KeyValue.Builder builderForValue)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • addAttributes

      public ProcessContext.Builder addAttributes(KeyValue value)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • addAttributes

      public ProcessContext.Builder addAttributes(int index, KeyValue value)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • addAttributes

      public ProcessContext.Builder addAttributes(KeyValue.Builder builderForValue)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • addAttributes

      public ProcessContext.Builder addAttributes(int index, KeyValue.Builder builderForValue)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • addAllAttributes

      public ProcessContext.Builder addAllAttributes(Iterable<? extends KeyValue> values)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • clearAttributes

      public ProcessContext.Builder clearAttributes()
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • removeAttributes

      public ProcessContext.Builder removeAttributes(int index)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • getAttributesBuilder

      public KeyValue.Builder getAttributesBuilder(int index)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • getAttributesOrBuilder

      public KeyValueOrBuilder getAttributesOrBuilder(int index)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
      Specified by:
      getAttributesOrBuilder in interface ProcessContextOrBuilder
    • getAttributesOrBuilderList

      public List<? extends KeyValueOrBuilder> getAttributesOrBuilderList()
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
      Specified by:
      getAttributesOrBuilderList in interface ProcessContextOrBuilder
    • addAttributesBuilder

      public KeyValue.Builder addAttributesBuilder()
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • addAttributesBuilder

      public KeyValue.Builder addAttributesBuilder(int index)
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;
    • getAttributesBuilderList

      public List<KeyValue.Builder> getAttributesBuilderList()
       Additional attributes to share with external readers that are not part of
       the standard Resource. [Optional]
      
       This field allows publishers to include supplementary key-value pairs that
       may be useful for external readers but are not part of the SDK's configured
       Resource.
      
       Consider adding any keys here to the profiles semantic conventions in
       https://opentelemetry.io/docs/specs/semconv/general/profiles/
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 2;