Documentation
¶
Index ¶
- Constants
- type Traceparent
- func (t *Traceparent) NewSpan() (*Traceparent, error)
- func (t *Traceparent) ParentID() string
- func (t *Traceparent) Sample()
- func (t *Traceparent) Sampled() bool
- func (t *Traceparent) SetTraceFlags(flags byte)
- func (t *Traceparent) SpanID() string
- func (t *Traceparent) String() string
- func (t *Traceparent) TraceFlags() byte
- func (t *Traceparent) TraceID() string
- func (t *Traceparent) Version() int
Constants ¶
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 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) 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.