traces

package
v0.0.0-...-a1933d6 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPTracer

type HTTPTracer interface {
	FromHTTPRequest(r *http.Request) Tracer
}

type NopTracer

type NopTracer struct {
}

NopTracer is a tracer that does nothing

func (*NopTracer) Bool

func (t *NopTracer) Bool(key string, val bool)

Bool adds a tag to the trace of type bool.

func (*NopTracer) End

func (t *NopTracer) End()

End marks the end of this span.

func (*NopTracer) Err

func (t *NopTracer) Err(err error)

Err adds an error to the trace.

func (*NopTracer) F64

func (t *NopTracer) F64(key string, val float64)

F64 adds a tag to the trace of type float64.

func (*NopTracer) I64

func (t *NopTracer) I64(key string, val int64)

I64 adds a tag to the trace of type int64.

func (*NopTracer) SetAttrs

func (t *NopTracer) SetAttrs(attrMap map[string]interface{})

func (*NopTracer) Start

func (t *NopTracer) Start(ctx context.Context, name string,
	attrs map[string]interface{}) Tracer

Start begins a tracer span.

func (*NopTracer) Str

func (t *NopTracer) Str(key, val string)

Str adds a tag to the trace of type string.

func (*NopTracer) TraceID

func (t *NopTracer) TraceID() string

TraceID returns the ID for the current trace.

type OTELTracer

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

OTELTracer is a tracer that does nothing

func (*OTELTracer) Bool

func (t *OTELTracer) Bool(key string, val bool)

Bool adds a tag to the trace of type bool.

func (*OTELTracer) End

func (t *OTELTracer) End()

End marks the end of this span.

func (*OTELTracer) Err

func (t *OTELTracer) Err(err error)

Err adds an error to the trace.

func (*OTELTracer) F64

func (t *OTELTracer) F64(key string, val float64)

F64 adds a tag to the trace of type float64.

func (*OTELTracer) I64

func (t *OTELTracer) I64(key string, val int64)

I64 adds a tag to the trace of type int64.

func (*OTELTracer) SetAttrs

func (t *OTELTracer) SetAttrs(attrMap map[string]interface{})

func (*OTELTracer) Start

func (t *OTELTracer) Start(ctx context.Context, name string, attrMap map[string]interface{}) Tracer

Start begins a tracer span.

func (*OTELTracer) Str

func (t *OTELTracer) Str(key, val string)

Str adds a tag to the trace of type string.

func (*OTELTracer) TraceID

func (t *OTELTracer) TraceID() string

TraceID returns the ID for the current trace.

type OTELTracerConfig

type OTELTracerConfig struct {
	Host       string  `json:"host"`
	Port       int     `json:"port"`
	UseHTTP    bool    `json:"use_http"`
	SampleRate float64 `json:"sample_rate"`
}

func (*OTELTracerConfig) Clean

func (c *OTELTracerConfig) Clean() *OTELTracerConfig

func (OTELTracerConfig) String

func (c OTELTracerConfig) String() string

type SpanTracer

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

func (*SpanTracer) Bool

func (s *SpanTracer) Bool(key string, val bool)

Bool adds a tag to the trace of type bool.

func (*SpanTracer) End

func (s *SpanTracer) End()

End marks the end of this span.

func (*SpanTracer) Err

func (s *SpanTracer) Err(err error)

Err adds an error to the trace.

func (*SpanTracer) F64

func (s *SpanTracer) F64(key string, val float64)

F64 adds a tag to the trace of type float64.

func (*SpanTracer) I64

func (s *SpanTracer) I64(key string, val int64)

I64 adds a tag to the trace of type int64.

func (*SpanTracer) SetAttrs

func (s *SpanTracer) SetAttrs(attrMap map[string]interface{})

func (*SpanTracer) Start

func (s *SpanTracer) Start(ctx context.Context, name string, attrMap map[string]interface{}) Tracer

Start begins a tracer span.

func (*SpanTracer) Str

func (s *SpanTracer) Str(key, val string)

Str adds a tag to the trace of type string.

func (*SpanTracer) TraceID

func (s *SpanTracer) TraceID() string

TraceID returns the ID for the current trace.

type Tracer

type Tracer interface {
	attrs.Attributable

	// Start begins a tracer span.
	Start(ctx context.Context, name string, attrs map[string]interface{}) Tracer
	// End marks the end of this span.
	End()

	// TraceID returns the ID for the current trace.
	TraceID() string

	// Err adds an error to the trace.
	Err(err error)
}

Tracer defines a basic interface to create traces.

type TracerBuilderFn

type TracerBuilderFn func(log logs.Logger) Tracer

TracerBuilderFn defines the function type to create a new Tracer

func NewNopTracerBuilder

func NewNopTracerBuilder() TracerBuilderFn

NewNopTracerBuilder returns a function to crate new tracers.

func NewOTELTracerBuilder

func NewOTELTracerBuilder(ctx context.Context, l logs.Logger,
	cfg *OTELTracerConfig, serviceName string, serviceVersion string) TracerBuilderFn

NewOTELTracerBuilder returns a function to crate new tracers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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