Class LogRecord.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, LogRecordOrBuilder, Cloneable
    Enclosing class:
    LogRecord

    public static final class LogRecord.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>
    implements LogRecordOrBuilder
     A log record according to OpenTelemetry Log Data Model:
     https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md
     
    Protobuf type opentelemetry.proto.logs.v1.LogRecord
    • Method Detail

      • getDescriptor

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

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

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

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

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

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

        public LogRecord.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>
      • setField

        public LogRecord.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                          Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>
      • clearField

        public LogRecord.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>
      • clearOneof

        public LogRecord.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>
      • setRepeatedField

        public LogRecord.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  int index,
                                                  Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>
      • addRepeatedField

        public LogRecord.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>
      • mergeFrom

        public LogRecord.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<LogRecord.Builder>
      • isInitialized

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

        public LogRecord.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<LogRecord.Builder>
        Throws:
        IOException
      • getTimeUnixNano

        public long getTimeUnixNano()
         time_unix_nano is the time when the event occurred.
         Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
         Value of 0 indicates unknown or missing timestamp.
         
        fixed64 time_unix_nano = 1;
        Specified by:
        getTimeUnixNano in interface LogRecordOrBuilder
      • setTimeUnixNano

        public LogRecord.Builder setTimeUnixNano​(long value)
         time_unix_nano is the time when the event occurred.
         Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
         Value of 0 indicates unknown or missing timestamp.
         
        fixed64 time_unix_nano = 1;
      • clearTimeUnixNano

        public LogRecord.Builder clearTimeUnixNano()
         time_unix_nano is the time when the event occurred.
         Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
         Value of 0 indicates unknown or missing timestamp.
         
        fixed64 time_unix_nano = 1;
      • getSeverityNumberValue

        public int getSeverityNumberValue()
         Numerical value of the severity, normalized to values described in Log Data Model.
         [Optional].
         
        .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;
        Specified by:
        getSeverityNumberValue in interface LogRecordOrBuilder
      • setSeverityNumberValue

        public LogRecord.Builder setSeverityNumberValue​(int value)
         Numerical value of the severity, normalized to values described in Log Data Model.
         [Optional].
         
        .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;
      • getSeverityNumber

        public SeverityNumber getSeverityNumber()
         Numerical value of the severity, normalized to values described in Log Data Model.
         [Optional].
         
        .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;
        Specified by:
        getSeverityNumber in interface LogRecordOrBuilder
      • setSeverityNumber

        public LogRecord.Builder setSeverityNumber​(SeverityNumber value)
         Numerical value of the severity, normalized to values described in Log Data Model.
         [Optional].
         
        .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;
      • clearSeverityNumber

        public LogRecord.Builder clearSeverityNumber()
         Numerical value of the severity, normalized to values described in Log Data Model.
         [Optional].
         
        .opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;
      • getSeverityText

        public String getSeverityText()
         The severity text (also known as log level). The original string representation as
         it is known at the source. [Optional].
         
        string severity_text = 3;
        Specified by:
        getSeverityText in interface LogRecordOrBuilder
      • getSeverityTextBytes

        public com.google.protobuf.ByteString getSeverityTextBytes()
         The severity text (also known as log level). The original string representation as
         it is known at the source. [Optional].
         
        string severity_text = 3;
        Specified by:
        getSeverityTextBytes in interface LogRecordOrBuilder
      • setSeverityText

        public LogRecord.Builder setSeverityText​(String value)
         The severity text (also known as log level). The original string representation as
         it is known at the source. [Optional].
         
        string severity_text = 3;
      • clearSeverityText

        public LogRecord.Builder clearSeverityText()
         The severity text (also known as log level). The original string representation as
         it is known at the source. [Optional].
         
        string severity_text = 3;
      • setSeverityTextBytes

        public LogRecord.Builder setSeverityTextBytes​(com.google.protobuf.ByteString value)
         The severity text (also known as log level). The original string representation as
         it is known at the source. [Optional].
         
        string severity_text = 3;
      • getName

        public String getName()
         Short event identifier that does not contain varying parts. Name describes
         what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
         characters. Not guaranteed to be unique in any way. [Optional].
         
        string name = 4;
        Specified by:
        getName in interface LogRecordOrBuilder
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Short event identifier that does not contain varying parts. Name describes
         what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
         characters. Not guaranteed to be unique in any way. [Optional].
         
        string name = 4;
        Specified by:
        getNameBytes in interface LogRecordOrBuilder
      • setName

        public LogRecord.Builder setName​(String value)
         Short event identifier that does not contain varying parts. Name describes
         what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
         characters. Not guaranteed to be unique in any way. [Optional].
         
        string name = 4;
      • clearName

        public LogRecord.Builder clearName()
         Short event identifier that does not contain varying parts. Name describes
         what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
         characters. Not guaranteed to be unique in any way. [Optional].
         
        string name = 4;
      • setNameBytes

        public LogRecord.Builder setNameBytes​(com.google.protobuf.ByteString value)
         Short event identifier that does not contain varying parts. Name describes
         what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
         characters. Not guaranteed to be unique in any way. [Optional].
         
        string name = 4;
      • hasBody

        public boolean hasBody()
         A value containing the body of the log record. Can be for example a human-readable
         string message (including multi-line) describing the event in a free form or it can
         be a structured data composed of arrays and maps of other values. [Optional].
         
        .opentelemetry.proto.common.v1.AnyValue body = 5;
        Specified by:
        hasBody in interface LogRecordOrBuilder
      • getBody

        public AnyValue getBody()
         A value containing the body of the log record. Can be for example a human-readable
         string message (including multi-line) describing the event in a free form or it can
         be a structured data composed of arrays and maps of other values. [Optional].
         
        .opentelemetry.proto.common.v1.AnyValue body = 5;
        Specified by:
        getBody in interface LogRecordOrBuilder
      • setBody

        public LogRecord.Builder setBody​(AnyValue value)
         A value containing the body of the log record. Can be for example a human-readable
         string message (including multi-line) describing the event in a free form or it can
         be a structured data composed of arrays and maps of other values. [Optional].
         
        .opentelemetry.proto.common.v1.AnyValue body = 5;
      • setBody

        public LogRecord.Builder setBody​(AnyValue.Builder builderForValue)
         A value containing the body of the log record. Can be for example a human-readable
         string message (including multi-line) describing the event in a free form or it can
         be a structured data composed of arrays and maps of other values. [Optional].
         
        .opentelemetry.proto.common.v1.AnyValue body = 5;
      • mergeBody

        public LogRecord.Builder mergeBody​(AnyValue value)
         A value containing the body of the log record. Can be for example a human-readable
         string message (including multi-line) describing the event in a free form or it can
         be a structured data composed of arrays and maps of other values. [Optional].
         
        .opentelemetry.proto.common.v1.AnyValue body = 5;
      • clearBody

        public LogRecord.Builder clearBody()
         A value containing the body of the log record. Can be for example a human-readable
         string message (including multi-line) describing the event in a free form or it can
         be a structured data composed of arrays and maps of other values. [Optional].
         
        .opentelemetry.proto.common.v1.AnyValue body = 5;
      • getBodyBuilder

        public AnyValue.Builder getBodyBuilder()
         A value containing the body of the log record. Can be for example a human-readable
         string message (including multi-line) describing the event in a free form or it can
         be a structured data composed of arrays and maps of other values. [Optional].
         
        .opentelemetry.proto.common.v1.AnyValue body = 5;
      • getBodyOrBuilder

        public AnyValueOrBuilder getBodyOrBuilder()
         A value containing the body of the log record. Can be for example a human-readable
         string message (including multi-line) describing the event in a free form or it can
         be a structured data composed of arrays and maps of other values. [Optional].
         
        .opentelemetry.proto.common.v1.AnyValue body = 5;
        Specified by:
        getBodyOrBuilder in interface LogRecordOrBuilder
      • getAttributesList

        public List<KeyValue> getAttributesList()
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
        Specified by:
        getAttributesList in interface LogRecordOrBuilder
      • getAttributesCount

        public int getAttributesCount()
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
        Specified by:
        getAttributesCount in interface LogRecordOrBuilder
      • getAttributes

        public KeyValue getAttributes​(int index)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
        Specified by:
        getAttributes in interface LogRecordOrBuilder
      • setAttributes

        public LogRecord.Builder setAttributes​(int index,
                                               KeyValue value)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • setAttributes

        public LogRecord.Builder setAttributes​(int index,
                                               KeyValue.Builder builderForValue)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • addAttributes

        public LogRecord.Builder addAttributes​(KeyValue value)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • addAttributes

        public LogRecord.Builder addAttributes​(int index,
                                               KeyValue value)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • addAttributes

        public LogRecord.Builder addAttributes​(KeyValue.Builder builderForValue)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • addAttributes

        public LogRecord.Builder addAttributes​(int index,
                                               KeyValue.Builder builderForValue)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • addAllAttributes

        public LogRecord.Builder addAllAttributes​(Iterable<? extends KeyValue> values)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • clearAttributes

        public LogRecord.Builder clearAttributes()
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • removeAttributes

        public LogRecord.Builder removeAttributes​(int index)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • getAttributesBuilder

        public KeyValue.Builder getAttributesBuilder​(int index)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • getAttributesOrBuilder

        public KeyValueOrBuilder getAttributesOrBuilder​(int index)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
        Specified by:
        getAttributesOrBuilder in interface LogRecordOrBuilder
      • addAttributesBuilder

        public KeyValue.Builder addAttributesBuilder()
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • addAttributesBuilder

        public KeyValue.Builder addAttributesBuilder​(int index)
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • getAttributesBuilderList

        public List<KeyValue.Builder> getAttributesBuilderList()
         Additional attributes that describe the specific event occurrence. [Optional].
         
        repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      • setDroppedAttributesCount

        public LogRecord.Builder setDroppedAttributesCount​(int value)
        uint32 dropped_attributes_count = 7;
      • clearDroppedAttributesCount

        public LogRecord.Builder clearDroppedAttributesCount()
        uint32 dropped_attributes_count = 7;
      • getFlags

        public int getFlags()
         Flags, a bit field. 8 least significant bits are the trace flags as
         defined in W3C Trace Context specification. 24 most significant bits are reserved
         and must be set to 0. Readers must not assume that 24 most significant bits
         will be zero and must correctly mask the bits when reading 8-bit trace flag (use
         flags & TRACE_FLAGS_MASK). [Optional].
         
        fixed32 flags = 8;
        Specified by:
        getFlags in interface LogRecordOrBuilder
      • setFlags

        public LogRecord.Builder setFlags​(int value)
         Flags, a bit field. 8 least significant bits are the trace flags as
         defined in W3C Trace Context specification. 24 most significant bits are reserved
         and must be set to 0. Readers must not assume that 24 most significant bits
         will be zero and must correctly mask the bits when reading 8-bit trace flag (use
         flags & TRACE_FLAGS_MASK). [Optional].
         
        fixed32 flags = 8;
      • clearFlags

        public LogRecord.Builder clearFlags()
         Flags, a bit field. 8 least significant bits are the trace flags as
         defined in W3C Trace Context specification. 24 most significant bits are reserved
         and must be set to 0. Readers must not assume that 24 most significant bits
         will be zero and must correctly mask the bits when reading 8-bit trace flag (use
         flags & TRACE_FLAGS_MASK). [Optional].
         
        fixed32 flags = 8;
      • getTraceId

        public com.google.protobuf.ByteString getTraceId()
         A unique identifier for a trace. All logs from the same trace share
         the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
         is considered invalid. Can be set for logs that are part of request processing
         and have an assigned trace id. [Optional].
         
        bytes trace_id = 9;
        Specified by:
        getTraceId in interface LogRecordOrBuilder
      • setTraceId

        public LogRecord.Builder setTraceId​(com.google.protobuf.ByteString value)
         A unique identifier for a trace. All logs from the same trace share
         the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
         is considered invalid. Can be set for logs that are part of request processing
         and have an assigned trace id. [Optional].
         
        bytes trace_id = 9;
      • clearTraceId

        public LogRecord.Builder clearTraceId()
         A unique identifier for a trace. All logs from the same trace share
         the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
         is considered invalid. Can be set for logs that are part of request processing
         and have an assigned trace id. [Optional].
         
        bytes trace_id = 9;
      • getSpanId

        public com.google.protobuf.ByteString getSpanId()
         A unique identifier for a span within a trace, assigned when the span
         is created. The ID is an 8-byte array. An ID with all zeroes is considered
         invalid. Can be set for logs that are part of a particular processing span.
         If span_id is present trace_id SHOULD be also present. [Optional].
         
        bytes span_id = 10;
        Specified by:
        getSpanId in interface LogRecordOrBuilder
      • setSpanId

        public LogRecord.Builder setSpanId​(com.google.protobuf.ByteString value)
         A unique identifier for a span within a trace, assigned when the span
         is created. The ID is an 8-byte array. An ID with all zeroes is considered
         invalid. Can be set for logs that are part of a particular processing span.
         If span_id is present trace_id SHOULD be also present. [Optional].
         
        bytes span_id = 10;
      • clearSpanId

        public LogRecord.Builder clearSpanId()
         A unique identifier for a span within a trace, assigned when the span
         is created. The ID is an 8-byte array. An ID with all zeroes is considered
         invalid. Can be set for logs that are part of a particular processing span.
         If span_id is present trace_id SHOULD be also present. [Optional].
         
        bytes span_id = 10;
      • setUnknownFields

        public final LogRecord.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>
      • mergeUnknownFields

        public final LogRecord.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<LogRecord.Builder>