Documentation ¶
Index ¶
- Constants
- func SetProvider(opts ...Option)
- type Annotation
- type ClientHandler
- func (c *ClientHandler) HandleConn(ctx context.Context, cs stats.ConnStats)
- func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)
- func (c *ClientHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context
- func (c *ClientHandler) TagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context
- type Endpoint
- type Exporter
- type Option
- type Span
- type Tracer
Constants ¶
const ( TraceID = "x-b3-traceid" SpanID = "x-b3-spanid" ParentSpanID = "x-b3-parentspanid" Sampled = "x-b3-sampled" Flags = "x-b3-flags" Context = "b3" )
Default B3 Header keys
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Annotation ¶
Annotation associates an event that explains latency with a timestamp.
type ClientHandler ¶
type ClientHandler struct { }
func (*ClientHandler) HandleConn ¶
func (c *ClientHandler) HandleConn(ctx context.Context, cs stats.ConnStats)
HandleConn exists to satisfy gRPC stats.Handler.
func (*ClientHandler) HandleRPC ¶
func (c *ClientHandler) HandleRPC(ctx context.Context, rs stats.RPCStats)
HandleRPC implements per-RPC tracing and stats instrumentation.
func (*ClientHandler) TagConn ¶
func (c *ClientHandler) TagConn(ctx context.Context, cti *stats.ConnTagInfo) context.Context
TagConn exists to satisfy gRPC stats.Handler.
func (*ClientHandler) TagRPC ¶
func (c *ClientHandler) TagRPC(ctx context.Context, rti *stats.RPCTagInfo) context.Context
TagRPC implements per-RPC context management.
type Endpoint ¶
type Endpoint struct { ServiceName string `json:"serviceName,omitempty"` IPv4 string `json:"ipv4,omitempty"` IPv6 string `json:"ipv6,omitempty"` Port uint16 `json:"port,omitempty"` }
Endpoint holds the network context of a node in the service graph.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
func (*Exporter) ExportSpans ¶
type Option ¶
type Option func(*options)
Option is tracing option.
func WithResource ¶
WithResource with tracer resource.
func WithSampleRatio ¶
WithSampleRatio samples a given fraction of traces. Fractions >= 1 will always sample. Fractions < 0 are treated as zero. To respect the parent trace's `SampledFlag`, the `TraceIDRatioBased` sampler should be used as a delegate of a `Parent` sampler.
func WithTracerExporter ¶
func WithTracerExporter(exporter tracesdk.SpanExporter) Option
WithTracerExporter with tracer exporter.
type Span ¶
type Span struct { TraceID string `json:"traceId"` ID string `json:"id"` ParentID string `json:"parentId,omitempty"` Debug bool `json:"debug,omitempty"` Kind string `json:"kind,omitempty"` Name string `json:"name,omitempty"` Timestamp int64 `json:"timestamp,omitempty"` Duration int64 `json:"duration,omitempty"` LocalEndpoint *Endpoint `json:"localEndpoint,omitempty"` RemoteEndpoint *Endpoint `json:"remoteEndpoint,omitempty"` Annotations []Annotation `json:"annotations,omitempty"` Tags map[string]string `json:"tags,omitempty"` }
Span is zipkin span model