Versions in this module Expand all Collapse all v1 v1.7.2 Mar 14, 2020 Changes in this version + const AgentVersion + func ContextWithSpan(parent context.Context, s *Span) context.Context + func ContextWithTransaction(parent context.Context, t *Transaction) context.Context + func DetachedContext(ctx context.Context) context.Context + func RegisterErrorDetailer(e ErrorDetailer) + func RegisterTypeErrorDetailer(t reflect.Type, e ErrorDetailer) + func TraceFormatter(ctx context.Context) fmt.Formatter + type BodyCapturer struct + func (bc *BodyCapturer) Discard() + type CaptureBodyMode int + const CaptureBodyAll + const CaptureBodyErrors + const CaptureBodyOff + const CaptureBodyTransactions + type Context struct + func (c *Context) SetCustom(key string, value interface{}) + func (c *Context) SetFramework(name, version string) + func (c *Context) SetHTTPRequest(req *http.Request) + func (c *Context) SetHTTPRequestBody(bc *BodyCapturer) + func (c *Context) SetHTTPResponseHeaders(h http.Header) + func (c *Context) SetHTTPStatusCode(statusCode int) + func (c *Context) SetLabel(key string, value interface{}) + func (c *Context) SetTag(key, value string) + func (c *Context) SetUserEmail(email string) + func (c *Context) SetUserID(id string) + func (c *Context) SetUsername(username string) + type DatabaseSpanContext struct + Instance string + Statement string + Type string + User string + type DestinationServiceSpanContext struct + Name string + Resource string + type Error struct + func CaptureError(ctx context.Context, err error) *Error + func (e *Error) Cause() error + func (e *Error) Error() string + func (e *Error) Send() + func (e *Error) SetSpan(s *Span) + func (e *Error) SetStacktrace(skip int) + func (e *Error) SetTransaction(tx *Transaction) + type ErrorData struct + Context Context + Culprit string + Handled bool + ID ErrorID + ParentID SpanID + Timestamp time.Time + TraceID TraceID + TransactionID SpanID + type ErrorDetailer interface + ErrorDetails func(err error, details *ErrorDetails) + type ErrorDetailerFunc func(error, *ErrorDetails) + func (f ErrorDetailerFunc) ErrorDetails(err error, details *ErrorDetails) + type ErrorDetails struct + Cause []error + Code struct{ ... } + Type struct{ ... } + func (d *ErrorDetails) SetAttr(k string, v interface{}) + type ErrorID TraceID + func (id ErrorID) String() string + type ErrorLogRecord struct + Error error + Level string + LoggerName string + Message string + MessageFormat string + type GatherMetricsFunc func(context.Context, *Metrics) error + func (f GatherMetricsFunc) GatherMetrics(ctx context.Context, m *Metrics) error + type Logger interface + Debugf func(format string, args ...interface{}) + Errorf func(format string, args ...interface{}) + type MetricLabel struct + Name string + Value string + type Metrics struct + func (m *Metrics) Add(name string, labels []MetricLabel, value float64) + type MetricsGatherer interface + GatherMetrics func(ctx context.Context, m *Metrics) error + type Sampler interface + Sample func(TraceContext) bool + func NewRatioSampler(r float64) Sampler + type Span struct + func SpanFromContext(ctx context.Context) *Span + func StartSpan(ctx context.Context, name, spanType string) (*Span, context.Context) + func StartSpanOptions(ctx context.Context, name, spanType string, opts SpanOptions) (*Span, context.Context) + func (s *Span) Dropped() bool + func (s *Span) End() + func (s *Span) SetStacktrace(skip int) + func (s *Span) TraceContext() TraceContext + type SpanContext struct + func (c *SpanContext) SetDatabase(db DatabaseSpanContext) + func (c *SpanContext) SetDatabaseRowsAffected(n int64) + func (c *SpanContext) SetDestinationAddress(addr string, port int) + func (c *SpanContext) SetDestinationService(service DestinationServiceSpanContext) + func (c *SpanContext) SetHTTPRequest(req *http.Request) + func (c *SpanContext) SetHTTPStatusCode(statusCode int) + func (c *SpanContext) SetLabel(key string, value interface{}) + func (c *SpanContext) SetTag(key, value string) + type SpanData struct + Action string + Context SpanContext + Duration time.Duration + Name string + Subtype string + Type string + type SpanID [8]byte + func (id SpanID) MarshalText() ([]byte, error) + func (id SpanID) String() string + func (id SpanID) Validate() error + type SpanOptions struct + Parent TraceContext + SpanID SpanID + Start time.Time + type TraceContext struct + Options TraceOptions + Span SpanID + State TraceState + Trace TraceID + type TraceID [16]byte + func (id TraceID) MarshalText() ([]byte, error) + func (id TraceID) String() string + func (id TraceID) Validate() error + type TraceOptions uint8 + func (o TraceOptions) Recorded() bool + func (o TraceOptions) WithRecorded(recorded bool) TraceOptions + type TraceState struct + func NewTraceState(entries ...TraceStateEntry) TraceState + func (s TraceState) String() string + func (s TraceState) Validate() error + type TraceStateEntry struct + Key string + Value string + func (e *TraceStateEntry) Validate() error + type Tracer struct + Service struct{ ... } + Transport transport.Transport + var DefaultTracer *Tracer + func NewTracer(serviceName, serviceVersion string) (*Tracer, error) + func NewTracerOptions(opts TracerOptions) (*Tracer, error) + func (t *Tracer) Active() bool + func (t *Tracer) CaptureHTTPRequestBody(req *http.Request) *BodyCapturer + func (t *Tracer) Close() + func (t *Tracer) Flush(abort <-chan struct{}) + func (t *Tracer) NewError(err error) *Error + func (t *Tracer) NewErrorLog(r ErrorLogRecord) *Error + func (t *Tracer) Recovered(v interface{}) *Error + func (t *Tracer) RegisterMetricsGatherer(g MetricsGatherer) func() + func (t *Tracer) SendMetrics(abort <-chan struct{}) + func (t *Tracer) SetCaptureBody(mode CaptureBodyMode) + func (t *Tracer) SetCaptureHeaders(capture bool) + func (t *Tracer) SetConfigWatcher(w apmconfig.Watcher) + func (t *Tracer) SetContextSetter(setter stacktrace.ContextSetter) + func (t *Tracer) SetLogger(logger Logger) + func (t *Tracer) SetMaxSpans(n int) + func (t *Tracer) SetMetricsInterval(d time.Duration) + func (t *Tracer) SetRequestDuration(d time.Duration) + func (t *Tracer) SetSampler(s Sampler) + func (t *Tracer) SetSanitizedFieldNames(patterns ...string) error + func (t *Tracer) SetSpanFramesMinDuration(d time.Duration) + func (t *Tracer) SetStackTraceLimit(limit int) + func (t *Tracer) StartSpan(name, spanType string, transactionID SpanID, opts SpanOptions) *Span + func (t *Tracer) StartTransaction(name, transactionType string) *Transaction + func (t *Tracer) StartTransactionOptions(name, transactionType string, opts TransactionOptions) *Transaction + func (t *Tracer) Stats() TracerStats + type TracerOptions struct + ServiceEnvironment string + ServiceName string + ServiceVersion string + Transport transport.Transport + type TracerStats struct + Errors TracerStatsErrors + ErrorsDropped uint64 + ErrorsSent uint64 + SpansDropped uint64 + SpansSent uint64 + TransactionsDropped uint64 + TransactionsSent uint64 + type TracerStatsErrors struct + SendStream uint64 + SetContext uint64 + type Transaction struct + func TransactionFromContext(ctx context.Context) *Transaction + func (tx *Transaction) Discard() + func (tx *Transaction) End() + func (tx *Transaction) EnsureParent() SpanID + func (tx *Transaction) Sampled() bool + func (tx *Transaction) ShouldPropagateLegacyHeader() bool + func (tx *Transaction) StartSpan(name, spanType string, parent *Span) *Span + func (tx *Transaction) StartSpanOptions(name, spanType string, opts SpanOptions) *Span + func (tx *Transaction) TraceContext() TraceContext + type TransactionData struct + Context Context + Duration time.Duration + Name string + Result string + Type string + type TransactionOptions struct + Start time.Time + TraceContext TraceContext + TransactionID SpanID + type WarningLogger interface + Warningf func(format string, args ...interface{})