tracer

package
v0.0.0-...-c9f6891 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTracerWriter

func CreateTracerWriter(w rest.ResponseWriter, ctx context.Context, span oteltrace.Span, tracer oteltrace.Tracer) *tracerResponseWriter

func GetTraceHeaderFromJaeger

func GetTraceHeaderFromJaeger(r *http.Request)

GetTraceHeaderFromJaeger conver uber-trace-id header to traceparent here you can read more about those formats:

https://www.w3.org/TR/trace-context/#traceparent-header
https://www.jaegertracing.io/docs/1.22/client-libraries/#key

func Init

func Init(serviceName string) *sdktrace.TracerProvider

func SemVersion

func SemVersion() string

SemVersion is the semantic version to be supplied to tracer/meter creation.

func Version

func Version() string

Version is the current release version of the echo instrumentation.

Types

type GetSpanNameFunc

type GetSpanNameFunc func(string) string

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option applies a configuration value.

func WithPropagators

func WithPropagators(propagators propagation.TextMapPropagator) Option

WithPropagators specifies propagators to use for extracting information from the HTTP requests. If none are specified, global ones will be used.

func WithTracerProvider

func WithTracerProvider(provider oteltrace.TracerProvider) Option

WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.

type OtelMiddleware

type OtelMiddleware struct {
	ServiceName string
	Opts        []Option
	Router      rest.RouterApp
}

OtelMiddleware sent trace to open telemetry collector

func (*OtelMiddleware) MiddlewareFunc

func (mw *OtelMiddleware) MiddlewareFunc(h rest.HandlerFunc) rest.HandlerFunc

MiddlewareFunc makes OtelMiddleware implement the Middleware interface.

type OtelTracer

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

func GetFunctionTracer

func GetFunctionTracer() *OtelTracer

func (*OtelTracer) NewSpan

func (t *OtelTracer) NewSpan(ctx context.Context, spanName string) oteltrace.Span

Jump to

Keyboard shortcuts

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