Documentation ¶
Index ¶
- Constants
- Variables
- func EndDbSpan(span oteltrace.Span, err error)
- func Extract(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD) (baggage.Baggage, sdktrace.SpanContext)
- func Inject(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD)
- func ParseFullMethod(fullMethod string) (string, []attribute.KeyValue)
- func PeerAttr(address string) []attribute.KeyValue
- func PeerFromCtx(ctx context.Context) string
- func SpanIdFromContext(ctx context.Context) string
- func SpanInfo(fullMethod, peerAddress string) (string, []attribute.KeyValue)
- func StartDbSpan(ctx context.Context, method string) (context.Context, oteltrace.Span)
- func StatusCodeAttr(c codes.Code) attribute.KeyValue
- func TraceIdFromContext(ctx context.Context) string
Constants ¶
View Source
const ( GRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") RPCNameKey = attribute.Key("rpc.name") RPCMessageTypeKey = attribute.Key("message.type") RPCMessageIDKey = attribute.Key("message.id") RPCMessageCompressedSizeKey = attribute.Key("message.compressed_size") RpcMessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") SqlMethodKey = attribute.Key("sql.method") )
View Source
const TraceName = "gofks-trace"
Variables ¶
View Source
var ( MessageSent = messageType(RPCMessageTypeSent) MessageReceived = messageType(RPCMessageTypeReceived) )
View Source
var ( // RPCSystemGRPC 表示远程系统是 grpc,表明了 rpc系统使用 grpc的属性。 RPCSystemGRPC = semconv.RPCSystemKey.String("grpc") // RPCNameMessage 用来注明RPC调用中涉及的消息或者操作的名称。 RPCNameMessage = RPCNameKey.String("message") // RPCMessageTypeSent 用来表示已经发送的RPC消息类型。表示消息已经发出。 RPCMessageTypeSent = RPCMessageTypeKey.String("SENT") // RPCMessageTypeReceived 用来表示已经接收的RPC消息类型,表示消息已被接收。 RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED") )
Functions ¶
func Extract ¶
func Extract(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD) ( baggage.Baggage, sdktrace.SpanContext)
Extract 函数用于从给定的上下文中提取元数据。
func Inject ¶
func Inject(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD)
Inject 函数用于将元数据注入到给定的上下文中,以便在不同的组件之间传递。
func ParseFullMethod ¶
ParseFullMethod 返回method的方法名称 和 []attribute.KeyValue 类型的属性列表
func PeerFromCtx ¶
PeerFromCtx returns the peer from ctx.
func SpanIdFromContext ¶
func StartDbSpan ¶
func TraceIdFromContext ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.