kafkareporter

package module
v0.0.0-...-1db7dc6 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

README

Go2sky with kafka reporter

Installation

go get -u github.com/SkyAPM/go2sky-plugins/kafkareporter

Usage

r, err := kafkareporter.New([]string{"localhost:9092"})
if err != nil {
    log.Fatalf("new kafka reporter error %v \n", err)
}
defer r.Close()
tracer, err := go2sky.NewTracer("example", go2sky.WithReporter(r))

Documentation

Overview

Package kafkareporter is a plugin that can be one kafka reporter as go2sky.Reporter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(addrs []string, opts ...Option) (go2sky.Reporter, error)

New create a new reporter to send data to kafka.

Types

type Option

type Option func(r *kafkaReporter)

Option allows for functional options to adjust behaviour of a kafka reporter to be created by New

func WithCheckInterval

func WithCheckInterval(interval time.Duration) Option

WithCheckInterval setup service and endpoint registry check interval

func WithConfig

func WithConfig(c *sarama.Config) Option

WithConfig setup sarama.Config for kafka reporter

func WithInstanceProps

func WithInstanceProps(props map[string]string) Option

WithInstanceProps setup service instance properties eg: org=SkyAPM

func WithLogger

func WithLogger(logger *log.Logger) Option

WithLogger setup logger for kafka reporter

func WithTopicManagement

func WithTopicManagement(topicManagement string) Option

WithTopicManagement setup service management topic

func WithTopicSegment

func WithTopicSegment(topicSegment string) Option

WithTopicSegment setup service segment topic

Directories

Path Synopsis
internal
test

Jump to

Keyboard shortcuts

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