The following configuration example shows how you configure a Collector instance to export OTLP data to Kafka.
kafkaexporter component.BROKER_ADDRESS.
For more information, see the Kafka Apache quickstart guide.Here is an example YAML file for a basic Collector configuration that can be used to export OpenTelemetry traces, metrics, and logs to Kafka.
processors:memory_limiter:check_interval: 1slimit_percentage: 100batch:send_batch_size: 500timeout: 30sreceivers:otlp:protocols:grpc:endpoint: 0.0.0.0:4317exporters:kafka:brokers: ["${env:BROKER_ADDRESS}"]tls:insecure: true # Only necessary if your Kafka server does not provide a certificate that's trusted by the Collector.traces:metrics:logs:service:pipelines:traces:receivers: [otlp]processors: [memory_limiter, batch]exporters: [kafka]metrics:receivers: [otlp]processors: [memory_limiter, batch]exporters: [kafka]logs:receivers: [otlp]processors: [memory_limiter, batch]exporters: [kafka]
For this configuration to work, you need to set the BROKER_ADDRESS environment variable.
The value is specific to your Kafka server.
Validate your settings to avoid any configuration issues.
For our configuration, we configure certain components as described in the sections below.
Under receivers, we specify otlp as the active receiver component for our deployment.
This is required to accept OTLP data.
Under processors, we specify:
Under exporters, we specify the kafka exporter to forward data to the Kafka server.
Under service, we assemble our receiver, processors, and exporter objects into service pipelines, which will perform these steps:
memory_limit processor to make sure that the Collector doesn't run out of memory.batch processor.