package trace
import "github.com/uber/tchannel-go/crossdock/behavior/trace"
Index ¶
- Constants
- type Behavior
- type Downstream
- type DownstreamCall
- type ObservedSpan
- type Request
- type Response
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
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.
func (*Behavior) Register ¶
func (b *Behavior) Register(ch *tchannel.Channel)
Register function adds JSON and Thrift handlers to the server channel ch
func (*Behavior) Run ¶
func (b *Behavior) Run(t crossdock.T)
Run executes the trace behavior
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.
Source Files ¶
api.go behavior.go constants.go json.go thrift.go
- Version
- v1.34.6 (latest)
- Published
- Jan 8, 2025
- Platform
- linux/amd64
- Imports
- 16 packages
- Last checked
- 1 week ago –
Tools for package owners.