Versions in this module Expand all Collapse all v1 v1.3.1 Dec 13, 2021 v1.3.0 Dec 13, 2021 Changes in this version + const OTLP + const SpanKindClient + const SpanKindConsumer + const SpanKindInternal + const SpanKindProducer + const SpanKindServer + const SpanKindUnspecified + var ErrOtlpEndpointEmpty = errors.New("otlp endpoint could not be empty") + var ErrServerNameEmpty = errors.New("server name could not be empty") + var ErrUnknownExporter = errors.New("unknown exporterEnum type") + func MustSetup(opts ...SetupOption) func() + func SetPropagator(p TraceContextPropagator) + func Setup(opts ...SetupOption) (shutdown func(), err error) + func SetupDefault() (shutdown func(), err error) + type Code = codes.Code + const Error + const OK + const Unset + type SetupOption interface + func WithEnv(env string) SetupOption + func WithHostname(hostname string) SetupOption + func WithNamespace(namespace string) SetupOption + func WithOtlpExporter(endpoint string) SetupOption + func WithPodIP(podIP string) SetupOption + func WithSampleRate(fraction float64) SetupOption + func WithServerName(name string) SetupOption + func WithServerVersion(version string) SetupOption + type Span interface + End func() + Finish func() + LogFields func(event string, attributes ...attribute.KeyValue) + RecordError func(err error, opts ...SpanEventOption) + SetAttributes func(attributes ...attribute.KeyValue) + SetStatus func(code Code, message string) + SetTag func(key string, value string) + SpanContext func() *TraceContext + func SpanFromContext(ctx context.Context) Span + func StartSpan(ctx context.Context, operation string, opts ...SpanStartOption) (context.Context, Span) + type SpanEventOption interface + func WithStackTrace() SpanEventOption + type SpanStartOption interface + func WithSpanKind(kind spanKind) SpanStartOption + type TraceContext struct + ParentSpanID string + SpanID string + TraceID string + func SpanContextFromContext(ctx context.Context) *TraceContext + func TraceContextFromContext(ctx context.Context) *TraceContext + func (tc *TraceContext) IsRemote() bool + func (tc *TraceContext) IsValid() bool + func (tc *TraceContext) Sampled() bool + type TraceContextCarrier interface + Get func(key string) string + Set func(key, value string) + func NewMapCarrier() TraceContextCarrier + type TraceContextPropagator interface + Extract func(ctx context.Context, carrier TraceContextCarrier) context.Context + Inject func(ctx context.Context, carrier TraceContextCarrier) + func GetPropagator() TraceContextPropagator