oteltracing

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// UnaryServerInterceptor is alias for otelgrpc.UnaryServerInterceptor.
	UnaryServerInterceptor = otelgrpc.UnaryServerInterceptor
	// StreamServerInterceptor is alias for otelgrpc.StreamServerInterceptor.
	StreamServerInterceptor = otelgrpc.StreamServerInterceptor
)
View Source
var (
	// UnaryClientInterceptor is alias for  otelgrpc.UnaryClientInterceptor.
	UnaryClientInterceptor = otelgrpc.UnaryClientInterceptor
	// StreamClientInterceptor is alias for otelgrpc.StreamClientInterceptor.
	StreamClientInterceptor = otelgrpc.StreamClientInterceptor
)
View Source
var (
	// GinMiddleware is alias for otelgin.Middleware.
	GinMiddleware = otelgin.Middleware
	// HTTPMiddleware is alias for telhttp.NewHandler.
	HTTPMiddleware = otelhttp.NewHandler
)
View Source
var HTTPTransport = otelhttp.NewTransport

HTTPTransport is alias for otelhttp.NewTransport.

Functions

func DoInSpan

func DoInSpan(ctx context.Context, operationName string, doFn func(context.Context), opts ...otelTrace.SpanStartOption)

DoInSpan executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any. It uses opentracing.Tracer propagated in context. If no found, it uses noop tracer notification.

func DoWithSpan

func DoWithSpan(ctx context.Context, operationName string, doFn func(context.Context, otelTrace.Span), opts ...otelTrace.SpanStartOption)

DoWithSpan executes function doFn inside new span with `operationName` name and hooking as child to a span found within given context if any. It uses opentracing.Tracer propagated in context. If no found, it uses noop tracer notification.

func InitTracerFromEnv

func InitTracerFromEnv(logger *log.Logger, serviceName string, attrs ...attribute.KeyValue) error

InitTracerFromEnv init opentelemetry tracer by env.

Types

This section is empty.

Jump to

Keyboard shortcuts

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