tracex

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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 EndDbSpan

func EndDbSpan(span oteltrace.Span, err error)

func Extract

Extract 函数用于从给定的上下文中提取元数据。

func Inject

func Inject(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD)

Inject 函数用于将元数据注入到给定的上下文中,以便在不同的组件之间传递。

func ParseFullMethod

func ParseFullMethod(fullMethod string) (string, []attribute.KeyValue)

ParseFullMethod 返回method的方法名称 和 []attribute.KeyValue 类型的属性列表

func PeerAttr

func PeerAttr(address string) []attribute.KeyValue

PeerAttr 返回address的 []attribute.KeyValue 属性列表

func PeerFromCtx

func PeerFromCtx(ctx context.Context) string

PeerFromCtx returns the peer from ctx.

func SpanIdFromContext

func SpanIdFromContext(ctx context.Context) string

func SpanInfo

func SpanInfo(fullMethod, peerAddress string) (string, []attribute.KeyValue)

func StartDbSpan

func StartDbSpan(ctx context.Context, method string) (context.Context, oteltrace.Span)

func StatusCodeAttr

func StatusCodeAttr(c codes.Code) attribute.KeyValue

func TraceIdFromContext

func TraceIdFromContext(ctx context.Context) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL