Documentation ¶
Index ¶
Constants ¶
const ( // RoleS1 is the name of the role for server S1 RoleS1 = "S1" // RoleS2 is the name of the role for server S2 RoleS2 = "S2" // RoleS3 is the name of the role for server S3 RoleS3 = "S3" // BaggageKey is the key used to pass baggage item BaggageKey = "crossdock-baggage-key" )
const (
BehaviorName = "trace"
)
Different parameter keys and values used by the system
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Behavior ¶
type Behavior struct { ServerPort string Tracer opentracing.Tracer ServiceToHost func(string) string // contains filtered or unexported fields }
Behavior is an implementation of "trace behavior", that verifies that a tracing context and baggage are properly propagated through two level of servers.
type Downstream ¶
type Downstream struct { ServiceName string `json:"serviceName"` ServerRole string `json:"serverRole"` Encoding string `json:"encoding"` HostPort string `json:"hostPort"` Downstream *Downstream `json:"downstream,omitempty"` }
Downstream describes which downstream service to call recursively.
type DownstreamCall ¶
type DownstreamCall func(ctx context.Context, target *Downstream) (*Response, error)
DownstreamCall is an encoding-agnostic abstraction of calling a downstream service.
type ObservedSpan ¶
type ObservedSpan struct { TraceID string `json:"traceId"` Sampled bool `json:"sampled"` Baggage string `json:"baggage"` }
ObservedSpan describes the tracing span observed by the server
type Request ¶
type Request struct { ServerRole string `json:"serverRole"` Downstream *Downstream `json:"downstream,omitempty"` }
Request instructs the server to call another server recursively if Downstream != nil, and return the results of the downstream call as well as the current tracing span it observes in its Context.
type Response ¶
type Response struct { Span *ObservedSpan `json:"span,omitempty"` Downstream *Response `json:"downstream,omitempty"` }
Response contains the span observed by the server and nested downstream response.