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
    • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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