Documentation
¶
Index ¶
- func CheckSetDefaultTextMapPropagator()
- func GetBaggageMap(ctx context.Context) *gmap.StrAnyMap
- func GetBaggageVar(ctx context.Context, key string) *gvar.Var
- func GetDefaultTextMapPropagator() propagation.TextMapPropagator
- func GetSpanID(ctx context.Context) string
- func GetTraceID(ctx context.Context) string
- func MaxContentLogSize() int
- func SetBaggageMap(ctx context.Context, data map[string]interface{}) context.Context
- func SetBaggageValue(ctx context.Context, key string, value interface{}) context.Context
- func WithTraceID(ctx context.Context, traceID string) (context.Context, error)
- type Baggage
- type Carrier
- type Option
- type Span
- type Tracer
- func (t *Tracer) TraceBatchEnd(ctx context.Context, _ *pgx.Conn, data pgx.TraceBatchEndData)
- func (t *Tracer) TraceBatchQuery(ctx context.Context, conn *pgx.Conn, data pgx.TraceBatchQueryData)
- func (t *Tracer) TraceBatchStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceBatchStartData) context.Context
- func (t *Tracer) TraceConnectEnd(ctx context.Context, data pgx.TraceConnectEndData)
- func (t *Tracer) TraceConnectStart(ctx context.Context, data pgx.TraceConnectStartData) context.Context
- func (t *Tracer) TraceCopyFromEnd(ctx context.Context, _ *pgx.Conn, data pgx.TraceCopyFromEndData)
- func (t *Tracer) TraceCopyFromStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceCopyFromStartData) context.Context
- func (t *Tracer) TracePrepareEnd(ctx context.Context, _ *pgx.Conn, data pgx.TracePrepareEndData)
- func (t *Tracer) TracePrepareStart(ctx context.Context, conn *pgx.Conn, data pgx.TracePrepareStartData) context.Context
- func (t *Tracer) TraceQueryEnd(ctx context.Context, _ *pgx.Conn, data pgx.TraceQueryEndData)
- func (t *Tracer) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckSetDefaultTextMapPropagator ¶
func CheckSetDefaultTextMapPropagator()
CheckSetDefaultTextMapPropagator sets the default TextMapPropagator if it is not set previously.
func GetBaggageMap ¶
GetBaggageMap retrieves and returns the baggage values as map.
func GetBaggageVar ¶
GetBaggageVar retrieves value and returns a *gvar.Var for specified key from baggage.
func GetDefaultTextMapPropagator ¶
func GetDefaultTextMapPropagator() propagation.TextMapPropagator
GetDefaultTextMapPropagator returns the default propagator for context propagation between peers.
func GetSpanID ¶
GetSpanID retrieves and returns SpanId from context. It returns an empty string is tracing feature is not activated.
func GetTraceID ¶
GetTraceID retrieves and returns TraceId from context. It returns an empty string is tracing feature is not activated.
func MaxContentLogSize ¶
func MaxContentLogSize() int
MaxContentLogSize returns the max log size for request and response body, especially for HTTP/RPC request.
func SetBaggageMap ¶
SetBaggageMap is a convenient function for adding map key-value pairs to baggage. Note that it uses attribute.Any to set the key-value pair.
func SetBaggageValue ¶
SetBaggageValue is a convenient function for adding one key-value pair to baggage. Note that it uses attribute.Any to set the key-value pair.
Types ¶
type Baggage ¶
type Baggage struct {
// contains filtered or unexported fields
}
Baggage holds the data through all tracing spans.
func NewBaggage ¶
NewBaggage creates and returns a new Baggage object from given tracing context.
func (*Baggage) GetVar ¶
GetVar retrieves value and returns a *gvar.Var for specified key from baggage.
type Carrier ¶
type Carrier map[string]interface{}
Carrier is the storage medium used by a TextMapPropagator.
func NewCarrier ¶
NewCarrier creates and returns a Carrier.
func (Carrier) MustMarshal ¶
MustMarshal .returns the JSON encoding of c
func (Carrier) UnmarshalJSON ¶
UnmarshalJSON implements interface UnmarshalJSON for package json.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option specifies instrumentation configuration options.
func WithAttributes ¶
WithAttributes specifies additional attributes to be added to the span.
func WithDisableSQLStatementInBaggage ¶
func WithDisableSQLStatementInBaggage() Option
WithDisableSQLStatementInBaggage will disable logging the SQL statement in the span's baggage.
func WithTracerProvider ¶
func WithTracerProvider(provider trace.TracerProvider) Option
WithTracerProvider specifies a tracer provider to use for creating a tracer. If none is specified, the global provider is used.
func WithTrimSQLInSpanName ¶
func WithTrimSQLInSpanName() Option
WithTrimSQLInSpanName will use the SQL statement's first word as the span name. By default, the whole SQL statement is used as a span name, where applicable.
type Tracer ¶
Tracer warps trace.Tracer for compatibility and extension.
func (*Tracer) TraceBatchEnd ¶
TraceBatchEnd is called at the end of SendBatch calls.
func (*Tracer) TraceBatchQuery ¶
TraceBatchQuery is called at the after each query in a batch.
func (*Tracer) TraceBatchStart ¶
func (t *Tracer) TraceBatchStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceBatchStartData) context.Context
TraceBatchStart is called at the beginning of SendBatch calls. The returned context is used for the rest of the call and will be passed to TraceBatchQuery and TraceBatchEnd.
func (*Tracer) TraceConnectEnd ¶
TraceConnectEnd is called at the end of Connect and ConnectConfig calls.
func (*Tracer) TraceConnectStart ¶
func (t *Tracer) TraceConnectStart(ctx context.Context, data pgx.TraceConnectStartData) context.Context
TraceConnectStart is called at the beginning of Connect and ConnectConfig calls. The returned context is used for the rest of the call and will be passed to TraceConnectEnd.
func (*Tracer) TraceCopyFromEnd ¶
TraceCopyFromEnd is called at the end of CopyFrom calls.
func (*Tracer) TraceCopyFromStart ¶
func (t *Tracer) TraceCopyFromStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceCopyFromStartData) context.Context
TraceCopyFromStart is called at the beginning of CopyFrom calls. The returned context is used for the rest of the call and will be passed to TraceCopyFromEnd.
func (*Tracer) TracePrepareEnd ¶
TracePrepareEnd is called at the end of Prepare calls.
func (*Tracer) TracePrepareStart ¶
func (t *Tracer) TracePrepareStart(ctx context.Context, conn *pgx.Conn, data pgx.TracePrepareStartData) context.Context
TracePrepareStart is called at the beginning of Prepare calls. The returned context is used for the rest of the call and will be passed to TracePrepareEnd.
func (*Tracer) TraceQueryEnd ¶
TraceQueryEnd is called at the end of Query, QueryRow, and Exec calls.
func (*Tracer) TraceQueryStart ¶
func (t *Tracer) TraceQueryStart(ctx context.Context, conn *pgx.Conn, data pgx.TraceQueryStartData) context.Context
TraceQueryStart is called at the beginning of Query, QueryRow, and Exec calls. The returned context is used for the rest of the call and will be passed to TraceQueryEnd.