Class LogRecord

  • All Implemented Interfaces:
    com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, LogRecordOrBuilder, Serializable

    public final class LogRecord
    extends com.google.protobuf.GeneratedMessageV3
    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:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LogRecord.Builder
      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.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,​BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,​BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

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

      • TIME_UNIX_NANO_FIELD_NUMBER

        public static final int TIME_UNIX_NANO_FIELD_NUMBER
        See Also:
        Constant Field Values
      • OBSERVED_TIME_UNIX_NANO_FIELD_NUMBER

        public static final int OBSERVED_TIME_UNIX_NANO_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SEVERITY_NUMBER_FIELD_NUMBER

        public static final int SEVERITY_NUMBER_FIELD_NUMBER
        See Also:
        Constant Field Values
      • SEVERITY_TEXT_FIELD_NUMBER

        public static final int SEVERITY_TEXT_FIELD_NUMBER
        See Also:
        Constant Field Values
      • ATTRIBUTES_FIELD_NUMBER

        public static final int ATTRIBUTES_FIELD_NUMBER
        See Also:
        Constant Field Values
      • DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER

        public static final int DROPPED_ATTRIBUTES_COUNT_FIELD_NUMBER
        See Also:
        Constant Field Values
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getUnknownFields

        public final com.google.protobuf.UnknownFieldSet getUnknownFields()
        Specified by:
        getUnknownFields in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getUnknownFields in class com.google.protobuf.GeneratedMessageV3
      • 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
      • 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 & 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
         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
        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 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
        Returns:
        The spanId.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • 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.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • 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​(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
      • 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.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • 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.GeneratedMessageV3
      • getDefaultInstanceForType

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