sarama

package
v1.3.9-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 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) 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) 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

This section is empty.

Directories

Path Synopsis
example

Jump to

Keyboard shortcuts

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