tracing

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package tracing implements utility functions for recording opentracing events for messages.

WARNING: This package is considered experimental, and therefore is subject to change without a major version release.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateChildSpan

func CreateChildSpan(operationName string, part types.Part) opentracing.Span

CreateChildSpan takes a message part, extracts an existing span if there is one and returns child span.

func CreateChildSpans

func CreateChildSpans(operationName string, msg types.Message) []opentracing.Span

CreateChildSpans takes a message, extracts spans per message part and returns a slice of child spans. The length of the returned slice is guaranteed to match the message size.

func FinishSpans

func FinishSpans(msg types.Message)

FinishSpans calls Finish on all message parts containing a span.

func GetSpan

func GetSpan(p types.Part) opentracing.Span

GetSpan returns a span attached to a message part. Returns nil if the part doesn't have a span attached.

func InitSpans

func InitSpans(operationName string, msg types.Message)

InitSpans sets up OpenTracing spans on each message part if one does not already exist.

func InitSpansFromParent

func InitSpansFromParent(operationName string, parent opentracing.SpanContext, msg types.Message)

InitSpansFromParent sets up OpenTracing spans as children of a parent span on each message part if one does not already exist.

func IterateWithChildSpans

func IterateWithChildSpans(operationName string, msg types.Message, iter func(int, opentracing.Span, types.Part) error) error

IterateWithChildSpans iterates all the parts of a message and, for each part, creates a new span from an existing span attached to the part and calls a func with that span before finishing the child span.

func WithChildSpans

func WithChildSpans(operationName string, msg types.Message) (types.Message, []opentracing.Span)

WithChildSpans takes a message, extracts spans per message part, creates new child spans, and returns a new message with those spans embedded. The original message is unchanged.

func WithSiblingSpans

func WithSiblingSpans(operationName string, msg types.Message) types.Message

WithSiblingSpans takes a message, extracts spans per message part, creates new sibling spans, and returns a new message with those spans embedded. The original message is unchanged.

Types

This section is empty.

Jump to

Keyboard shortcuts

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