Class TestLogRecordData.Builder

java.lang.Object
io.opentelemetry.sdk.testing.logs.TestLogRecordData.Builder
Enclosing class:
TestLogRecordData

public abstract static class TestLogRecordData.Builder extends Object
A Builder class for TestLogRecordData.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • build

      public TestLogRecordData build()
      Create a new LogRecordData instance from the data in this.
    • setResource

      public abstract TestLogRecordData.Builder setResource(io.opentelemetry.sdk.resources.Resource resource)
      Set the Resource.
    • setInstrumentationScopeInfo

      public abstract TestLogRecordData.Builder setInstrumentationScopeInfo(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo)
      Sets the InstrumentationScopeInfo.
    • setTimestamp

      public TestLogRecordData.Builder setTimestamp(Instant instant)
      Set the epoch timestamp, using the instant.

      The timestamp is the time at which the log record occurred.

    • setTimestamp

      public TestLogRecordData.Builder setTimestamp(long timestamp, TimeUnit unit)
      Set the epoch timestamp, using the timestamp and unit.

      The timestamp is the time at which the log record occurred.

    • setObservedTimestamp

      public TestLogRecordData.Builder setObservedTimestamp(Instant instant)
      Set the observedTimestamp, using the instant.

      The observedTimestamp is the time at which the log record was observed.

    • setObservedTimestamp

      public TestLogRecordData.Builder setObservedTimestamp(long timestamp, TimeUnit unit)
      Set the epoch observedTimestamp, using the timestamp and unit.

      The observedTimestamp is the time at which the log record was observed.

    • setSpanContext

      public abstract TestLogRecordData.Builder setSpanContext(io.opentelemetry.api.trace.SpanContext spanContext)
      Set the span context.
    • setSeverity

      public abstract TestLogRecordData.Builder setSeverity(io.opentelemetry.api.logs.Severity severity)
      Set the severity.
    • setSeverityText

      public abstract TestLogRecordData.Builder setSeverityText(String severityText)
      Set the severity text.
    • setBody

      public TestLogRecordData.Builder setBody(String body)
      Set the body string.
    • setAttributes

      public abstract TestLogRecordData.Builder setAttributes(io.opentelemetry.api.common.Attributes attributes)
      Set the attributes.
    • setTotalAttributeCount

      public abstract TestLogRecordData.Builder setTotalAttributeCount(int totalAttributeCount)
      Set the total attribute count.