tracing

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TraceVersion defines the version used in the Traceparent header.
	TraceVersion = byte(1)

	// FlagSampled is the flag used to
	FlagSampled = byte(1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Traceparent

type Traceparent struct {
	// contains filtered or unexported fields
}

Traceparent defines the header used for distributed tracing. A Traceparent is based on the W3C trace-context specification available at https://w3c.github.io/trace-context/#version.

func Must

func Must() *Traceparent

Must generates a new Traceparent but panics if it fails to do it.

func New

func New() (*Traceparent, error)

New generates a new Traceparent.

func Parse

func Parse(s string) (*Traceparent, error)

Parse parses a Tranceparent string and returns a Tranceparent value.

func (*Traceparent) NewSpan

func (t *Traceparent) NewSpan() (*Traceparent, error)

NewSpan returns a traceparent with a different parent-id.

func (*Traceparent) ParentID

func (t *Traceparent) ParentID() string

ParentID returns the string representation of the parent-id.

func (*Traceparent) Sample

func (t *Traceparent) Sample()

Sample sets the sample flag.

func (*Traceparent) Sampled

func (t *Traceparent) Sampled() bool

Sampled returns if the flag sampled is set.

func (*Traceparent) SetTraceFlags

func (t *Traceparent) SetTraceFlags(flags byte)

SetTraceFlags set the given flags.

func (*Traceparent) SpanID

func (t *Traceparent) SpanID() string

SpanID returns the string representation of the parent-id, also called span-id.

func (*Traceparent) String

func (t *Traceparent) String() string

String returns the string representation of the traceparent.

func (*Traceparent) TraceFlags

func (t *Traceparent) TraceFlags() byte

TraceFlags returns the trace-flags.

func (*Traceparent) TraceID

func (t *Traceparent) TraceID() string

TraceID returns the string representation of the trace-id.

func (*Traceparent) Version

func (t *Traceparent) Version() int

Version returns the version number.

Jump to

Keyboard shortcuts

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