kafka

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: Apache-2.0 Imports: 13 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            `alloy:"brokers,attr"`
	Topics               []string            `alloy:"topics,attr"`
	GroupID              string              `alloy:"group_id,attr,optional"`
	Assignor             string              `alloy:"assignor,attr,optional"`
	Version              string              `alloy:"version,attr,optional"`
	Authentication       KafkaAuthentication `alloy:"authentication,block,optional"`
	UseIncomingTimestamp bool                `alloy:"use_incoming_timestamp,attr,optional"`
	Labels               map[string]string   `alloy:"labels,attr,optional"`

	ForwardTo    []loki.LogsReceiver `alloy:"forward_to,attr"`
	RelabelRules alloy_relabel.Rules `alloy:"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 Alloy and Promtail types.

func (*Arguments) SetToDefault

func (a *Arguments) SetToDefault()

SetToDefault implements syntax.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           `alloy:"type,attr,optional"`
	TLSConfig  config.TLSConfig `alloy:"tls_config,block,optional"`
	SASLConfig KafkaSASLConfig  `alloy:"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            `alloy:"mechanism,attr,optional"`
	User        string            `alloy:"user,attr,optional"`
	Password    alloytypes.Secret `alloy:"password,attr,optional"`
	UseTLS      bool              `alloy:"use_tls,attr,optional"`
	TLSConfig   config.TLSConfig  `alloy:"tls_config,block,optional"`
	OAuthConfig OAuthConfigConfig `alloy:"oauth_config,block,optional"`
}

KafkaSASLConfig describe the SASL configuration for authentication with Kafka brokers

type OAuthConfigConfig

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

Jump to

Keyboard shortcuts

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