Class TestLogRecordData.Builder
java.lang.Object
io.opentelemetry.sdk.testing.logs.TestLogRecordData.Builder
- Enclosing class:
- TestLogRecordData
A
Builder class for TestLogRecordData.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Create a newLogRecordDatainstance from the data in this.abstract TestLogRecordData.BuildersetAttributes(io.opentelemetry.api.common.Attributes attributes) Set the attributes.setBody(io.opentelemetry.sdk.logs.data.Body body) Deprecated.Set the body string.abstract TestLogRecordData.BuildersetBodyValue(io.opentelemetry.api.common.Value<?> body) Set the body.abstract TestLogRecordData.BuildersetInstrumentationScopeInfo(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo) Sets theInstrumentationScopeInfo.setObservedTimestamp(long timestamp, TimeUnit unit) Set the epochobservedTimestamp, using the timestamp and unit.setObservedTimestamp(Instant instant) Set theobservedTimestamp, using the instant.abstract TestLogRecordData.BuildersetResource(io.opentelemetry.sdk.resources.Resource resource) Set theResource.abstract TestLogRecordData.BuildersetSeverity(io.opentelemetry.api.logs.Severity severity) Set the severity.abstract TestLogRecordData.BuildersetSeverityText(String severityText) Set the severity text.abstract TestLogRecordData.BuildersetSpanContext(io.opentelemetry.api.trace.SpanContext spanContext) Set the span context.setTimestamp(long timestamp, TimeUnit unit) Set the epochtimestamp, using the timestamp and unit.setTimestamp(Instant instant) Set the epochtimestamp, using the instant.abstract TestLogRecordData.BuildersetTotalAttributeCount(int totalAttributeCount) Set the total attribute count.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
build
Create a newLogRecordDatainstance from the data in this. -
setResource
public abstract TestLogRecordData.Builder setResource(io.opentelemetry.sdk.resources.Resource resource) Set theResource. -
setInstrumentationScopeInfo
public abstract TestLogRecordData.Builder setInstrumentationScopeInfo(io.opentelemetry.sdk.common.InstrumentationScopeInfo instrumentationScopeInfo) Sets theInstrumentationScopeInfo. -
setTimestamp
Set the epochtimestamp, using the instant.The
timestampis the time at which the log record occurred. -
setTimestamp
Set the epochtimestamp, using the timestamp and unit.The
timestampis the time at which the log record occurred. -
setObservedTimestamp
Set theobservedTimestamp, using the instant.The
observedTimestampis the time at which the log record was observed. -
setObservedTimestamp
Set the epochobservedTimestamp, using the timestamp and unit.The
observedTimestampis 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
Set the severity. -
setSeverityText
Set the severity text. -
setBody
Set the body string. -
setBody
Deprecated.UsesetBodyValue(Value).Set the body. -
setBodyValue
public abstract TestLogRecordData.Builder setBodyValue(@Nullable io.opentelemetry.api.common.Value<?> body) Set the body.- Since:
- 1.42.0
-
setAttributes
public abstract TestLogRecordData.Builder setAttributes(io.opentelemetry.api.common.Attributes attributes) Set the attributes. -
setTotalAttributeCount
Set the total attribute count.
-
setBodyValue(Value).