For the complete documentation index, see llms.txt. This page is also available as Markdown.

Record tracing

Add source lineage headers to replicated records.

This feature is disabled by default. Set the corresponding features toggle to enabled in your pipeline file for the behavior described on this page to take effect.

When a record lands on the target Kafka cluster, operators often need to know which source topic, partition, and offset it came from — especially during failover or migration debugging. Kafka does not attach lineage metadata by default, therefore we inject tracing headers at replication time.

Set features.tracingHeaders: enabled to write source topic, partition, and offset into record headers using the names under tracing.headers. Tracing headers are separate from metrics; for pipeline health, see Observability.

Prerequisites

Example

name: "my_pipeline"
features:
  tracingHeaders: enabled
source:
  kafka:
    common:
      "bootstrap.servers": "source:9092"
    consumer:
      "group.id": "my-k2k-group"
target:
  kafka:
    common:
      "bootstrap.servers": "target:9092"
tracing:
  headers:
    topic: "x-source-topic"
replication:
  - source:
      topic: "orders.*"
  - sink:
      topic: source
      partition: source

Configuration keys

Feature toggles

Key
Description
Required
Default
Used by

features.tracingHeaders

Inject tracing headers on replicated records (enabled, disabled, or per header object)

No

disabled

Replicator

features.tracingHeaders.partition

Inject source partition tracing header

No

disabled

Replicator

features.tracingHeaders.offset

Inject source offset tracing header

No

disabled

Replicator

features.tracingHeaders.topic

Inject source topic tracing header

No

disabled

Replicator

features.tracingHeaders.pipeline

Inject pipeline name tracing header

No

disabled

Replicator

Header names

Key
Description
Required
Default
Used by

tracing.headers.partition

Header name for source partition

No

__k2k_partition

Replicator

tracing.headers.offset

Header name for source offset

No

__k2k_offset

Replicator

tracing.headers.topic

Header name for source topic

No

__k2k_topic

Replicator

tracing.headers.pipeline

Header name for pipeline name

No

__k2k_pipeline

Replicator

Last updated

Was this helpful?