propagation

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 21

Documentation

Overview

Package propagation holds the required function signatures for Injection and Extraction. It also contains decoder and encoder of SkyWalking propagation protocol.

Index

Constants

View Source
const (
	Header            string = "sw8"
	HeaderCorrelation string = "sw8-correlation"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Extractor

type Extractor func(headerKey string) (string, error)

Extractor is a tool specification which define how to extract trace parent context from propagation context

type Injector

type Injector func(headerKey, headerValue string) error

Injector is a tool specification which define how to inject trace context into propagation context

type SpanContext

type SpanContext struct {
	TraceID               string            `json:"trace_id"`
	ParentSegmentID       string            `json:"parent_segment_id"`
	ParentService         string            `json:"parent_service"`
	ParentServiceInstance string            `json:"parent_service_instance"`
	ParentEndpoint        string            `json:"parent_endpoint"`
	AddressUsedAtClient   string            `json:"address_used_at_client"`
	ParentSpanID          int32             `json:"parent_span_id"`
	Sample                int8              `json:"sample"`
	Valid                 bool              `json:"valid"`
	CorrelationContext    map[string]string `json:"correlation_context"`
}

SpanContext defines propagation specification of SkyWalking

func (*SpanContext) Decode added in v1.0.0

func (tc *SpanContext) Decode(extractor Extractor) error

Decode all SpanContext data from Extractor

func (*SpanContext) DecodeSW8 added in v0.4.0

func (tc *SpanContext) DecodeSW8(header string) error

DecodeSW6 converts string header to SpanContext

func (*SpanContext) DecodeSW8Correlation added in v1.0.0

func (tc *SpanContext) DecodeSW8Correlation(header string) error

DecodeSW8Correlation converts correlation string header to SpanContext

func (*SpanContext) Encode added in v1.0.0

func (tc *SpanContext) Encode(injector Injector) error

Encode all SpanContext data to Injector

func (*SpanContext) EncodeSW8 added in v0.4.0

func (tc *SpanContext) EncodeSW8() string

EncodeSW6 converts SpanContext to string header

func (*SpanContext) EncodeSW8Correlation added in v1.0.0

func (tc *SpanContext) EncodeSW8Correlation() string

EncodeSW8Correlation converts correlation to string header

Jump to

Keyboard shortcuts

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