telemetry

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

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

Jump to

Keyboard shortcuts

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