Documentation
¶
Overview ¶
Package twirp provides tracing functions for tracing clients and servers generated by the twirp framework (https://github.com/twitchtv/twirp).
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewServerHooks ¶
func NewServerHooks(opts ...Option) *twirp.ServerHooks
NewServerHooks creates the callback hooks for a twirp server to perform tracing. It is used in conjunction with WrapServer.
Types ¶
type HTTPClient ¶
HTTPClient is duplicated from twirp's generated service code. It is declared in this package so that the client can be wrapped to initiate traces.
func WrapClient ¶
func WrapClient(c HTTPClient, opts ...Option) HTTPClient
WrapClient wraps an HTTPClient to add distributed tracing to its requests.
type Option ¶
type Option func(*config)
Option represents an option that can be passed to Dial.
func WithAnalytics ¶
WithAnalytics enables Trace Analytics for all started spans.
func WithAnalyticsRate ¶
WithAnalyticsRate sets the sampling rate for Trace Analytics events correlated to started spans.
func WithServiceName ¶
WithServiceName sets the given service name for the dialled connection. When the service name is not explicitly set, it will be inferred based on the request to the twirp service.