You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kafkaexporter: use configkafka, extract producer (#38665)
#### Description
Use configkafka and extract a function for constructing a
sarama.SyncProducer given configkafka.ClientConfig and
configkafka.ProducerConfig.
As part of the change, `client_id` has been updated to default to
"otel-collector" instead of "sarama" by default. This is a breaking
change for anyone relying on client ID for monitoring or quota
management.
#### Link to tracking issue
Part of #38411
#### Testing
Updated unit tests.
Manually tested against Redpanda:
`$ docker run --publish=9093:9093 --health-cmd "rpk cluster health |
grep 'Healthy:.*true'"
docker.redpanda.com/redpandadata/redpanda:v23.1.11 redpanda start
--kafka-addr=internal://0.0.0.0:9092,external://0.0.0.0:9093 --smp=1
--memory=1G --mode=dev-container`
Ran the collector with `kafkametrics -> kafkaexporter -> Redpanda ->
kafkareceiver -> debugexporter`:
```yaml
receivers:
kafka:
brokers: [localhost:9093]
kafkametrics:
brokers: [localhost:9093]
collection_interval: 10s
scrapers: [topics, consumers]
exporters:
debug:
verbosity: detailed
kafka:
brokers: [localhost:9093]
service:
pipelines:
metrics/kafka:
receivers: [kafka]
exporters: [debug]
metrics:
receivers: [kafkametrics]
exporters: [kafka]
```
#### Documentation
Updated README.
-`resolve_canonical_bootstrap_servers_only` (default = false): Whether to resolve then reverse-lookup broker IPs during startup.
26
-
-`client_id` (default = "sarama"): The client ID to configure the Sarama Kafka client with. The client ID will be used for all produce requests.
26
+
-`client_id` (default = "otel-collector"): The client ID to configure the Kafka client with. The client ID will be used for all produce requests.
27
27
-`topic` (default = otlp_spans for traces, otlp_metrics for metrics, otlp_logs for logs): The name of the default kafka topic to export to. See [Destination Topic](#destination-topic) below for more details.
28
28
-`topic_from_attribute` (default = ""): Specify the resource attribute whose value should be used as the message's topic. See [Destination Topic](#destination-topic) below for more details.
29
29
-`encoding` (default = otlp_proto): The encoding of the traces sent to kafka. All available encodings:
@@ -92,8 +92,8 @@ The following settings can be optionally configured:
92
92
-`requests_per_second` is the average number of requests per seconds.
93
93
-`producer`
94
94
-`max_message_bytes` (default = 1000000) the maximum permitted size of a message in bytes
95
-
-`required_acks` (default = 1) controls when a message is regarded as transmitted. https://pkg.go.dev/github.com/IBM/[email protected]#RequiredAcks
96
-
-`compression` (default = 'none') the compression used when producing messages to kafka. The options are: `none`, `gzip`, `snappy`, `lz4`, and `zstd`https://pkg.go.dev/github.com/IBM/[email protected]#CompressionCodec
95
+
-`required_acks` (default = 1) controls when a message is regarded as transmitted. https://docs.confluent.io/platform/current/installation/configuration/producer-configs.html#acks
96
+
-`compression` (default = 'none') the compression used when producing messages to kafka. The options are: `none`, `gzip`, `snappy`, `lz4`, and `zstd`https://docs.confluent.io/platform/current/installation/configuration/producer-configs.html#compression-type
97
97
-`flush_max_messages` (default = 0) The maximum number of messages the producer will send in a single broker request.
returnsarama.CompressionNone, fmt.Errorf("producer.compression should be one of 'none', 'gzip', 'snappy', 'lz4', or 'zstd'. configured value %v", compression)
0 commit comments