opentracing

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package opentracing provides an opentracing-go Tracer that is compatible with the sqltracing.Tracer interface.

Index

Constants

This section is empty.

Variables

View Source
var DefaultTracingTags = opentracing.Tags{
	string(ext.Component): "sqltracing",
	string(ext.DBType):    "sql",
	string(ext.SpanKind):  string(ext.SpanKindRPCClientEnum),
}

DefaultTracingTags are the tags that are added by default to all traces.

Functions

func NewTracer

func NewTracer(opts ...Opt) sqltracing.Tracer

NewTracer returns a tracer that will create spans via opentracing-go. When no options are specified, opentracing.GlobalTracer is used as default Tracer, DefaultTracingTags are used as tags and TraceOrphans is enabled.

Types

type Opt

type Opt func(*tracer)

Opt is a type for options that can be passed to NewTracer.

func WithTracer

func WithTracer(fn func() opentracing.Tracer) Opt

WithTracer is an option for NewTracer() to use a custom function to retrieve the opentracing Tracer to use.

func WithTracingTags

func WithTracingTags(tags opentracing.Tags) Opt

WithTracingTags is an option for NewTracer() to set the tags that are applied to all traces created by StartSpan().

func WithoutTracingOrphans

func WithoutTracingOrphans() Opt

WithoutTracingOrphans is an option for NewTracer() to disable tracing spans if no parent span exist in the context.

Jump to

Keyboard shortcuts

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