Class LogRecord

java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessage
io.opentelemetry.proto.logs.v1.LogRecord
All Implemented Interfaces:
com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, LogRecordOrBuilder, Serializable

@Generated public final class LogRecord extends com.google.protobuf.GeneratedMessage 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
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A log record according to OpenTelemetry Log Data Model: https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md

    Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage

    com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessage.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessage.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessage.FieldAccessorTable, com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message,T extends Object>, com.google.protobuf.GeneratedMessage.UnusedPrivateParameter

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessage

    com.google.protobuf.AbstractMessage.BuilderParent

    Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

    com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     
    static final int
     

    Fields inherited from class com.google.protobuf.GeneratedMessage

    alwaysUseFieldBuilders, loggedPre22TypeNames, unknownFields

    Fields inherited from class com.google.protobuf.AbstractMessage

    memoizedSize

    Fields inherited from class com.google.protobuf.AbstractMessageLite

    memoizedHashCode
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    getAttributes(int index)
    Additional attributes that describe the specific event occurrence.
    int
    Additional attributes that describe the specific event occurrence.
    Additional attributes that describe the specific event occurrence.
    Additional attributes that describe the specific event occurrence.
    Additional attributes that describe the specific event occurrence.
    A value containing the body of the log record.
    A value containing the body of the log record.
    static LogRecord
     
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    int
    uint32 dropped_attributes_count = 7;
    A unique identifier of event category/type.
    com.google.protobuf.ByteString
    A unique identifier of event category/type.
    int
    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.
    long
    Time when the event was observed by the collection system.
    com.google.protobuf.Parser<LogRecord>
     
    int
     
    Numerical value of the severity, normalized to values described in Log Data Model.
    int
    Numerical value of the severity, normalized to values described in Log Data Model.
    The severity text (also known as log level).
    com.google.protobuf.ByteString
    The severity text (also known as log level).
    com.google.protobuf.ByteString
    A unique identifier for a span within a trace, assigned when the span is created.
    long
    time_unix_nano is the time when the event occurred.
    com.google.protobuf.ByteString
    A unique identifier for a trace.
    boolean
    A value containing the body of the log record.
    int
     
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    newBuilder(LogRecord prototype)
     
     
    newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
     
    static LogRecord
     
    static LogRecord
    parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static LogRecord
    parseFrom(byte[] data)
     
    static LogRecord
    parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static LogRecord
    parseFrom(com.google.protobuf.ByteString data)
     
    static LogRecord
    parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static LogRecord
    parseFrom(com.google.protobuf.CodedInputStream input)
     
    static LogRecord
    parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static LogRecord
     
    static LogRecord
    parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static LogRecord
     
    static LogRecord
    parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    static com.google.protobuf.Parser<LogRecord>
     
     
    void
    writeTo(com.google.protobuf.CodedOutputStream output)
     

    Methods inherited from class com.google.protobuf.GeneratedMessage

    canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag

    Methods inherited from class com.google.protobuf.AbstractMessage

    findInitializationErrors, getInitializationErrorString, hashFields, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite

    addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.MessageLite

    toByteArray, toByteString, writeDelimitedTo, writeTo

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Field Details

    • TIME_UNIX_NANO_FIELD_NUMBER

      public static final int TIME_UNIX_NANO_FIELD_NUMBER
      See Also:
    • OBSERVED_TIME_UNIX_NANO_FIELD_NUMBER

      public static final int OBSERVED_TIME_UNIX_NANO_FIELD_NUMBER
      See Also:
    • SEVERITY_NUMBER_FIELD_NUMBER

      public static final int SEVERITY_NUMBER_FIELD_NUMBER
      See Also:
    • SEVERITY_TEXT_FIELD_NUMBER

      public static final int SEVERITY_TEXT_FIELD_NUMBER
      See Also:
    • BODY_FIELD_NUMBER

      public static final int BODY_FIELD_NUMBER
      See Also:
    • ATTRIBUTES_FIELD_NUMBER

      public static final int ATTRIBUTES_FIELD_NUMBER
      See Also:
    • DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER

      public static final int DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER
      See Also:
    • FLAGS_FIELD_NUMBER

      public static final int FLAGS_FIELD_NUMBER
      See Also:
    • TRACE_ID_FIELD_NUMBER

      public static final int TRACE_ID_FIELD_NUMBER
      See Also:
    • SPAN_ID_FIELD_NUMBER

      public static final int SPAN_ID_FIELD_NUMBER
      See Also:
    • EVENT_NAME_FIELD_NUMBER

      public static final int EVENT_NAME_FIELD_NUMBER
      See Also:
  • 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
    • 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
      Returns:
      The timeUnixNano.
    • getObservedTimeUnixNano

      public long getObservedTimeUnixNano()
       Time when the event was observed by the collection system.
       For events that originate in OpenTelemetry (e.g. using OpenTelemetry Logging SDK)
       this timestamp is typically set at the generation time and is equal to Timestamp.
       For events originating externally and collected by OpenTelemetry (e.g. using
       Collector) this is the time when OpenTelemetry's code observed the event measured
       by the clock of the OpenTelemetry code. This field MUST be set once the event is
       observed by OpenTelemetry.
      
       For converting OpenTelemetry log data to formats that support only one timestamp or
       when receiving OpenTelemetry log data by recipients that support only one timestamp
       internally the following logic is recommended:
       - Use time_unix_nano if it is present, otherwise use observed_time_unix_nano.
      
       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 observed_time_unix_nano = 11;
      Specified by:
      getObservedTimeUnixNano in interface LogRecordOrBuilder
      Returns:
      The observedTimeUnixNano.
    • 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
      Returns:
      The enum numeric value on the wire for severityNumber.
    • 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
      Returns:
      The severityNumber.
    • 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
      Returns:
      The severityText.
    • 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
      Returns:
      The bytes for severityText.
    • 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
      Returns:
      Whether the body field is set.
    • 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
      Returns:
      The body.
    • 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].
       Attribute keys MUST be unique (it is not allowed to have more than one
       attribute with the same key).
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      Specified by:
      getAttributesList in interface LogRecordOrBuilder
    • getAttributesOrBuilderList

      public List<? extends KeyValueOrBuilder> getAttributesOrBuilderList()
       Additional attributes that describe the specific event occurrence. [Optional].
       Attribute keys MUST be unique (it is not allowed to have more than one
       attribute with the same key).
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      Specified by:
      getAttributesOrBuilderList in interface LogRecordOrBuilder
    • getAttributesCount

      public int getAttributesCount()
       Additional attributes that describe the specific event occurrence. [Optional].
       Attribute keys MUST be unique (it is not allowed to have more than one
       attribute with the same key).
       
      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].
       Attribute keys MUST be unique (it is not allowed to have more than one
       attribute with the same key).
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      Specified by:
      getAttributes in interface LogRecordOrBuilder
    • getAttributesOrBuilder

      public KeyValueOrBuilder getAttributesOrBuilder(int index)
       Additional attributes that describe the specific event occurrence. [Optional].
       Attribute keys MUST be unique (it is not allowed to have more than one
       attribute with the same key).
       
      repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;
      Specified by:
      getAttributesOrBuilder in interface LogRecordOrBuilder
    • getDroppedAttributesCount

      public int getDroppedAttributesCount()
      uint32 dropped_attributes_count = 7;
      Specified by:
      getDroppedAttributesCount in interface LogRecordOrBuilder
      Returns:
      The droppedAttributesCount.
    • 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 & LOG_RECORD_FLAGS_TRACE_FLAGS_MASK). [Optional].
       
      fixed32 flags = 8;
      Specified by:
      getFlags in interface LogRecordOrBuilder
      Returns:
      The flags.
    • 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 OR
       of length other than 16 bytes is considered invalid (empty string in OTLP/JSON
       is zero-length and thus is also invalid).
      
       This field is optional.
      
       The receivers SHOULD assume that the log record is not associated with a
       trace if any of the following is true:
       - the field is not present,
       - the field contains an invalid value.
       
      bytes trace_id = 9;
      Specified by:
      getTraceId in interface LogRecordOrBuilder
      Returns:
      The traceId.
    • 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 OR of length
       other than 8 bytes is considered invalid (empty string in OTLP/JSON
       is zero-length and thus is also invalid).
      
       This field is optional. If the sender specifies a valid span_id then it SHOULD also
       specify a valid trace_id.
      
       The receivers SHOULD assume that the log record is not associated with a
       span if any of the following is true:
       - the field is not present,
       - the field contains an invalid value.
       
      bytes span_id = 10;
      Specified by:
      getSpanId in interface LogRecordOrBuilder
      Returns:
      The spanId.
    • getEventName

      public String getEventName()
       A unique identifier of event category/type.
       All events with the same event_name are expected to conform to the same
       schema for both their attributes and their body.
      
       Recommended to be fully qualified and short (no longer than 256 characters).
      
       Presence of event_name on the log record identifies this record
       as an event.
      
       [Optional].
       
      string event_name = 12;
      Specified by:
      getEventName in interface LogRecordOrBuilder
      Returns:
      The eventName.
    • getEventNameBytes

      public com.google.protobuf.ByteString getEventNameBytes()
       A unique identifier of event category/type.
       All events with the same event_name are expected to conform to the same
       schema for both their attributes and their body.
      
       Recommended to be fully qualified and short (no longer than 256 characters).
      
       Presence of event_name on the log record identifies this record
       as an event.
      
       [Optional].
       
      string event_name = 12;
      Specified by:
      getEventNameBytes in interface LogRecordOrBuilder
      Returns:
      The bytes for eventName.
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage
    • writeTo

      public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
      Specified by:
      writeTo in interface com.google.protobuf.MessageLite
      Overrides:
      writeTo in class com.google.protobuf.GeneratedMessage
      Throws:
      IOException
    • getSerializedSize

      public int getSerializedSize()
      Specified by:
      getSerializedSize in interface com.google.protobuf.MessageLite
      Overrides:
      getSerializedSize in class com.google.protobuf.GeneratedMessage
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface com.google.protobuf.Message
      Overrides:
      equals in class com.google.protobuf.AbstractMessage
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface com.google.protobuf.Message
      Overrides:
      hashCode in class com.google.protobuf.AbstractMessage
    • parseFrom

      public static LogRecord parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LogRecord parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LogRecord parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LogRecord parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LogRecord parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LogRecord parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
      Throws:
      com.google.protobuf.InvalidProtocolBufferException
    • parseFrom

      public static LogRecord parseFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LogRecord parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static LogRecord parseDelimitedFrom(InputStream input) throws IOException
      Throws:
      IOException
    • parseDelimitedFrom

      public static LogRecord parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LogRecord parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
      Throws:
      IOException
    • parseFrom

      public static LogRecord parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Throws:
      IOException
    • newBuilderForType

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

      public static LogRecord.Builder newBuilder()
    • newBuilder

      public static LogRecord.Builder newBuilder(LogRecord prototype)
    • toBuilder

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

      protected LogRecord.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent)
      Overrides:
      newBuilderForType in class com.google.protobuf.AbstractMessage
    • getDefaultInstance

      public static LogRecord getDefaultInstance()
    • parser

      public static com.google.protobuf.Parser<LogRecord> parser()
    • getParserForType

      public com.google.protobuf.Parser<LogRecord> getParserForType()
      Specified by:
      getParserForType in interface com.google.protobuf.Message
      Specified by:
      getParserForType in interface com.google.protobuf.MessageLite
      Overrides:
      getParserForType in class com.google.protobuf.GeneratedMessage
    • getDefaultInstanceForType

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