Documentation
¶
Overview ¶
Package tracer provides a wrapper around OpenTelemetry to add standard fields to the span.
Index ¶
- func EndError(span trace.Span, err error)
- func EndOK(span trace.Span)
- func Initialize(conn *grpc.ClientConn) (func(context.Context) error, error)
- func IsInitialized() bool
- func New(spanCtx context.Context, spanName string, kind trace.SpanKind, ...) (ctx context.Context, span trace.Span)
- func TracingMiddleware() gin.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
Initialize initializes the OpenTelemetry tracing library.
func IsInitialized ¶
func IsInitialized() bool
IsInitialized returns true if the tracer has been successfully initialized.
func New ¶
func New(spanCtx context.Context, spanName string, kind trace.SpanKind, attributes ...attribute.KeyValue) (ctx context.Context, span trace.Span)
New starts a new span with the given name and returns the context and span. If spanCtx is nil, context.Background() is used. The arg kind is used to set the span kind. The constant trace.SpanKind is defined here: https://pkg.go.dev/go.opentelemetry.io/otel/trace@v1.15.1#SpanKind
func TracingMiddleware ¶
func TracingMiddleware() gin.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.