Documentation
¶
Overview ¶
Package trace contains support for OpenCensus distributed tracing.
Index ¶
Constants ¶
View Source
const ( // JaegerTracingProviderName is the name of the tracing provider Jaeger. JaegerTracingProviderName = "jaeger" // ZipkinTracingProviderName is the name of the tracing provider Zipkin. ZipkinTracingProviderName = "zipkin" )
Variables ¶
This section is empty.
Functions ¶
func RegisterTracing ¶
func RegisterTracing(opts *TracingOptions) (trace.Exporter, error)
RegisterTracing creates a new trace exporter from TracingOptions.
func StartSpan ¶
func StartSpan(ctx context.Context, name string, o ...trace.StartOption) (context.Context, *trace.Span)
StartSpan starts a new child span of the current span in the context. If there is no span in the context, creates a new trace and span.
Returned context contains the newly created span. You can use it to propagate the returned span in process.
func UnregisterTracing ¶ added in v0.9.0
UnregisterTracing unregisters a trace exporter.
Types ¶
type TracingOptions ¶
type TracingOptions struct { // Shared Provider string Service string Debug bool // CollectorEndpoint is the full url to the Jaeger HTTP Thrift collector. // For example, http://localhost:14268/api/traces JaegerCollectorEndpoint *url.URL // AgentEndpoint instructs exporter to send spans to jaeger-agent at this address. // For example, localhost:6831. JaegerAgentEndpoint string // ZipkinEndpoint configures the zipkin collector URI // Example: http://zipkin:9411/api/v2/spans ZipkinEndpoint *url.URL // SampleRate is percentage of requests which are sampled SampleRate float64 }
TracingOptions contains the configurations settings for a http server.
func (*TracingOptions) Enabled ¶ added in v0.11.0
func (t *TracingOptions) Enabled() bool
Enabled indicates whether tracing is enabled on a given TracingOptions
Click to show internal directories.
Click to hide internal directories.