Documentation ¶
Index ¶
- Constants
- Variables
- func Extract(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD) (baggage.Baggage, trace.SpanContext)
- func GetTrace() trace.Tracer
- func Inject(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD)
- func ParseFullMethod(fullMethod string) (string, []attribute.KeyValue)
- func PeerAttr(addr string) []attribute.KeyValue
- func PeerFromCtx(ctx context.Context) string
- func SetJaegerTracerProvider(tra Trace) error
- func SpanInfo(fullMethod, peerAddress string) (string, []attribute.KeyValue)
- func StatusCodeAttr(c gcodes.Code) attribute.KeyValue
- type Option
- type Trace
Constants ¶
View Source
const ( // GRPCStatusCodeKey is convention for numeric status code of a gRPC request. GRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") // RPCNameKey is the name of message transmitted or received. RPCNameKey = attribute.Key("name") // RPCMessageTypeKey is the type of message transmitted or received. RPCMessageTypeKey = attribute.Key("message.type") // RPCMessageIDKey is the identifier of message transmitted or received. RPCMessageIDKey = attribute.Key("message.id") // RPCMessageCompressedSizeKey is the compressed size of the message transmitted or received in bytes. RPCMessageCompressedSizeKey = attribute.Key("message.compressed_size") // RPCMessageUncompressedSizeKey is the uncompressed size of the message // transmitted or received in bytes. RPCMessageUncompressedSizeKey = attribute.Key("message.uncompressed_size") )
Variables ¶
View Source
var ( // MessageSent is the type of sent messages. MessageSent = messageType(RPCMessageTypeSent) // MessageReceived is the type of received messages. MessageReceived = messageType(RPCMessageTypeReceived) )
View Source
var ( // RPCSystemGRPC is the semantic convention for gRPC as the remoting system. RPCSystemGRPC = semconv.RPCSystemKey.String("grpc") // RPCNameMessage is the semantic convention for a message named message. RPCNameMessage = RPCNameKey.String("message") // RPCMessageTypeSent is the semantic conventions for sent RPC message types. RPCMessageTypeSent = RPCMessageTypeKey.String("SENT") // RPCMessageTypeReceived is the semantic conventions for the received RPC message types. RPCMessageTypeReceived = RPCMessageTypeKey.String("RECEIVED") )
Functions ¶
func Extract ¶
func Extract(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD) ( baggage.Baggage, trace.SpanContext)
Extract extracts the metadata from ctx.
func Inject ¶
func Inject(ctx context.Context, p propagation.TextMapPropagator, metadata *metadata.MD)
Inject injects the metadata into ctx.
func ParseFullMethod ¶
ParseFullMethod 抄的 就是设置一些属性, 解析一些 Name 方法名 等 returns the method name and attributes.
func PeerFromCtx ¶
PeerFromCtx returns the peer from ctx.
func SetJaegerTracerProvider ¶
SetJaegerTracerProvider 官方栗子里面抄的, 按照 kratos 的改动了一丢丢 设置一个全局的 Jaeger Tracer
Types ¶
Click to show internal directories.
Click to hide internal directories.