Package io.opentelemetry.proto.logs.v1
Class LogRecord
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- 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
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 typeopentelemetry.proto.logs.v1.LogRecord- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLogRecord.BuilderA 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
-
-
Field Summary
Fields Modifier and Type Field Description static intATTRIBUTES_FIELD_NUMBERstatic intBODY_FIELD_NUMBERstatic intDROPPED_ATTRIBUTES_COUNT_FIELD_NUMBERstatic intFLAGS_FIELD_NUMBERstatic intOBSERVED_TIME_UNIX_NANO_FIELD_NUMBERstatic intSEVERITY_NUMBER_FIELD_NUMBERstatic intSEVERITY_TEXT_FIELD_NUMBERstatic intSPAN_ID_FIELD_NUMBERstatic intTIME_UNIX_NANO_FIELD_NUMBERstatic intTRACE_ID_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)KeyValuegetAttributes(int index)Additional attributes that describe the specific event occurrence.intgetAttributesCount()Additional attributes that describe the specific event occurrence.List<KeyValue>getAttributesList()Additional attributes that describe the specific event occurrence.KeyValueOrBuildergetAttributesOrBuilder(int index)Additional attributes that describe the specific event occurrence.List<? extends KeyValueOrBuilder>getAttributesOrBuilderList()Additional attributes that describe the specific event occurrence.AnyValuegetBody()A value containing the body of the log record.AnyValueOrBuildergetBodyOrBuilder()A value containing the body of the log record.static LogRecordgetDefaultInstance()LogRecordgetDefaultInstanceForType()static com.google.protobuf.Descriptors.DescriptorgetDescriptor()intgetDroppedAttributesCount()uint32 dropped_attributes_count = 7;intgetFlags()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.longgetObservedTimeUnixNano()Time when the event was observed by the collection system.com.google.protobuf.Parser<LogRecord>getParserForType()intgetSerializedSize()SeverityNumbergetSeverityNumber()Numerical value of the severity, normalized to values described in Log Data Model.intgetSeverityNumberValue()Numerical value of the severity, normalized to values described in Log Data Model.StringgetSeverityText()The severity text (also known as log level).com.google.protobuf.ByteStringgetSeverityTextBytes()The severity text (also known as log level).com.google.protobuf.ByteStringgetSpanId()A unique identifier for a span within a trace, assigned when the span is created.longgetTimeUnixNano()time_unix_nano is the time when the event occurred.com.google.protobuf.ByteStringgetTraceId()A unique identifier for a trace.com.google.protobuf.UnknownFieldSetgetUnknownFields()booleanhasBody()A value containing the body of the log record.inthashCode()protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTableinternalGetFieldAccessorTable()booleanisInitialized()static LogRecord.BuildernewBuilder()static LogRecord.BuildernewBuilder(LogRecord prototype)LogRecord.BuildernewBuilderForType()protected LogRecord.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)static LogRecordparseDelimitedFrom(InputStream input)static LogRecordparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LogRecordparseFrom(byte[] data)static LogRecordparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LogRecordparseFrom(com.google.protobuf.ByteString data)static LogRecordparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LogRecordparseFrom(com.google.protobuf.CodedInputStream input)static LogRecordparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LogRecordparseFrom(InputStream input)static LogRecordparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static LogRecordparseFrom(ByteBuffer data)static LogRecordparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)static com.google.protobuf.Parser<LogRecord>parser()LogRecord.BuildertoBuilder()voidwriteTo(com.google.protobuf.CodedOutputStream output)-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, 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, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
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
-
BODY_FIELD_NUMBER
public static final int BODY_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
-
FLAGS_FIELD_NUMBER
public static final int FLAGS_FIELD_NUMBER
- See Also:
- Constant Field Values
-
TRACE_ID_FIELD_NUMBER
public static final int TRACE_ID_FIELD_NUMBER
- See Also:
- Constant Field Values
-
SPAN_ID_FIELD_NUMBER
public static final int SPAN_ID_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getUnknownFields
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
- Specified by:
getUnknownFieldsin interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getUnknownFieldsin classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTablein classcom.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:
getTimeUnixNanoin interfaceLogRecordOrBuilder- 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:
getObservedTimeUnixNanoin interfaceLogRecordOrBuilder- 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:
getSeverityNumberValuein interfaceLogRecordOrBuilder- 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:
getSeverityNumberin interfaceLogRecordOrBuilder- 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:
getSeverityTextin interfaceLogRecordOrBuilder- 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:
getSeverityTextBytesin interfaceLogRecordOrBuilder- 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:
hasBodyin interfaceLogRecordOrBuilder- 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:
getBodyin interfaceLogRecordOrBuilder- 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:
getBodyOrBuilderin interfaceLogRecordOrBuilder
-
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:
getAttributesListin interfaceLogRecordOrBuilder
-
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:
getAttributesOrBuilderListin interfaceLogRecordOrBuilder
-
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:
getAttributesCountin interfaceLogRecordOrBuilder
-
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:
getAttributesin interfaceLogRecordOrBuilder
-
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:
getAttributesOrBuilderin interfaceLogRecordOrBuilder
-
getDroppedAttributesCount
public int getDroppedAttributesCount()
uint32 dropped_attributes_count = 7;- Specified by:
getDroppedAttributesCountin interfaceLogRecordOrBuilder- 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:
getFlagsin interfaceLogRecordOrBuilder- 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:
getTraceIdin interfaceLogRecordOrBuilder- 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:
getSpanIdin interfaceLogRecordOrBuilder- Returns:
- The spanId.
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.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:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
public static LogRecord.Builder newBuilder()
-
newBuilder
public static LogRecord.Builder newBuilder(LogRecord prototype)
-
toBuilder
public LogRecord.Builder toBuilder()
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected LogRecord.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForTypein classcom.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:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public LogRecord getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
-