Documentation ¶
Overview ¶
Package trace contains support for OpenCensus distributed tracing.
Index ¶
Constants ¶
View Source
const ( // DatadogTracingProviderName is the name of the tracing provider Datadog. DatadogTracingProviderName = "datadog" // 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 StartSpan ¶
func StartSpan(ctx context.Context, name string, o ...octrace.StartOption) (context.Context, *octrace.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.
Types ¶
type Provider ¶ added in v0.15.0
type Provider interface { Register(options *TracingOptions) error Unregister() error }
Provider is a trace provider.
func GetProvider ¶ added in v0.15.0
func GetProvider(opts *TracingOptions) (Provider, error)
GetProvider creates a new trace provider from TracingOptions.
type TracingOptions ¶
type TracingOptions struct { // Shared Provider string Service string Debug bool // Datadog DatadogAddress string // 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.