I am using OpenTelemetry collector to collect logs from Springboot (3) app.
Want to add Exporter: Kafka - to store the logs in Kafka for some future processing.
otel-collector-config.yaml
extensions:
health_check:
receivers:
otlp:
protocols:
http:
processors:
batch:
send_batch_size: 10000
timeout: 5s
exporters:
kafka:
brokers:
- localhost: 9092
protocol_version: 2.0.0
logging:
verbosity: detailed
service:
pipelines:
logs:
receivers: [otlp]
processors: [batch]
exporters: [logging,kafka]
extensions: [health_check]
I report logs from my app, as usual:
private static final Logger log = LoggerFactory.getLogger(My.class);
log.info("FOO id {} tag {} sn{} /*more tags */", id, tag,sn);
Is it possible to format the payload that will be stored in Kafka? Is it possible to set key for the Kafka message?