kafka

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArguments = Arguments{
	GroupID:  "loki.source.kafka",
	Assignor: "range",
	Version:  "2.2.1",
	Authentication: KafkaAuthentication{
		Type: "none",
		SASLConfig: KafkaSASLConfig{
			Mechanism: sarama.SASLTypePlaintext,
			UseTLS:    false,
		},
	},
	UseIncomingTimestamp: false,
}

DefaultArguments provides the default arguments for a kafka component.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	Brokers              []string            `river:"brokers,attr"`
	Topics               []string            `river:"topics,attr"`
	GroupID              string              `river:"group_id,attr,optional"`
	Assignor             string              `river:"assignor,attr,optional"`
	Version              string              `river:"version,attr,optional"`
	Authentication       KafkaAuthentication `river:"authentication,block,optional"`
	UseIncomingTimestamp bool                `river:"use_incoming_timestamp,attr,optional"`
	Labels               map[string]string   `river:"labels,attr,optional"`

	ForwardTo    []loki.LogsReceiver `river:"forward_to,attr"`
	RelabelRules flow_relabel.Rules  `river:"relabel_rules,attr,optional"`
}

Arguments holds values which are used to configure the loki.source.kafka component.

func (*Arguments) Convert

func (args *Arguments) Convert() kt.Config

Convert is used to bridge between the River and Promtail types.

func (*Arguments) SetToDefault added in v0.35.0

func (a *Arguments) SetToDefault()

SetToDefault implements river.Defaulter.

type Component

type Component struct {
	// contains filtered or unexported fields
}

Component implements the loki.source.kafka component.

func New

func New(o component.Options, args Arguments) (*Component, error)

New creates a new loki.source.kafka component.

func (*Component) Run

func (c *Component) Run(ctx context.Context) error

Run implements component.Component.

func (*Component) Update

func (c *Component) Update(args component.Arguments) error

Update implements component.Component.

type KafkaAuthentication

type KafkaAuthentication struct {
	Type       string           `river:"type,attr,optional"`
	TLSConfig  config.TLSConfig `river:"tls_config,block,optional"`
	SASLConfig KafkaSASLConfig  `river:"sasl_config,block,optional"`
}

KafkaAuthentication describe the configuration for authentication with Kafka brokers

func (KafkaAuthentication) Convert

func (auth KafkaAuthentication) Convert() kt.Authentication

type KafkaSASLConfig

type KafkaSASLConfig struct {
	Mechanism   string            `river:"mechanism,attr,optional"`
	User        string            `river:"user,attr,optional"`
	Password    rivertypes.Secret `river:"password,attr,optional"`
	UseTLS      bool              `river:"use_tls,attr,optional"`
	TLSConfig   config.TLSConfig  `river:"tls_config,block,optional"`
	OAuthConfig OAuthConfigConfig `river:"oauth_config,block,optional"`
}

KafkaSASLConfig describe the SASL configuration for authentication with Kafka brokers

type OAuthConfigConfig added in v0.33.0

type OAuthConfigConfig struct {
	TokenProvider string   `river:"token_provider,attr"`
	Scopes        []string `river:"scopes,attr"`
}

Jump to

Keyboard shortcuts

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