Class Log
java.lang.Object
io.mishmash.opentelemetry.server.collector.Batch<Flow.Subscriber<? super T>>
io.mishmash.opentelemetry.server.collector.SubscribersBatch<Log>
io.mishmash.opentelemetry.server.collector.Log
Holds the details of an individual OTLP log record
received from a client as a
Batch of all subscribers
that are expected to process it.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the timestamp when the containing OTLP packet was received.Get the unique id of the containing OTLP packet.Get the message associated with an error in the data.io.opentelemetry.proto.logs.v1.LogRecordgetLog()Get the OpenTelemetry Log record.Get the schema URL of the OpenTelemetry Log.io.opentelemetry.proto.resource.v1.ResourceGet the OpenTelemetry Resource of this log.Get the schema URL of the OpenTelemetry Resouce of this log.io.opentelemetry.proto.common.v1.InstrumentationScopegetScope()Get the OpenTelemetry Scope of this log.intgetSeqNo()Get the sequence number of this log within the containing OTLP packet.booleanisValid()Check if this record is valid.voidsetFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.logs.v1.ResourceLogs resourceLog, io.opentelemetry.proto.logs.v1.ScopeLogs scopeLog, io.opentelemetry.proto.logs.v1.LogRecord logRec) Set the details of this log.Methods inherited from class io.mishmash.opentelemetry.server.collector.SubscribersBatch
otelCompleteMethods inherited from class io.mishmash.opentelemetry.server.collector.Batch
add, addAll, cancel, complete, completeExceptionally, currentOtelScope, future, getOtelContext, getProcessedElements, isCancelled, isLoaded, setLoaded, setLoadFailed
-
Constructor Details
-
Log
Create a new empty log.- Parameters:
parent- parentBatchotelContext-Contextfor own telemetry
-
-
Method Details
-
setFrom
public void setFrom(long batchTS, String batchID, int sequenceNum, io.opentelemetry.proto.logs.v1.ResourceLogs resourceLog, io.opentelemetry.proto.logs.v1.ScopeLogs scopeLog, io.opentelemetry.proto.logs.v1.LogRecord logRec) Set the details of this log. Also sets the validity of this record and potentially an error message.- Parameters:
batchTS- the batch timestampbatchID- the batch idsequenceNum- the sequence number of this logresourceLog- used to fill-in OpenTelemetry Resource detailsscopeLog- used to fill-in OpenTelemetry Scope detailslogRec- the log record details
-
getBatchTimestamp
public long getBatchTimestamp()Get the timestamp when the containing OTLP packet was received.- Returns:
- the timestamp, in ms
-
getBatchUUID
Get the unique id of the containing OTLP packet.- Returns:
- the UUID
-
getSeqNo
public int getSeqNo()Get the sequence number of this log within the containing OTLP packet.- Returns:
- the sequence number, zero-based
-
getResource
public io.opentelemetry.proto.resource.v1.Resource getResource()Get the OpenTelemetry Resource of this log.- Returns:
- the resource details
-
getResourceSchemaUrl
Get the schema URL of the OpenTelemetry Resouce of this log.- Returns:
- the schema URL
-
getScope
public io.opentelemetry.proto.common.v1.InstrumentationScope getScope()Get the OpenTelemetry Scope of this log.- Returns:
- the scope details
-
getLog
public io.opentelemetry.proto.logs.v1.LogRecord getLog()Get the OpenTelemetry Log record.- Returns:
- the log record details
-
getLogSchemaUrl
Get the schema URL of the OpenTelemetry Log.- Returns:
- the schema URL
-
isValid
public boolean isValid()Check if this record is valid.- Returns:
- true if data is valid
-
getErrorMessage
Get the message associated with an error in the data.- Returns:
- the error message or null if data is valid
-