Documentation
¶
Overview ¶
Package cinder provides instrumentation capabilities to applications and components.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Branch ¶
Branch will wrap the provided context with the tail of the found trace in the context if the root span matches the span found in the context. This ensures that opentracing compatible code will properly branch of the trace tail rather than the root.
func RootHandler ¶
RootHandler is the middleware used to create the root trace span for incoming HTTP requests.
func SetupTesting ¶
func SetupTesting(name string) func()
SetupTesting will configure a local jaeger instance to receive test traces.
Types ¶
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span is the underlying span used for tracing.
func Track ¶
Track is used to mark and annotate a function call. It will automatically wrap the context with a child from the span history found in the provided context. If no span history was found it will return a noop span.
If the function finds a trace in the context and its root span matches the span from the context it will create a child from the traces tail. If not it considers the span history to have diverged from the trace.
type Trace ¶
type Trace struct {
// contains filtered or unexported fields
}
Trace implements a span stack that can be used with fat contexts. Rather than branching of the context for every function call, a span is pushed onto the stack to track execution.
Code that uses Track will automatically discover the stack and branch of its tail if no previous branch has been detected. Other opentracing compatible code would not be able to find the stack and would use the root span instead. This can be prevented by ensuring a branch using the Branch function.
func CreateTrace ¶
CreateTrace returns a new trace that will use the span found in the provided context as its root or start a new one. The returned context is the provided context wrapped with the new span and trace.
func (*Trace) Pop ¶
func (t *Trace) Pop()
Pop finishes and removes the last pushed span. This call is usually deferred right after a push.
func (*Trace) Root ¶
func (t *Trace) Root() opentracing.Span
Root will return the root of the span stack.