Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MuxHTTPMiddleware ¶
func MuxHTTPMiddleware(service string) mux.MiddlewareFunc
MuxHTTPMiddleware sets up a handler to start tracing the incoming requests. The service parameter should describe the name of the (virtual) server handling the request.
func SetTraceInRequest ¶
SetTraceInRequest will put the trace in @r headers
func SetTraceInResponse ¶
func SetTraceInResponse(ctx context.Context, r http.ResponseWriter)
SetTraceInResponse will put the trace in @r headers
func Setup ¶
func Setup(c Config) app.ShutdownFunc
Setup use Config to setup an trace exporter and returns a shutdown handler
Types ¶
type Config ¶
type Config struct { Exporter string `default:""` ProbabilitySample float64 `default:"0"` Stackdriver StackdriverConfig OTLP OTLPConfig }
Config represents all trace's configuration
type OTLPConfig ¶ added in v0.5.0
type OTLPConfig struct { // Endpoint allows one to set the address of the collector // endpoint that the driver will use to send spans. // It is a string in the form <host>:<port>. // If unset, it will instead try to use the default endpoint // from package otlptracehttp (at the time of this writing // the default is localhost:4318). // Note that the endpoint must not contain any URL path. Endpoint string // Compression tells the driver to compress the sent data. // Possible values are: // - "" (empty string) or "none": No compression // - "gzip": GZIP compression. Compression string // Insecure tells the driver to connect to the collector using the // HTTP scheme, instead of HTTPS. Insecure bool }
OTLPConfig allows for configuring the OpenTelemery Protocol.
func (*OTLPConfig) Options ¶ added in v0.5.0
func (c *OTLPConfig) Options() []otlptracehttp.Option
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
Span is the individual component of a trace. It represents a single named and timed operation of a workflow that is traced
type StackdriverConfig ¶ added in v0.5.0
type StackdriverConfig struct {
ProjectID string
}
StackdriverConfig contains all the configuration of the Starkdriver exporter.
type TraceInfo ¶
TraceInfo carries the trace informations
func GetTraceInfoFromContext ¶
GetTraceInfoFromContext returns a TraceInfo from the context @ctx or logs if there is no TraceInfo in context
func (TraceInfo) MarshalZerologObject ¶
MarshalZerologObject implements the zerolog marshaler so it can be logged using: log.With().EmbededObject(t).Msg("Some message")