tracestate

package
v0.0.0-...-1757c39 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2018 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidListMember occurs if at least one list member is invalid, e.g., contains an unexpected character.
	ErrInvalidListMember = errors.New("tracecontext: Invalid tracestate list member")
	// ErrDuplicateListMemberKey occurs if at least two list members contain the same vendor-tenant pair.
	ErrDuplicateListMemberKey = errors.New("tracecontext: Duplicate list member key in tracestate")
	// ErrTooManyListMembers occurs if the list contains more than the maximum number of members per the spec, i.e., 32.
	ErrTooManyListMembers = errors.New("tracecontext: Too many list members in tracestate")
)

Functions

This section is empty.

Types

type Member

type Member struct {
	// Vendor is a key representing a particular trace vendor.
	Vendor string
	// Tenant is a key used to distinguish between tenants of a multi-tenant trace vendor.
	Tenant string
	// Value is the particular data that the vendor intents to pass to child spans.
	Value string
}

Member contains vendor-specific data that should be propagated across all new spans started within a given trace.

func (Member) String

func (m Member) String() string

String encodes a `Member` into a string formatted according to the W3C spec. The string may be invalid if any fields are invalid, e.g, the vendor contains a non-compliant character.

type TraceState

type TraceState []Member

TraceState represents a list of `Member`s that should be propagated to new spans started in a trace.

func Parse

func Parse(traceState []byte) (TraceState, error)

Parse attempts to decode a `TraceState` from a byte array. It returns an error if the byte array is invalid, e.g., it contains an incorrectly formatted list member.

func ParseString

func ParseString(traceState string) (TraceState, error)

ParseString attempts to decode a `TraceState` from a string. It returns an error if the string is invalid, e.g., it contains an incorrectly formatted list member.

func (TraceState) String

func (ts TraceState) String() string

String encodes all `Member`s of the `TraceState` into a single string, formatted according to the W3C spec. The string may be invalid if any `Member`s are invalid, e.g., containing a non-compliant character.

Jump to

Keyboard shortcuts

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