Class SdkEventBuilder
java.lang.Object
io.opentelemetry.sdk.logs.internal.SdkEventBuilder
- All Implemented Interfaces:
EventBuilder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Clock
private static final AttributeKey
<String> private final String
private boolean
private final LogRecordBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionSdkEventBuilder
(Clock clock, LogRecordBuilder logRecordBuilder, String eventName) -
Method Summary
Modifier and TypeMethodDescriptionvoid
emit()
Emit an event.Put the givenkey
andvalue
in 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:EventBuilder
Put the givenkey
andvalue
in the payload.- Specified by:
put
in interfaceEventBuilder
-
setTimestamp
Description copied from interface:EventBuilder
Set the epochtimestamp
, using the timestamp and unit.The
timestamp
is the time at which the event occurred. If unset, it will be set to the current time whenEventBuilder.emit()
is called.- Specified by:
setTimestamp
in interfaceEventBuilder
-
setTimestamp
Description copied from interface:EventBuilder
Set the epochtimestamp
, using the instant.The
timestamp
is the time at which the event occurred. If unset, it will be set to the current time whenEventBuilder.emit()
is called.- Specified by:
setTimestamp
in interfaceEventBuilder
-
setContext
Description copied from interface:EventBuilder
Set the context.- Specified by:
setContext
in interfaceEventBuilder
-
setSeverity
Description copied from interface:EventBuilder
Set the severity.- Specified by:
setSeverity
in interfaceEventBuilder
-
setAttributes
Description copied from interface:EventBuilder
Set the attributes.Event
Attributes
provide additional details about the Event which are not part of the well-definedValue
payload. 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:
setAttributes
in interfaceEventBuilder
-
emit
public void emit()Description copied from interface:EventBuilder
Emit an event.- Specified by:
emit
in interfaceEventBuilder
-