otel

package
v1.0.11221-d03107e Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package otel contains an o11y.Provider that emits open telemetry gRPC. N.B. This has not been tried against a production collector, so we need to try it out on a safe / non production traffic service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(conf Config) (o11y.Provider, error)

Types

type Annotator

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

Annotator is a SpanProcessor that adds attributes to all started spans.

func (Annotator) ForceFlush

func (a Annotator) ForceFlush(context.Context) error

func (Annotator) OnEnd

func (a Annotator) OnEnd(s sdktrace.ReadOnlySpan)

func (Annotator) OnStart

func (Annotator) Shutdown

func (a Annotator) Shutdown(context.Context) error

type Config

type Config struct {
	Dataset            string
	GrpcHostAndPort    string
	ResourceAttributes []attribute.KeyValue

	SampleTraces  bool
	SampleKeyFunc func(map[string]any) string
	SampleRates   map[string]uint

	DisableText bool

	Metrics o11y.ClosableMetricsProvider
}

type Provider

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

func (Provider) AddField

func (o Provider) AddField(ctx context.Context, key string, val any)

func (Provider) AddFieldToTrace

func (o Provider) AddFieldToTrace(ctx context.Context, key string, val any)

func (Provider) AddGlobalField

func (o Provider) AddGlobalField(key string, val any)

func (Provider) Close

func (o Provider) Close(ctx context.Context)

func (Provider) GetSpan

func (o Provider) GetSpan(ctx context.Context) o11y.Span

GetSpan returns the active span in the given context. It will return nil if there is no span available.

func (Provider) Helpers

func (o Provider) Helpers(disableW3c ...bool) o11y.Helpers

func (Provider) Log

func (o Provider) Log(ctx context.Context, name string, fields ...o11y.Pair)

func (Provider) MetricsProvider

func (o Provider) MetricsProvider() o11y.MetricsProvider

func (*Provider) RawProvider

func (o *Provider) RawProvider() *Provider

RawProvider satisfies an interface the helpers need

func (Provider) StartSpan

func (o Provider) StartSpan(ctx context.Context, name string) (context.Context, o11y.Span)

Directories

Path Synopsis
Package texttrace is a span exporter for otel that outputs to the ex text console format
Package texttrace is a span exporter for otel that outputs to the ex text console format

Jump to

Keyboard shortcuts

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