Package io.debezium.transforms.tracing
Class ActivateTracingSpan<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
java.lang.Object
io.debezium.transforms.tracing.ActivateTracingSpan<R>
- Type Parameters:
R
- the subtype ofConnectRecord
on which this transformation will operate
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.kafka.common.Configurable
,org.apache.kafka.connect.transforms.Transformation<R>
public class ActivateTracingSpan<R extends org.apache.kafka.connect.connector.ConnectRecord<R>>
extends Object
implements org.apache.kafka.connect.transforms.Transformation<R>
This SMT enables integration with a tracing system.
The SMT creates a tracing span and enriches it with metadata from envelope and source info block.
It is possible to connect the span to a parent span created by a business application. The application then needs to export its tracing active span context into a database field. The SMT looks for a predefined field name in the
It is possible to connect the span to a parent span created by a business application. The application then needs to export its tracing active span context into a database field. The SMT looks for a predefined field name in the
after
block
and when found it extracts the parent span from it.- Author:
- Jiri Pechanec
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final String
private static final String
private static final String
private static final org.slf4j.Logger
private static final boolean
private String
private boolean
private SmtManager<R>
private String
private static final String
static final Field
static final Field
static final Field
private static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
addFieldToSpan
(io.opentracing.Tracer.SpanBuilder span, org.apache.kafka.connect.data.Struct struct, String field, String prefix) void
close()
org.apache.kafka.common.config.ConfigDef
config()
void
static boolean
private static boolean
void
setRequireContextField
(boolean requireContextField) private R
traceRecord
(R record, org.apache.kafka.connect.data.Struct envelope, org.apache.kafka.connect.data.Struct source, org.apache.kafka.connect.data.Struct after, String propagatedSpanContext)
-
Field Details
-
DB_FIELDS_PREFIX
- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
DEFAULT_TRACING_SPAN_CONTEXT_FIELD
- See Also:
-
DEFAULT_TRACING_OPERATION_NAME
- See Also:
-
TRACING_COMPONENT
- See Also:
-
TX_LOG_WRITE_OPERATION_NAME
- See Also:
-
OPEN_TRACING_AVAILABLE
private static final boolean OPEN_TRACING_AVAILABLE -
TRACING_SPAN_CONTEXT_FIELD
-
TRACING_OPERATION_NAME
-
TRACING_CONTEXT_FIELD_REQUIRED
-
spanContextField
-
operationName
-
requireContextField
private boolean requireContextField -
smtManager
-
-
Constructor Details
-
ActivateTracingSpan
public ActivateTracingSpan()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceorg.apache.kafka.common.Configurable
-
setRequireContextField
public void setRequireContextField(boolean requireContextField) -
apply
-
traceRecord
-
close
public void close() -
config
public org.apache.kafka.common.config.ConfigDef config() -
addFieldToSpan
-
isOpenTracingAvailable
public static boolean isOpenTracingAvailable() -
resolveOpenTracingApiAvailable
private static boolean resolveOpenTracingApiAvailable()
-