feat(inputs.kafka_consumer): Add resolve canonical bootstrap server option (#15368)
This commit is contained in:
parent
31a1d34d99
commit
82902ebd06
|
|
@ -149,6 +149,11 @@ to use them.
|
|||
## limit.
|
||||
# metadata_retry_max_duration = 0
|
||||
|
||||
## When set to true, this turns each bootstrap broker address into a set of
|
||||
## IPs, then does a reverse lookup on each one to get its canonical hostname.
|
||||
## This list of hostnames then replaces the original address list.
|
||||
## resolve_canonical_bootstrap_servers_only = false
|
||||
|
||||
## Strategy for making connection to kafka brokers. Valid options: "startup",
|
||||
## "defer". If set to "defer" the plugin is allowed to start before making a
|
||||
## connection. This is useful if the broker may be down when telegraf is
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ type KafkaConsumer struct {
|
|||
MsgHeaderAsMetricName string `toml:"msg_header_as_metric_name"`
|
||||
ConsumerFetchDefault config.Size `toml:"consumer_fetch_default"`
|
||||
ConnectionStrategy string `toml:"connection_strategy"`
|
||||
ResolveCanonicalBootstrapServersOnly bool `toml:"resolve_canonical_bootstrap_servers_only"`
|
||||
|
||||
kafka.ReadConfig
|
||||
|
||||
kafka.Logger
|
||||
|
||||
Log telegraf.Logger `toml:"-"`
|
||||
|
|
@ -150,6 +150,8 @@ func (k *KafkaConsumer) Init() error {
|
|||
k.ConsumerCreator = &SaramaCreator{}
|
||||
}
|
||||
|
||||
cfg.Net.ResolveCanonicalBootstrapServers = k.ResolveCanonicalBootstrapServersOnly
|
||||
|
||||
cfg.Consumer.MaxProcessingTime = time.Duration(k.MaxProcessingTime)
|
||||
|
||||
if k.ConsumerFetchDefault != 0 {
|
||||
|
|
|
|||
|
|
@ -112,6 +112,11 @@
|
|||
## limit.
|
||||
# metadata_retry_max_duration = 0
|
||||
|
||||
## When set to true, this turns each bootstrap broker address into a set of
|
||||
## IPs, then does a reverse lookup on each one to get its canonical hostname.
|
||||
## This list of hostnames then replaces the original address list.
|
||||
## resolve_canonical_bootstrap_servers_only = false
|
||||
|
||||
## Strategy for making connection to kafka brokers. Valid options: "startup",
|
||||
## "defer". If set to "defer" the plugin is allowed to start before making a
|
||||
## connection. This is useful if the broker may be down when telegraf is
|
||||
|
|
|
|||
Loading…
Reference in New Issue