config

package
v0.0.0-...-44f85d7 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterAdmin

func GetClusterAdmin() (sarama.ClusterAdmin, error)

returns a Sarama Cluster Admin

func GetConsumerGroupOffsets

func GetConsumerGroupOffsets(group string, client sarama.Client, ca sarama.ClusterAdmin, lag bool) (map[string]map[int32]int64, error)

returns the offsets or consumer lag for given consumer group for all topics

func GetConsumerGroups

func GetConsumerGroups(ca sarama.ClusterAdmin) ([]string, error)

returns the consumer groups of a Kafka Cluster

func GetKafkaClient

func GetKafkaClient() (sarama.Client, error)

returns a new Kafka client

func GetLogger

func GetLogger(verbose bool) (*logrus.Logger, error)

func GetTopics

func GetTopics(ca sarama.ClusterAdmin) ([]string, error)

returns the configured topics in the Kafka cluster

func StartKafkaScraper

func StartKafkaScraper(wg *sync.WaitGroup, shutdownChan chan struct{}, errorChan chan error, client sarama.Client, ca sarama.ClusterAdmin, consumerOffset *prometheus.GaugeVec, scrapeConfig ScrapeConfig)

stars Kafka Scraper

func StringInArray

func StringInArray(a string, array []string) bool

basic check if string is in the array

Types

type ScrapeConfig

type ScrapeConfig struct {
	FetchMinInterval        int
	FetchMaxInterval        int
	MetadataRefreshInterval int
	Topics                  []string
	Groups                  []string
}

func NewScrapeConfig

func NewScrapeConfig(refresh int, fetchMin int, fetchMax int, groups []string, topics []string) (ScrapeConfig, error)

Jump to

Keyboard shortcuts

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