Package io.opentelemetry.proto.logs.v1
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
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.mdProtobuf type
opentelemetry.proto.logs.v1.LogRecord- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA log record according to OpenTelemetry Log Data Model: https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.mdNested 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.BuilderParentNested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessage
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleangetAttributes(int index) Additional attributes that describe the specific event occurrence.intAdditional attributes that describe the specific event occurrence.Additional attributes that describe the specific event occurrence.getAttributesOrBuilder(int index) Additional attributes that describe the specific event occurrence.List<? extends KeyValueOrBuilder>Additional attributes that describe the specific event occurrence.getBody()A value containing the body of the log record.A value containing the body of the log record.static LogRecordstatic final com.google.protobuf.Descriptors.Descriptorintuint32 dropped_attributes_count = 7;A unique identifier of event category/type.com.google.protobuf.ByteStringA unique identifier of event category/type.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.longTime when the event was observed by the collection system.com.google.protobuf.Parser<LogRecord>intNumerical value of the severity, normalized to values described in Log Data Model.intNumerical value of the severity, normalized to values described in Log Data Model.The severity text (also known as log level).com.google.protobuf.ByteStringThe severity text (also known as log level).com.google.protobuf.ByteStringA unique identifier for a span within a trace, assigned when the span is created.longtime_unix_nano is the time when the event occurred.com.google.protobuf.ByteStringA unique identifier for a trace.booleanhasBody()A value containing the body of the log record.inthashCode()protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanstatic LogRecord.Builderstatic LogRecord.BuildernewBuilder(LogRecord prototype) protected LogRecord.BuildernewBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) 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()voidwriteTo(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, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashFields, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods 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:
internalGetFieldAccessorTablein classcom.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:
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
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
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
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
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
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
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
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
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 & LOG_RECORD_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 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:
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 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:
getSpanIdin interfaceLogRecordOrBuilder- Returns:
- The spanId.
-
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]. Status: [Development]
string event_name = 12;- Specified by:
getEventNamein interfaceLogRecordOrBuilder- 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]. Status: [Development]
string event_name = 12;- Specified by:
getEventNameBytesin interfaceLogRecordOrBuilder- Returns:
- The bytes for eventName.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessage- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessage
-
equals
- 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
- Throws:
IOException
-
parseFrom
public static LogRecord parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static LogRecord parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static LogRecord parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected LogRecord.Builder newBuilderForType(com.google.protobuf.AbstractMessage.BuilderParent parent) - Overrides:
newBuilderForTypein classcom.google.protobuf.AbstractMessage
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessage
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-