Documentation ¶
Overview ¶
Package traces
Package traces ¶
Package traces ¶
Package traces
Index ¶
- Constants
- Variables
- func ClientFilter(opts ...FilterOption) filter.ClientFilter
- func GetTextMapCarriers(md codec.MetaData, msg codec.Msg) propagation.TextMapCarrier
- func Init()
- func ProtoMessageToCustomJSONString(message interface{}) string
- func ProtoMessageToCustomJSONStringWithContext(ctx context.Context, message interface{}) string
- func ProtoMessageToJSONBytes(message interface{}) []byte
- func ProtoMessageToJSONIndentBytes(message interface{}) []byte
- func ProtoMessageToJSONIndentString(message interface{}) string
- func ProtoMessageToJSONString(message interface{}) string
- func ProtoMessageToPBJSONString(message interface{}) string
- func RegisterCarrier(carrier func(md codec.MetaData, msg codec.Msg) propagation.TextMapCarrier)
- func ServerFilter(opts ...FilterOption) filter.ServerFilter
- func SetMaxStringLength(limit int)
- func SetTraceEventMsgMarshaler(f TraceEventMsgMarshalerWithContext)
- type AttributesAfterHandle
- type FilterOption
- type FilterOptions
- type TraceAttributesFunc
- type TraceEventMsgMarshaler
- type TraceEventMsgMarshalerWithContext
Constants ¶
const ( SpanKindClient = "spanKindClient" SpanKindServer = "spanKindServer" )
Variables ¶
Functions ¶
func ClientFilter ¶
func ClientFilter(opts ...FilterOption) filter.ClientFilter
ClientFilter client filter in trpc
func GetTextMapCarriers ¶
func GetTextMapCarriers(md codec.MetaData, msg codec.Msg) propagation.TextMapCarrier
GetTextMapCarriers ...
func ProtoMessageToCustomJSONString ¶
func ProtoMessageToCustomJSONString(message interface{}) string
ProtoMessageToCustomJSONString use json-iterator serialization, convert int64/uint64 to string
func ProtoMessageToCustomJSONStringWithContext ¶
ProtoMessageToCustomJSONStringWithContext use DefaultTraceEventMsgMarshaller
func ProtoMessageToJSONBytes ¶
func ProtoMessageToJSONBytes(message interface{}) []byte
ProtoMessageToJSONBytes .
func ProtoMessageToJSONIndentBytes ¶
func ProtoMessageToJSONIndentBytes(message interface{}) []byte
ProtoMessageToJSONIndentBytes return pretty string bytes for multiple lines with indent
func ProtoMessageToJSONIndentString ¶
func ProtoMessageToJSONIndentString(message interface{}) string
ProtoMessageToJSONIndentString return pretty string for multiple lines
func ProtoMessageToJSONString ¶
func ProtoMessageToJSONString(message interface{}) string
ProtoMessageToJSONString use json-iteration marshaller
func ProtoMessageToPBJSONString ¶
func ProtoMessageToPBJSONString(message interface{}) string
ProtoMessageToPBJSONString use pbjson serialization,convert uint64 to string
func RegisterCarrier ¶
func RegisterCarrier(carrier func(md codec.MetaData, msg codec.Msg) propagation.TextMapCarrier)
RegisterCarrier register otelcarrier
func ServerFilter ¶
func ServerFilter(opts ...FilterOption) filter.ServerFilter
ServerFilter opentelemetry server filter in trpc
func SetMaxStringLength ¶
func SetMaxStringLength(limit int)
SetMaxStringLength sets the maximum length of a string attribute value.
func SetTraceEventMsgMarshaler ¶
func SetTraceEventMsgMarshaler(f TraceEventMsgMarshalerWithContext)
SetTraceEventMsgMarshaler set marshaler for trace event msg
Types ¶
type AttributesAfterHandle ¶
AttributesAfterHandle hook
type FilterOptions ¶
type FilterOptions struct { // TraceLogMode trace log mode TraceLogMode config.LogMode // TraceLogOption trace_log option TraceLogOption config.TraceLogOption // DisableTraceBody disable req/rsp event log DisableTraceBody bool // DisableParentSampling ignore parent sampling DisableParentSampling bool }
FilterOptions FilterOptions
type TraceAttributesFunc ¶
TraceAttributesFunc hook for get trace attribute from ctx and req
type TraceEventMsgMarshaler ¶
type TraceEventMsgMarshaler func(message interface{}) string
TraceEventMsgMarshaler marshaler for trace event msg
var DefaultTraceEventMsgMarshaler TraceEventMsgMarshaler = ProtoMessageToCustomJSONString
DefaultTraceEventMsgMarshaler can be set by user Deprecated: use SetTraceEventMsgMarshaler instead
type TraceEventMsgMarshalerWithContext ¶
TraceEventMsgMarshalerWithContext marshaler for trace event msg with ctx