Documentation ¶
Index ¶
- Constants
- func InstallTraceProvider(settings *proto.CollectorEndpoint, serviceName string)
- func MethodType(t MethodTypeNum) attribute.KeyValue
- func PackToTransientMap(traceCarrier propagation.MapCarrier) (map[string][]byte, error)
- func UnpackTransientMap(transientMap map[string][]byte) (propagation.MapCarrier, error)
- type MethodTypeNum
- type TraceContext
- type TracingHandler
- func (th *TracingHandler) ContextFromStub(stub shim.ChaincodeStubInterface) TraceContext
- func (th *TracingHandler) ExtractContext(carrier propagation.MapCarrier) TraceContext
- func (th *TracingHandler) RemoteCarrier(traceCtx TraceContext) propagation.MapCarrier
- func (th *TracingHandler) StartNewSpan(traceCtx TraceContext, spanName string, opts ...trace.SpanStartOption) (TraceContext, trace.Span)
- func (th *TracingHandler) TracingInit()
- func (th *TracingHandler) TracingIsInit() bool
Constants ¶
View Source
const ( // TracingCollectorEndpointEnv is publicly available to use before calling InstallTraceProvider // to be able to use the correct type of configuration either through environment variables // or chaincode initialization parameters TracingCollectorEndpointEnv = "CHAINCODE_TRACING_COLLECTOR_ENDPOINT" TracingCollectorAuthHeaderKey = "CHAINCODE_TRACING_COLLECTOR_AUTH_HEADER_KEY" TracingCollectorAuthHeaderValue = "CHAINCODE_TRACING_COLLECTOR_AUTH_HEADER_VALUE" TracingCollectorCaPem = "CHAINCODE_TRACING_COLLECTOR_CAPEM" )
Variables ¶
This section is empty.
Functions ¶
func InstallTraceProvider ¶
func InstallTraceProvider( settings *proto.CollectorEndpoint, serviceName string, )
InstallTraceProvider returns trace provider based on http otlp exporter .
func MethodType ¶
func MethodType(t MethodTypeNum) attribute.KeyValue
func PackToTransientMap ¶
func PackToTransientMap(traceCarrier propagation.MapCarrier) (map[string][]byte, error)
PackToTransientMap prepares carrier for using in transient map
func UnpackTransientMap ¶
func UnpackTransientMap(transientMap map[string][]byte) (propagation.MapCarrier, error)
UnpackTransientMap unpacks transient map into carrier
Types ¶
type MethodTypeNum ¶
type MethodTypeNum int
const ( MethodUnknown MethodTypeNum = iota MethodQuery MethodTx MethodNbTx )
func (MethodTypeNum) String ¶
func (t MethodTypeNum) String() string
type TraceContext ¶
type TraceContext struct {
// contains filtered or unexported fields
}
type TracingHandler ¶
type TracingHandler struct { Tracer trace.Tracer Propagators propagation.TextMapPropagator // contains filtered or unexported fields }
func (*TracingHandler) ContextFromStub ¶
func (th *TracingHandler) ContextFromStub(stub shim.ChaincodeStubInterface) TraceContext
func (*TracingHandler) ExtractContext ¶
func (th *TracingHandler) ExtractContext(carrier propagation.MapCarrier) TraceContext
func (*TracingHandler) RemoteCarrier ¶
func (th *TracingHandler) RemoteCarrier(traceCtx TraceContext) propagation.MapCarrier
func (*TracingHandler) StartNewSpan ¶
func (th *TracingHandler) StartNewSpan(traceCtx TraceContext, spanName string, opts ...trace.SpanStartOption) (TraceContext, trace.Span)
StartNewSpan starts new span
func (*TracingHandler) TracingInit ¶
func (th *TracingHandler) TracingInit()
TracingInit sets tracing telemetry init param as true
func (*TracingHandler) TracingIsInit ¶
func (th *TracingHandler) TracingIsInit() bool
TracingIsInit checks if telemetry was initialized
Click to show internal directories.
Click to hide internal directories.