tracing

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const ErrorDomainTagKey = "error.domain"

ErrorDomainTagKey indicates that tag key to use for error domain

View Source
const ErrorReasonTagKey = "error.reason"

ErrorReasonTagKey indicates that tag key to use for error reason

View Source
const RetryEventTagKey = "retry.event"

RetryEventTagKey is used to tag the number of retry in kafka receiver

Variables

View Source
var (
	GRPCSpanOption = opentracing.Tag{Key: "span.type", Value: "rpc"}

	// LogEventTag represents trace event type tag
	LogEventTag = fields.StringTagName("event")

	// LogMessageTag represents trace message tag
	LogMessageTag = fields.StringTagName("message")
)
View Source
var PanicTagKey = "error.panic"

PanicTagKey indicates the tag key to use for panic

Functions

func Handler deprecated

func Handler(tracer opentracing.Tracer, inner http.Handler) http.Handler

Handler can be used to wrap an http.Handler into one that also handles tracing. To use it create a ddtracer ( e.g. opentracing.GlobalTracer() ) and pass it with the original handler.

Deprecated: Refer to http.ServerTracingMiddleware

func NewJaeger

func NewJaeger(serviceName string, opts ...TraceOption) (opentracing.Tracer, io.Closer)

NewJaeger creates a new opentracing.Tracer that uses Jaeger serviceName should be set based on the name provided in the configuration

func Noop

func Noop() (opentracing.Tracer, io.Closer)

Noop returns a noop tracer and closer

func OnError

func OnError(span opentracing.Span, err error)

OnError marks span as error and adds log records

func OnPanic

func OnPanic(span opentracing.Span, panicErr interface{})

OnPanic applies default tags and log fields to the span

func ResourceNameOption

func ResourceNameOption(resourceName string) opentracing.StartSpanOption

ResourceNameOption return a start span option with updated resource name

func SetResourceName

func SetResourceName(span opentracing.Span, resourceName string)

SetResourceName updates the resource name of the span

func SetTagAndBaggage

func SetTagAndBaggage(span opentracing.Span, baggageKey, baggageValue string) error

SetTagAndBaggage sets a Tag and a Baggage item on the provided span.

func SetTagFromBaggage

func SetTagFromBaggage(span opentracing.Span, baggageKey string) error

SetTagFromBaggage sets a Tag on the Span using a baggage item value. This is useful when propagating a tag from a service to another. It can be used within the same service too.

func WithSpan

func WithSpan(ctx context.Context, action func(span opentracing.Span))

WithSpan executes the supplied action with the current span if it exists

Types

type TraceOption

type TraceOption func(options *traceOptions)

TraceOption represents

func MetricEndpoint

func MetricEndpoint(host string, port string) TraceOption

MetricEndpoint metric endpoint specifies the host and port to use to for metric data

func TraceEndpoint

func TraceEndpoint(host string, port string) TraceOption

TraceEndpoint specifies the host and port to use to for metric data

Jump to

Keyboard shortcuts

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