honeycomb

package
v1.0.8173-1e8af7d Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package honeycomb implements o11y tracing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conf Config) o11y.Provider

New creates a new honeycomb o11y provider, which emits traces to STDOUT and optionally also sends them to a honeycomb server

func WrapSpan

func WrapSpan(s *trace.Span) o11y.Span

Types

type Config

type Config struct {
	Host          string
	Dataset       string
	Key           string
	Format        string
	SendTraces    bool // Should we actually send the traces to the honeycomb server?
	Sender        transmission.Sender
	SampleTraces  bool
	SampleKeyFunc func(map[string]interface{}) string
	SampleRates   map[string]int
	Writer        io.Writer
	Metrics       o11y.ClosableMetricsProvider
	ServiceName   string

	Debug bool
}

func (*Config) Validate

func (c *Config) Validate() error

type MultiSender

type MultiSender struct {
	Senders []transmission.Sender
}

func (*MultiSender) Add

func (s *MultiSender) Add(ev *transmission.Event)

Add calls Add on every configured Sender

func (*MultiSender) Flush

func (s *MultiSender) Flush() error

func (*MultiSender) SendResponse

func (s *MultiSender) SendResponse(resp transmission.Response) bool

SendResponse calls SendResponse on every configured Sender

func (*MultiSender) Start

func (s *MultiSender) Start() error

Start calls Start on every configured Sender, aborting on the first error

func (*MultiSender) Stop

func (s *MultiSender) Stop() error

Stop calls Stop on every configured Sender. It will call Stop on every Sender even if there are errors

func (*MultiSender) TxResponses

func (s *MultiSender) TxResponses() chan transmission.Response

TxResponses returns the response channel from the first Sender only

type TextSender

type TextSender struct {
	sync.Mutex
	// contains filtered or unexported fields
}

TextSender implements the transmission.Sender interface by marshalling events to human-readable text and writing to the writer w, with optional colour

the implementation is heavily cribbed from honeycomb's transmission.WriterSender

func (*TextSender) Add

func (t *TextSender) Add(ev *transmission.Event)

func (*TextSender) Flush

func (t *TextSender) Flush() error

func (*TextSender) SendResponse

func (t *TextSender) SendResponse(r transmission.Response) bool

func (*TextSender) Start

func (t *TextSender) Start() error

func (*TextSender) Stop

func (t *TextSender) Stop() error

func (*TextSender) TxResponses

func (t *TextSender) TxResponses() chan transmission.Response

type TraceSampler

type TraceSampler struct {
	// keyFunc takes the event's fields map and returns a single string key
	// which will be used as the lookup into the sampling strategy
	KeyFunc func(map[string]interface{}) string

	Sampler dynsampler.Sampler
}

func (*TraceSampler) Hook

func (s *TraceSampler) Hook(fields map[string]interface{}) (sample bool, rate int)

Hook implements beeline.Config.Samplerhook

Jump to

Keyboard shortcuts

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