blazetrace

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ServiceName is a trace attribute for the service name
	ServiceName = attribute.Key("service.name")
	//EmptyParentSpanDescriptor is a descritor for an empty span
	EmptyParentSpanDescriptor = ParentSpanDescriptor{}
)
View Source
var (
	//ClientName is a trace attribute for the service name
	ClientName = attribute.Key("client.name")
)

Functions

func WithAttributes

func WithAttributes(attr ...attribute.KeyValue) []attribute.KeyValue

WithAttributes collects attributes into a attribute slice

Types

type ClientTraceOption

type ClientTraceOption func(*ClientTraceOptions)

ClientTraceOption

func WithClientTracer

func WithClientTracer(tr trace.Tracer) ClientTraceOption

WithClientTracer sets a specific tracer to be uses

type ClientTraceOptions

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

ClientTraceOptions

type ClientTracer

type ClientTracer interface {
	Inject(ctx context.Context, r *http.Request) (context.Context, *http.Request)
	StartSpan(ctx context.Context, spanName string, attrs []attribute.KeyValue, opts ...trace.SpanOption) (context.Context, trace.Span)
	EndSpan(span trace.Span)
}

ClientTracer allows tracing of blaze services

func NewClientTracer

func NewClientTracer(opts ...ClientTraceOption) ClientTracer

NewClientTracer creates a new tracer

type ParentSpanDescriptor

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

ParentSpanDescriptor dexcribes the parent span

type ServiceTraceOption

type ServiceTraceOption func(*ServiceTraceOptions)

ServiceTraceOption

func WithTracer

func WithTracer(tr trace.Tracer) ServiceTraceOption

WithTracer sets a specific tracer to be uses

type ServiceTraceOptions

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

ServiceTraceOptions

type ServiceTracer

type ServiceTracer interface {
	Extract(r *http.Request) (context.Context, *http.Request, ParentSpanDescriptor)
	StartSpan(ctx context.Context, spanName string, psd ParentSpanDescriptor, attrs []attribute.KeyValue, opts ...trace.SpanOption) (context.Context, trace.Span)
	EndSpan(span trace.Span)
}

ServiceTracer allows tracing of blaze services

func NewServiceTracer

func NewServiceTracer(opts ...ServiceTraceOption) ServiceTracer

NewServiceTracer

Jump to

Keyboard shortcuts

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