feat(logging): add direct Kafka logging support via tracing-kafka crate #75
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces a generic
tracing-kafka
crate that enables centralized logging to Kafka for any service in the workspace.Key features:
Motivation and Context
Currently, we use Vector for log collection, which has limitations:
This change provides direct Kafka integration, giving us:
Additional Changes
This PR modifies the API contract
This PR modifies application configuration/environment variables
Configuration changes:
Added Kafka configuration section to
config/development.toml
[log.kafka]
section with brokers, topic, and enabled flagAdded optional
kafka
feature flag in:backend/grpc-server/Cargo.toml
- Addedtracing-kafka
as optional dependencyCargo.toml
- Addedtracing-kafka
to workspace membersModified logger setup in
backend/grpc-server/src/logger/setup.rs
Added new logger config types in
backend/grpc-server/src/logger/config.rs
KafkaConfig
struct for Kafka-specific settingsHow did you test it?
Start Kafka locally
Run with Kafka logging
Consume logs
docker exec kafka-test kafka-console-consumer \ --bootstrap-server localhost:9092 \ --topic connector-service-logs \ --from-beginning
Log from server

Log from local kafka topic