Documentation ¶
Index ¶
- Variables
- func AttachErrorToSpan(span trace.Span, description string, err error)
- func AttachFilterDataToSpan(span trace.Span, page *uint16, limit *uint8, sortBy *string)
- func AttachQueryFilterToSpan(span trace.Span, filter *types.QueryFilter)
- func AttachRequestToSpan(span trace.Span, req *http.Request)
- func AttachResponseToSpan(span trace.Span, res *http.Response)
- func AttachSessionContextDataToSpan(span trace.Span, sessionCtxData *types.SessionContextData)
- func AttachToSpan[T any](span trace.Span, attachmentKey string, x T)
- func AttachUserAgentDataToSpan(span trace.Span, req *http.Request)
- func AttachUserToSpan(span trace.Span, user *types.User)
- func BuildTracedHTTPClient() *http.Client
- func BuildTracedHTTPTransport(timeout time.Duration) http.RoundTripper
- func FormatSpan(operation string, req *http.Request) string
- func GetCallerName() string
- func NewInstrumentedSQLLogger(logger logging.Logger) instrumentedsql.Logger
- func NewInstrumentedSQLTracer(tracerProvider TracerProvider, name string) instrumentedsql.Tracer
- func StartCustomSpan(ctx context.Context, name string) (context.Context, trace.Span)
- func StartSpan(ctx context.Context) (context.Context, trace.Span)
- type Span
- type Tracer
- type TracerProvider
Constants ¶
This section is empty.
Variables ¶
var NewNoopTracerProvider = func() TracerProvider {
return &noopTracerProvider{}
}
NewNoopTracerProvider is a shadow for opentelemetry's NewNoopTracerProvider.
var ( ProvidersTracing = wire.NewSet( BuildTracedHTTPClient, ) )
Functions ¶
func AttachErrorToSpan ¶
AttachErrorToSpan attaches a given error to a span.
func AttachFilterDataToSpan ¶
AttachFilterDataToSpan provides a consistent way to attach a filter's info to a span.
func AttachQueryFilterToSpan ¶
func AttachQueryFilterToSpan(span trace.Span, filter *types.QueryFilter)
AttachQueryFilterToSpan attaches a given query filter to a span.
func AttachRequestToSpan ¶
AttachRequestToSpan attaches a given HTTP request to a span.
func AttachResponseToSpan ¶
AttachResponseToSpan attaches a given *http.Response to a span.
func AttachSessionContextDataToSpan ¶
func AttachSessionContextDataToSpan(span trace.Span, sessionCtxData *types.SessionContextData)
AttachSessionContextDataToSpan provides a consistent way to attach a SessionContextData object to a span.
func AttachUserAgentDataToSpan ¶
AttachUserAgentDataToSpan attaches a given search query to a span.
func AttachUserToSpan ¶
AttachUserToSpan provides a consistent way to attach a user to a span.
func BuildTracedHTTPClient ¶
BuildTracedHTTPClient returns a tracing-enabled HTTP client.
func BuildTracedHTTPTransport ¶
func BuildTracedHTTPTransport(timeout time.Duration) http.RoundTripper
BuildTracedHTTPTransport constructs a new http.Transport.
func FormatSpan ¶
FormatSpan formats a span.
func GetCallerName ¶
func GetCallerName() string
GetCallerName is largely (and respectfully) inspired by/copied from https://stackoverflow.com/a/35213181
func NewInstrumentedSQLLogger ¶
func NewInstrumentedSQLLogger(logger logging.Logger) instrumentedsql.Logger
NewInstrumentedSQLLogger wraps a logging.Logger for instrumentedsql.
func NewInstrumentedSQLTracer ¶
func NewInstrumentedSQLTracer(tracerProvider TracerProvider, name string) instrumentedsql.Tracer
NewInstrumentedSQLTracer wraps a Tracer for instrumentedsql.
func StartCustomSpan ¶
StartCustomSpan starts an anonymous custom span.
Types ¶
type Tracer ¶
type Tracer interface { StartSpan(ctx context.Context) (context.Context, Span) StartCustomSpan(ctx context.Context, name string, opts ...trace.SpanStartOption) (context.Context, Span) }
Tracer describes a tracer.
func NewTracerForTest ¶
NewTracerForTest creates a Tracer.
type TracerProvider ¶
type TracerProvider interface { trace.TracerProvider ForceFlush(ctx context.Context) error }
TracerProvider is a simple alias for trace.TracerProvider.
func EnsureTracerProvider ¶
func EnsureTracerProvider(tracerProvider TracerProvider) TracerProvider
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package cloudtrace provides common functions for attaching values to trace spans
|
Package cloudtrace provides common functions for attaching values to trace spans |
Package oteltracehttp provides common functions for attaching values to trace spans
|
Package oteltracehttp provides common functions for attaching values to trace spans |