tracer

package
v0.9.9 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package tracer provides a wrapper around OpenTelemetry to add standard fields to the span.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndError

func EndError(span trace.Span, err error)

EndError ends the span with a status of "error".

func EndOK

func EndOK(span trace.Span)

EndOK ends the span with a status of "ok".

func Initialize

func Initialize(conn *grpc.ClientConn) (func(context.Context) error, error)

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.

Jump to

Keyboard shortcuts

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