tracing

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package tracing //

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopSpan

type NoopSpan struct{}

NoopSpan is a no-op implementation of Span

func (*NoopSpan) End

func (s *NoopSpan) End()

End ends the noop-span

func (*NoopSpan) SetAttibutes

func (s *NoopSpan) SetAttibutes(key string, value interface{})

SetAttibutes sets the attributes for the noop-span

type NoopTracer

type NoopTracer struct{}

NoopTracer is a no-op implementation of Tracer

func (*NoopTracer) StartSpan

func (t *NoopTracer) StartSpan(ctx context.Context, tracerName, spanName string) (context.Context, Span)

StartSpan returns a new instance of NoopTracer

type Span

type Span interface {
	End()
	SetAttibutes(key string, value interface{})
}

Span interface implements the trace span returned by Tracer.

type Tracer

type Tracer interface {
	// StartSpan starts a trace span. Span can be a parent or child span based on the passed context.
	StartSpan(ctx context.Context, tracerName, spanName string) (context.Context, Span)
}

Tracer provides the necessary method to collect telemetry trace data. Tracer should not depend on any specific tool. To make it possible it returns a Span interface.

func NewOtelTracer

func NewOtelTracer(t trace.Tracer) Tracer

NewOtelTracer returns a new instance of Tracer

Jump to

Keyboard shortcuts

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