tracing

package
v0.0.0-...-3eb76e5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoInSpan

func DoInSpan(ctx context.Context, spanName string, f func(context.Context, Span), opts ...SpanOption)

Types

type OTLPOption

type OTLPOption = otlpgrpc.Option

func WithOTLPDialOption

func WithOTLPDialOption(opts ...grpc.DialOption) OTLPOption

WithOTLPDialOption opens support to any grpc.DialOption to be used. If it conflicts with some other configuration the GRPC specified via the collector the ones here will take preference since they are set last.

func WithOTLPEndpoint

func WithOTLPEndpoint(endpoint string) OTLPOption

WithOTLPEndpoint allows one to set the endpoint that the exporter will connect to the collector on. If unset, it will instead try to use connect to DefaultCollectorHost:DefaultCollectorPort.

func WithOTLPHeaders

func WithOTLPHeaders(headers map[string]string) OTLPOption

WithOTLPHeaders will send the provided headers with gRPC requests

func WithOTLPInsecure

func WithOTLPInsecure() OTLPOption

WithOTLPInsecure disables client transport security for the exporter's gRPC connection just like grpc.WithInsecure() https://pkg.go.dev/google.golang.org/grpc#WithInsecure does. Note, by default, client security is required unless WithInsecure is used.

func WithOTLPTLSCredentials

func WithOTLPTLSCredentials(creds credentials.TransportCredentials) OTLPOption

WithOTLPTLSCredentials allows the connection to use TLS credentials when talking to the server. It takes in grpc.TransportCredentials instead of say a Certificate file or a tls.Certificate, because the retrieving these credentials can be done in many ways e.g. plain file, in code tls.Config or by certificate rotation, so it is up to the caller to decide what to use.

type Option

type Option func(*options)

Option sets the value of an option for a Config.

func WithOTLP

func WithOTLP(opts ...OTLPOption) Option

WithOTLP sets the gRPC OTLP exporter for spans.

func WithPrinter

func WithPrinter(w io.Writer) Option

WithPrinter sets the printing exporter for spans.

func WithSampler

func WithSampler(s Sampler) Option

WithSampler sets sampler.

func WithStartedSpanExporter

func WithStartedSpanExporter(e SpanExporter) Option

WithStartedSpanExporter sets the exporter for spans. Use WithOTLP or WithPrettyPrinter for simpler options.

func WithSvcName

func WithSvcName(s string) Option

WithSvcName sets service name. Usually it comes in format of service:app.

type Provider

func NewProvider

func NewProvider(opts ...Option) (*Provider, func() error, error)

type Sampler

type Sampler = sdktrace.Sampler

func TraceIDRatioBasedSampler

func TraceIDRatioBasedSampler(fraction float64) Sampler

TraceIDRatioBasedSampler 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.

type Span

type Span = trace.Span

func Start

func Start(ctx context.Context, spanName string, opts ...SpanOption) (context.Context, Span)

type SpanExporter

type SpanExporter = etrace.SpanExporter

type SpanOption

type SpanOption = trace.SpanOption

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL