sarama

package
v1.3.16 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

README

support async producer and group consumer

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectCtx

InjectCtx inject ctx into msg to generate clientSpan

func WrapHandler

func WrapHandler(handler func(ctx context.Context, data []byte), tracer aitracer.Tracer, opts ...Option) func(msg *sarama.ConsumerMessage)

WrapHandler wrap func(ctx context.Context, data []byte) for sarama.ConsumerGroupHandler in order to extract tracing info from msg and generate serverSpan handler take sarama.ConsumerMessage.Value as param, and ctx contains serverSpan

func WrapProducer

func WrapProducer(cfg *sarama.Config, p sarama.AsyncProducer, tracer aitracer.Tracer, opts ...Option) sarama.AsyncProducer

WrapProducer wrap inner sarama.AsyncProducer to generate client span. due to sarama.AsyncProducer.Input() return a chan, we can not instrument Input method so a outerInput chan is provided, when put msg into outerInput chan, we can intercept and trace it

Types

type Config added in v1.3.13

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

type Option added in v1.3.13

type Option func(*Config)

func WithAdditionalTags added in v1.3.13

func WithAdditionalTags(tags map[string]string) Option

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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