public class Log extends SubscribersBatch<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 Details

    • Log

      public Log(Batch<Log> parent, io.opentelemetry.context.Context otelContext)
      Create a new empty log.
      Parameters:
      parent - parent Batch
      otelContext - Context for 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 timestamp
      batchID - the batch id
      sequenceNum - the sequence number of this log
      resourceLog - used to fill-in OpenTelemetry Resource details
      scopeLog - used to fill-in OpenTelemetry Scope details
      logRec - the log record details
    • getBatchTimestamp

      public long getBatchTimestamp()
      Get the timestamp when the containing OTLP packet was received.
      Returns:
      the timestamp, in ms
    • getBatchUUID

      public String 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

      public String 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

      public String 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

      public String getErrorMessage()
      Get the message associated with an error in the data.
      Returns:
      the error message or null if data is valid