telemetry

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExporterLocator

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

func NewExporterLocator

func NewExporterLocator(opts ...ExporterLocatorOption) *ExporterLocator

func (*ExporterLocator) Build

func (*ExporterLocator) Validate

type ExporterLocatorOption

type ExporterLocatorOption func(*ExporterLocator)

func WithExporter

func WithExporter(name string, template ExporterTemplate) ExporterLocatorOption

type ExporterTemplate

type ExporterTemplate interface {
	Name() string
	ValidateConfig(settings map[string]interface{}) error
	WithSettings(settings map[string]interface{}) (appmetrics.Exporter, error)
}

type KafkaBase

type KafkaBase struct {
	EnvCfg   config.KafkaConfig
	Logger   *slog.Logger
	Producer *kafka.Producer
	Topic    string
}

func NewKafkaBase

func NewKafkaBase(logger *slog.Logger, envCfg config.KafkaConfig) KafkaBase

func (*KafkaBase) Close

func (b *KafkaBase) Close()

func (*KafkaBase) InitProducer

func (b *KafkaBase) InitProducer(cfg KafkaBaseConfig) error

InitProducer creates the producer and starts the asynchronous delivery-report handler. Topic creation runs in the background so an unreachable broker never blocks startup.

func (*KafkaBase) Produce

func (b *KafkaBase) Produce(data []byte) error

Produce enqueues a message without blocking on delivery. Delivery outcomes are reported asynchronously through handleDeliveryReports.

func (*KafkaBase) ResolveBaseConfig

func (b *KafkaBase) ResolveBaseConfig(settings map[string]interface{}) (KafkaBaseConfig, error)

func (*KafkaBase) ValidateBaseConfig

func (b *KafkaBase) ValidateBaseConfig(settings map[string]interface{}) error

type KafkaBaseConfig

type KafkaBaseConfig struct {
	Brokers []string `mapstructure:"brokers"`
	Topic   string   `mapstructure:"topic"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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