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
- func (s Span) Attributes() map[string]string
- func (s Span) End()
- func (s Span) IsEmpty() bool
- func (s Span) Log(severity string, msg string, args ...any)
- func (s Span) SetBool(k string, v bool)
- func (s Span) SetClientIP(ip string)
- func (s Span) SetError(err error)
- func (s Span) SetFloat(k string, v float64)
- func (s Span) SetInt(k string, v int)
- func (s Span) SetOK(statusCode int)
- func (s Span) SetRequest(r *http.Request)
- func (s Span) SetString(k string, v string)
- func (s Span) SetStrings(k string, v []string)
- func (s Span) Status() int
- func (s Span) 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 struct {
// contains filtered or unexported fields
}
Span implements the span interface.
func (Span) Attributes ¶ added in v1.3.0
Attributes returns the attributes set on the span.
func (Span) End ¶
func (s Span) End()
End completes the span. Updates to the span are not allowed after this method has been called.
func (Span) SetClientIP ¶
SetClientIP tags the span during its creation with the IP address and port number of the client.
func (Span) SetOK ¶
SetOK sets the status of the span to OK, with the indicated response status code.
func (Span) SetRequest ¶
SetRequest tags the span with the request data. Warning: this has a large memory footprint.
func (Span) SetStrings ¶
SetStrings tags the span during its creation.