Class SdkEventBuilder
java.lang.Object
io.opentelemetry.sdk.logs.internal.SdkEventBuilder
- All Implemented Interfaces:
EventBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Clockprivate static final AttributeKey<String> private final Stringprivate booleanprivate final LogRecordBuilder -
Constructor Summary
ConstructorsConstructorDescriptionSdkEventBuilder(Clock clock, LogRecordBuilder logRecordBuilder, String eventName) -
Method Summary
Modifier and TypeMethodDescriptionvoidemit()Emit an event.Put the givenkeyandvaluein the payload.setAttributes(Attributes attributes) Set the attributes.setContext(Context context) Set the context.setSeverity(Severity severity) Set the severity.setTimestamp(long timestamp, TimeUnit unit) Set the epochtimestamp, using the timestamp and unit.setTimestamp(Instant instant) Set the epochtimestamp, using the instant.
-
Field Details
-
EVENT_NAME
-
payload
-
clock
-
logRecordBuilder
-
eventName
-
hasTimestamp
private boolean hasTimestamp
-
-
Constructor Details
-
SdkEventBuilder
SdkEventBuilder(Clock clock, LogRecordBuilder logRecordBuilder, String eventName)
-
-
Method Details
-
put
Description copied from interface:EventBuilderPut the givenkeyandvaluein the payload.- Specified by:
putin interfaceEventBuilder
-
setTimestamp
Description copied from interface:EventBuilderSet the epochtimestamp, using the timestamp and unit.The
timestampis the time at which the event occurred. If unset, it will be set to the current time whenEventBuilder.emit()is called.- Specified by:
setTimestampin interfaceEventBuilder
-
setTimestamp
Description copied from interface:EventBuilderSet the epochtimestamp, using the instant.The
timestampis the time at which the event occurred. If unset, it will be set to the current time whenEventBuilder.emit()is called.- Specified by:
setTimestampin interfaceEventBuilder
-
setContext
Description copied from interface:EventBuilderSet the context.- Specified by:
setContextin interfaceEventBuilder
-
setSeverity
Description copied from interface:EventBuilderSet the severity.- Specified by:
setSeverityin interfaceEventBuilder
-
setAttributes
Description copied from interface:EventBuilderSet the attributes.Event
Attributesprovide additional details about the Event which are not part of the well-definedValuepayload. Setting event attributes is less common than adding entries to the event payload. Most users will want to call one of the#put(String, ?)methods instead.- Specified by:
setAttributesin interfaceEventBuilder
-
emit
public void emit()Description copied from interface:EventBuilderEmit an event.- Specified by:
emitin interfaceEventBuilder
-