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.
Use io.opentelemetry.sdk.extension.incubator.logs.EventToSpanEventBridge from the opentelemetry-sdk-extension-incubator artifact instead. Will be removed after the 1.59.0 release.
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 where Span.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.name attribute is mapped to span event name
  • LogRecordData.getTimestampEpochNanos() is mapped to span event timestamp
  • LogRecordData.getAttributes() are mapped to span event attributes, excluding event.name
  • LogRecordData.getObservedTimestampEpochNanos() is mapped to span event attribute with key log.record.observed_timestamp
  • LogRecordData.getSeverity() is mapped to span event attribute with key log.record.severity_number
  • LogRecordData.getBodyValue() is mapped to span event attribute with key log.record.body, as an escaped JSON string following the standard protobuf JSON encoding
  • LogRecordData.getTotalAttributeCount() - LogRecordData.getAttributes().size() is mapped to span event attribute with key log.record.dropped_attributes_count
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated.
    Create an instance.
    void
    onEmit(io.opentelemetry.context.Context context, io.opentelemetry.sdk.logs.ReadWriteLogRecord logRecord)
    Deprecated.
     
    Deprecated.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.opentelemetry.sdk.logs.LogRecordProcessor

    close, forceFlush, shutdown
  • Method Details

    • create

      public static EventToSpanEventBridge create()
      Deprecated.
      Create an instance.
    • onEmit

      public void onEmit(io.opentelemetry.context.Context context, io.opentelemetry.sdk.logs.ReadWriteLogRecord logRecord)
      Deprecated.
      Specified by:
      onEmit in interface io.opentelemetry.sdk.logs.LogRecordProcessor
    • toString

      public String toString()
      Deprecated.
      Overrides:
      toString in class Object