Documentation
¶
Index ¶
- func AddEvent(span trace.Span, name string, attrs ...attribute.KeyValue)
- func ContextWithSpan(ctx context.Context, span trace.Span) context.Context
- func DatabaseSpan(ctx context.Context, operation, table string) (context.Context, trace.Span)
- func GRPCSpan(ctx context.Context, service, method string) (context.Context, trace.Span)
- func HTTPClientSpan(ctx context.Context, method, url string) (context.Context, trace.Span)
- func RecordError(span trace.Span, err error)
- func RedisSpan(ctx context.Context, command string) (context.Context, trace.Span)
- func SetAttributes(span trace.Span, attrs ...attribute.KeyValue)
- func SetStatus(span trace.Span, code codes.Code, description string)
- func SpanFromContext(ctx context.Context) trace.Span
- func SpanID(ctx context.Context) string
- func StartSpan(ctx context.Context, spanName string) (context.Context, trace.Span)
- func TraceID(ctx context.Context) string
- type Config
- type Middleware
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContextWithSpan ¶
ContextWithSpan 创建带 span 的 context
func DatabaseSpan ¶
DatabaseSpan 数据库操作追踪
func HTTPClientSpan ¶
HTTPClientSpan HTTP 客户端请求追踪
func SetAttributes ¶
SetAttributes 设置属性到 span
func SpanFromContext ¶
SpanFromContext 从 context 获取 span
Types ¶
type Config ¶
type Config struct {
ServiceName string
ServiceVersion string
Environment string
JaegerEndpoint string
SamplingRate float64
}
Config 追踪配置
type Middleware ¶
type Middleware struct {
// contains filtered or unexported fields
}
Middleware 追踪中间件
func (*Middleware) Handler ¶
func (m *Middleware) Handler(next http.HandlerFunc) http.HandlerFunc
Handler HTTP 追踪中间件处理器
Click to show internal directories.
Click to hide internal directories.