inlet/kafka: use a 4-byte random value for key

Using the exporter IP address is not helpful at all as we may not have
many of them and it would make big exporters difficult to scale if one
thread is not enough to ingest on the ClickHouse side.

Fix #75
This commit is contained in:
Vincent Bernat
2022-08-09 15:20:52 +02:00
parent 67703cc61e
commit e5e63be586
4 changed files with 8 additions and 6 deletions

View File

@@ -26,9 +26,9 @@ func TestKafka(t *testing.T) {
defer close(received)
expected := sarama.ProducerMessage{
Topic: "flows-v2",
Key: sarama.StringEncoder("127.0.0.1"),
Key: got.Key,
Value: sarama.ByteEncoder("hello world!"),
Partition: 30,
Partition: got.Partition,
}
if diff := helpers.Diff(got, expected); diff != "" {
t.Fatalf("Send() (-got, +want):\n%s", diff)