kafka

package
v1.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License: MIT Imports: 17 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SHA256 scram.HashGeneratorFcn = func() hash.Hash { return sha256.New() }
View Source
var SHA512 scram.HashGeneratorFcn = func() hash.Hash { return sha512.New() }

Functions

func SASLVersion

func SASLVersion(kafkaVersion sarama.KafkaVersion, saslVersion *int) (int16, error)

func SetLogger added in v1.32.0

func SetLogger(level telegraf.LogLevel)

SetLogger configures a debug logger for kafka (sarama)

Types

type BackoffFunc added in v1.25.0

type BackoffFunc func(retries, maxRetries int) time.Duration

type Config added in v1.17.0

type Config struct {
	SASLAuth
	tls.ClientConfig

	Version          string           `toml:"version"`
	ClientID         string           `toml:"client_id"`
	CompressionCodec int              `toml:"compression_codec"`
	EnableTLS        *bool            `toml:"enable_tls"`
	KeepAlivePeriod  *config.Duration `toml:"keep_alive_period"`

	MetadataRetryMax         int             `toml:"metadata_retry_max"`
	MetadataRetryType        string          `toml:"metadata_retry_type"`
	MetadataRetryBackoff     config.Duration `toml:"metadata_retry_backoff"`
	MetadataRetryMaxDuration config.Duration `toml:"metadata_retry_max_duration"`

	// Disable full metadata fetching
	MetadataFull *bool `toml:"metadata_full"`
}

Config common to all Kafka clients.

func (*Config) SetConfig added in v1.17.0

func (k *Config) SetConfig(cfg *sarama.Config, log telegraf.Logger) error

SetConfig on the sarama.Config object from the Config struct.

type ReadConfig added in v1.17.0

type ReadConfig struct {
	Config
}

ReadConfig for kafka clients meaning to read from Kafka.

func (*ReadConfig) SetConfig added in v1.17.0

func (k *ReadConfig) SetConfig(cfg *sarama.Config, log telegraf.Logger) error

SetConfig on the sarama.Config object from the ReadConfig struct.

type SASLAuth added in v1.16.1

type SASLAuth struct {
	SASLUsername   config.Secret     `toml:"sasl_username"`
	SASLPassword   config.Secret     `toml:"sasl_password"`
	SASLExtensions map[string]string `toml:"sasl_extensions"`
	SASLMechanism  string            `toml:"sasl_mechanism"`
	SASLVersion    *int              `toml:"sasl_version"`

	// GSSAPI config
	SASLGSSAPIServiceName        string `toml:"sasl_gssapi_service_name"`
	SASLGSSAPIAuthType           string `toml:"sasl_gssapi_auth_type"`
	SASLGSSAPIDisablePAFXFAST    bool   `toml:"sasl_gssapi_disable_pafxfast"`
	SASLGSSAPIKerberosConfigPath string `toml:"sasl_gssapi_kerberos_config_path"`
	SASLGSSAPIKeyTabPath         string `toml:"sasl_gssapi_key_tab_path"`
	SASLGSSAPIRealm              string `toml:"sasl_gssapi_realm"`

	// OAUTHBEARER token based config
	SASLAccessToken config.Secret `toml:"sasl_access_token"`

	// OAUTHBEARER AWS MSK IAM based config
	SASLOAuthAWSMSKIAMConfig
}

func (*SASLAuth) SetSASLConfig added in v1.16.1

func (k *SASLAuth) SetSASLConfig(cfg *sarama.Config) error

SetSASLConfig configures SASL for kafka (sarama)

type SASLOAuthAWSMSKIAMConfig added in v1.35.0

type SASLOAuthAWSMSKIAMConfig struct {
	SASLAWSRegion  string `toml:"sasl_aws_msk_iam_region"`
	SASLAWSProfile string `toml:"sasl_aws_msk_iam_profile"`
	SASLAWSRole    string `toml:"sasl_aws_msk_iam_role"`
	SASLAWSSession string `toml:"sasl_aws_msk_iam_session"`
}

type WriteConfig added in v1.17.0

type WriteConfig struct {
	Config

	RequiredAcks     int  `toml:"required_acks"`
	MaxRetry         int  `toml:"max_retry"`
	MaxMessageBytes  int  `toml:"max_message_bytes"`
	IdempotentWrites bool `toml:"idempotent_writes"`
}

WriteConfig for kafka clients meaning to write to kafka

func (*WriteConfig) SetConfig added in v1.17.0

func (k *WriteConfig) SetConfig(cfg *sarama.Config, log telegraf.Logger) error

SetConfig on the sarama.Config object from the WriteConfig struct.

type XDGSCRAMClient added in v1.16.1

type XDGSCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

func (*XDGSCRAMClient) Begin added in v1.16.1

func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)

func (*XDGSCRAMClient) Done added in v1.16.1

func (x *XDGSCRAMClient) Done() bool

func (*XDGSCRAMClient) Step added in v1.16.1

func (x *XDGSCRAMClient) Step(challenge string) (response string, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL