Documentation
¶
Overview ¶
Package trc is used for working with tracing spans. It contains the options to use in Connector.StartSpan
Index ¶
- type Option
- func Bool(k string, v bool) Option
- func Client() Option
- func ClientIP(ip string) Option
- func Consumer() Option
- func Float(k string, v float64) Option
- func Int(k string, v int) Option
- func Internal() Option
- func Producer() Option
- func Request(r *http.Request) Option
- func Server() Option
- func String(k string, v string) Option
- func Strings(k string, v []string) Option
- type Span
- type SpanImpl
- func (s SpanImpl) End()
- func (s SpanImpl) IsEmpty() bool
- func (s SpanImpl) Log(severity string, msg string, fields ...log.Field)
- func (s SpanImpl) SetBool(k string, v bool)
- func (s SpanImpl) SetClientIP(ip string)
- func (s SpanImpl) SetError(err error)
- func (s SpanImpl) SetFloat(k string, v float64)
- func (s SpanImpl) SetInt(k string, v int)
- func (s SpanImpl) SetOK(statusCode int)
- func (s SpanImpl) SetRequest(r *http.Request)
- func (s SpanImpl) SetString(k string, v string)
- func (s SpanImpl) SetStrings(k string, v []string)
- func (s SpanImpl) TraceID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option trace.SpanStartOption
Option is an alias for trace.SpanStartOption which are options used to create tracing spans.
func Client ¶
func Client() Option
Client indicates that the span represents the operation of client making a request to a server.
func ClientIP ¶
ClientIP tags the span during its creation with the IP address and port number of the client.
func Consumer ¶
func Consumer() Option
Consumer represents the operation of a consumer receiving a message from a message broker.
func Internal ¶
func Internal() Option
Internal indicates that the span represents an internal operation within an application.
func Producer ¶
func Producer() Option
Producer represents the operation of a producer sending a message to a message broker.
type Span ¶
type Span interface {
// End completes the span.
// Updates to the span are not allowed after this method has been called.
End()
// SetError sets the status of the span to error.
SetError(err error)
// SetOK sets the status of the span to OK, with the indicated response status code.
SetOK(statusCode int)
// Log records a log event on the span.
Log(severity string, message string, fields ...log.Field)
// SetString tags the span during its creation.
SetString(k string, v string)
// SetStrings tags the span during its creation.
SetStrings(k string, v []string)
// SetBool tags the span during its creation.
SetBool(k string, v bool)
// SetInt tags the span during its creation.
SetInt(k string, v int)
// SetFloat tags the span during its creation.
SetFloat(k string, v float64)
// SetRequest tags the span with the request data.
// Warning: this has a large memory footprint.
SetRequest(r *http.Request)
// SetClientIP tags the span during its creation with the IP address and port number of the client.
SetClientIP(ip string)
// IsEmpty indicates if the span is not initialized.
IsEmpty() bool
// TraceID is an identifier that groups related spans together.
TraceID() string
}
Span represents an operation that is being traced.
type SpanImpl ¶
SpanImpl implements the span interface.
func (SpanImpl) End ¶
func (s SpanImpl) End()
End completes the span. Updates to the span are not allowed after this method has been called.
func (SpanImpl) SetClientIP ¶
SetClientIP tags the span during its creation with the IP address and port number of the client.
func (SpanImpl) SetOK ¶
SetOK sets the status of the span to OK, with the indicated response status code.
func (SpanImpl) SetRequest ¶
SetRequest tags the span with the request data. Warning: this has a large memory footprint.
func (SpanImpl) SetStrings ¶
SetStrings tags the span during its creation.