Documentation
¶
Index ¶
- func GetContextWithTraceId(ctx context.Context, traceId string) context.Context
- func GetTraceId(ctx context.Context) (string, error)
- type Instrumentor
- type NoopSpan
- func (n *NoopSpan) Context() context.Context
- func (n *NoopSpan) Finish()
- func (n *NoopSpan) GetDurationMs() int64
- func (n *NoopSpan) GetOperation() string
- func (n *NoopSpan) GetTraceId() string
- func (n *NoopSpan) GetTxName() string
- func (n *NoopSpan) SetTransactionName(txName string)
- func (n *NoopSpan) StartSpan(ctx context.Context)
- type Span
- type SpanRecorder
- type TraceIdContextKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextWithTraceId ¶
GetContextWithTraceId Returns a child context with "trace_id" set to the given traceId
Types ¶
type Instrumentor ¶
type Instrumentor interface {
StartSpan(ctx context.Context, operation string) Span
NewTransaction(ctx context.Context, txName string, operation string) Span
Finish(span Span)
}
func NewInstrumentor ¶
func NewInstrumentor() Instrumentor
type NoopSpan ¶
type NoopSpan struct {
Operation string
TxName string
Started bool
Finished bool
StartTime int64
FinishTime int64
// contains filtered or unexported fields
}
func NewNoopSpan ¶
func (*NoopSpan) GetDurationMs ¶
func (*NoopSpan) GetOperation ¶
func (*NoopSpan) GetTraceId ¶
func (*NoopSpan) SetTransactionName ¶
type SpanRecorder ¶
type TraceIdContextKey ¶
type TraceIdContextKey string
Click to show internal directories.
Click to hide internal directories.