Package io.debezium.transforms.tracing
Class TracingSpanUtil
java.lang.Object
io.debezium.transforms.tracing.TracingSpanUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addFieldToSpan
(io.opentelemetry.api.trace.Span span, org.apache.kafka.connect.data.Struct struct, String field, String prefix) private static void
debeziumSpan
(org.apache.kafka.connect.data.Struct envelope, String operationName) static <R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
RtraceRecord
(R connectRecord, org.apache.kafka.connect.data.Struct envelope, org.apache.kafka.connect.data.Struct source, String propagatedSpanContext, String operationName) Create tracing spans representing the write operation in the database (the span timestamp is taken from the source event if available), as well as Debezium's processing operation (the span timestamp is taken from the envelope's timestamp).
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DB_FIELDS_PREFIX
- See Also:
-
TX_LOG_WRITE_OPERATION_NAME
- See Also:
-
TRACING_COMPONENT
-
openTelemetry
private static final io.opentelemetry.api.OpenTelemetry openTelemetry -
tracer
private static final io.opentelemetry.api.trace.Tracer tracer
-
-
Constructor Details
-
TracingSpanUtil
private TracingSpanUtil()
-
-
Method Details
-
traceRecord
public static <R extends org.apache.kafka.connect.connector.ConnectRecord<R>> R traceRecord(R connectRecord, org.apache.kafka.connect.data.Struct envelope, org.apache.kafka.connect.data.Struct source, String propagatedSpanContext, String operationName) Create tracing spans representing the write operation in the database (the span timestamp is taken from the source event if available), as well as Debezium's processing operation (the span timestamp is taken from the envelope's timestamp). If a trace context is provided for propagation, it is set as the parent context of the created spans to enable distributed tracing. The resulting context is injected in the Kafka Connect Record headers for further propagation.- Type Parameters:
R
- the subtype ofConnectRecord
on which this transformation will operate- Parameters:
connectRecord
- the Connect record that is to be enriched with tracing informationenvelope
- the envelope wrapped by the recordsource
- the source field of the envelope, ornull
propagatedSpanContext
- a String serialization of aProperties
instance representing the parent span context that should be used for trace propagation, ornull
operationName
- the operation name of the debezium processing span- Returns:
- the connect record with message headers augmented with tracing information
-
debeziumSpan
private static void debeziumSpan(org.apache.kafka.connect.data.Struct envelope, String operationName) -
addFieldToSpan
-