Versions in this module Expand all Collapse all v1 v1.0.2 May 10, 2023 Changes in this version + const DefaultBaggageHeaderPrefix + const DefaultParentIDHeader + const DefaultPriorityHeader + const DefaultTraceIDHeader + const SamplingRuleSpan + const SamplingRuleTrace + var ErrInvalidCarrier = errors.New("invalid carrier") + var ErrInvalidSpanContext = errors.New("invalid span context") + var ErrSpanContextCorrupted = errors.New("span context corrupted") + var ErrSpanContextNotFound = errors.New("span context not found") + func ContextWithSpan(ctx context.Context, s Span) context.Context + func Extract(carrier interface{}) (ddtrace.SpanContext, error) + func Flush() + func Inject(ctx ddtrace.SpanContext, carrier interface{}) error + func SetUser(s Span, id string, opts ...UserMonitoringOption) + func Start(opts ...StartOption) + func Stop() + type DBMPropagationMode string + const DBMPropagationModeDisabled + const DBMPropagationModeFull + const DBMPropagationModeService + const DBMPropagationModeUndefined + type FinishOption = ddtrace.FinishOption + func FinishTime(t time.Time) FinishOption + func NoDebugStack() FinishOption + func StackFrames(n, skip uint) FinishOption + func WithError(err error) FinishOption + type HTTPHeadersCarrier http.Header + func (c HTTPHeadersCarrier) ForeachKey(handler func(key, val string) error) error + func (c HTTPHeadersCarrier) Set(key, val string) + type Propagator interface + Extract func(carrier interface{}) (ddtrace.SpanContext, error) + Inject func(context ddtrace.SpanContext, carrier interface{}) error + func NewPropagator(cfg *PropagatorConfig, propagators ...Propagator) Propagator + type PropagatorConfig struct + B3 bool + BaggagePrefix string + MaxTagsHeaderLen int + ParentHeader string + PriorityHeader string + TraceHeader string + type RateSampler interface + Rate func() float64 + SetRate func(rate float64) + func NewAllSampler() RateSampler + func NewRateSampler(rate float64) RateSampler + type SQLCommentCarrier struct + DBServiceName string + Mode DBMPropagationMode + Query string + SpanID uint64 + func (c *SQLCommentCarrier) Extract() (ddtrace.SpanContext, error) + func (c *SQLCommentCarrier) Inject(spanCtx ddtrace.SpanContext) error + type SQLCommentInjectionMode DBMPropagationMode + const SQLInjectionDisabled + const SQLInjectionModeFull + const SQLInjectionModeService + const SQLInjectionUndefined + type Sampler interface + Sample func(span Span) bool + type SamplingRule struct + MaxPerSecond float64 + Name *regexp.Regexp + Rate float64 + Service *regexp.Regexp + func NameRule(name string, rate float64) SamplingRule + func NameServiceRule(name string, service string, rate float64) SamplingRule + func RateRule(rate float64) SamplingRule + func ServiceRule(service string, rate float64) SamplingRule + func SpanNameServiceMPSRule(name, service string, rate, limit float64) SamplingRule + func SpanNameServiceRule(name, service string, rate float64) SamplingRule + func (sr *SamplingRule) MarshalJSON() ([]byte, error) + type SamplingRuleType int + func (sr SamplingRuleType) String() string + type Span = ddtrace.Span + func SpanFromContext(ctx context.Context) (Span, bool) + func StartSpan(operationName string, opts ...StartSpanOption) Span + func StartSpanFromContext(ctx context.Context, operationName string, opts ...StartSpanOption) (Span, context.Context) + type StartOption func(*config) + func WithAgentAddr(addr string) StartOption + func WithAnalytics(on bool) StartOption + func WithAnalyticsRate(rate float64) StartOption + func WithDebugMode(enabled bool) StartOption + func WithDebugStack(enabled bool) StartOption + func WithDogstatsdAddress(addr string) StartOption + func WithEnv(env string) StartOption + func WithFeatureFlags(feats ...string) StartOption + func WithGlobalTag(k string, v interface{}) StartOption + func WithHTTPClient(client *http.Client) StartOption + func WithHTTPRoundTripper(r http.RoundTripper) StartOption + func WithHostname(name string) StartOption + func WithLambdaMode(enabled bool) StartOption + func WithLogStartup(enabled bool) StartOption + func WithLogger(logger ddtrace.Logger) StartOption + func WithPrioritySampling() StartOption + func WithProfilerCodeHotspots(enabled bool) StartOption + func WithProfilerEndpoints(enabled bool) StartOption + func WithPropagator(p Propagator) StartOption + func WithRuntimeMetrics() StartOption + func WithSampler(s Sampler) StartOption + func WithSamplingRules(rules []SamplingRule) StartOption + func WithSendRetries(retries int) StartOption + func WithService(name string) StartOption + func WithServiceMapping(from, to string) StartOption + func WithServiceName(name string) StartOption + func WithServiceVersion(version string) StartOption + func WithTraceEnabled(enabled bool) StartOption + func WithUDS(socketPath string) StartOption + func WithUniversalVersion(version string) StartOption + type StartSpanOption = ddtrace.StartSpanOption + func AnalyticsRate(rate float64) StartSpanOption + func ChildOf(ctx ddtrace.SpanContext) StartSpanOption + func Measured() StartSpanOption + func ResourceName(name string) StartSpanOption + func ServiceName(name string) StartSpanOption + func SpanType(name string) StartSpanOption + func StartTime(t time.Time) StartSpanOption + func Tag(k string, v interface{}) StartSpanOption + func WithSpanID(id uint64) StartSpanOption + type TextMapCarrier map[string]string + func (c TextMapCarrier) ForeachKey(handler func(key, val string) error) error + func (c TextMapCarrier) Set(key, val string) + type TextMapReader interface + ForeachKey func(handler func(key, val string) error) error + type TextMapWriter interface + Set func(key, val string) + type UserMonitoringConfig struct + Email string + Name string + PropagateID bool + Role string + Scope string + SessionID string + type UserMonitoringOption func(*UserMonitoringConfig) + func WithPropagation() UserMonitoringOption + func WithUserEmail(email string) UserMonitoringOption + func WithUserName(name string) UserMonitoringOption + func WithUserRole(role string) UserMonitoringOption + func WithUserScope(scope string) UserMonitoringOption + func WithUserSessionID(sessionID string) UserMonitoringOption