Class EventToSpanEventBridge
java.lang.Object
io.opentelemetry.contrib.eventbridge.EventToSpanEventBridge
- All Implemented Interfaces:
io.opentelemetry.sdk.logs.LogRecordProcessor,Closeable,AutoCloseable
@Deprecated
public final class EventToSpanEventBridge
extends Object
implements io.opentelemetry.sdk.logs.LogRecordProcessor
Deprecated.
A processor that records events (i.e. log records with an
event.name attribute) as span
events for the current span if:
- The log record has a valid span context
Span.current()returns a span whereSpan.isRecording()is true- The log record's span context is the same as
Span.current()
The event LogRecordData is converted to a span event as follows:
event.nameattribute is mapped to span event nameLogRecordData.getTimestampEpochNanos()is mapped to span event timestampLogRecordData.getAttributes()are mapped to span event attributes, excludingevent.nameLogRecordData.getObservedTimestampEpochNanos()is mapped to span event attribute with keylog.record.observed_timestampLogRecordData.getSeverity()is mapped to span event attribute with keylog.record.severity_numberLogRecordData.getBodyValue()is mapped to span event attribute with keylog.record.body, as an escaped JSON string following the standard protobuf JSON encodingLogRecordData.getTotalAttributeCount()-LogRecordData.getAttributes().size() is mapped to span event attribute with keylog.record.dropped_attributes_count
-
Method Summary
Modifier and TypeMethodDescriptionstatic EventToSpanEventBridgecreate()Deprecated.Create an instance.voidonEmit(io.opentelemetry.context.Context context, io.opentelemetry.sdk.logs.ReadWriteLogRecord logRecord) Deprecated.toString()Deprecated.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.opentelemetry.sdk.logs.LogRecordProcessor
close, forceFlush, shutdown
-
Method Details
-
create
Deprecated.Create an instance. -
onEmit
public void onEmit(io.opentelemetry.context.Context context, io.opentelemetry.sdk.logs.ReadWriteLogRecord logRecord) Deprecated.- Specified by:
onEmitin interfaceio.opentelemetry.sdk.logs.LogRecordProcessor
-
toString
Deprecated.
-
io.opentelemetry.sdk.extension.incubator.logs.EventToSpanEventBridgefrom theopentelemetry-sdk-extension-incubatorartifact instead. Will be removed after the 1.59.0 release.