rpc

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRpcMetrics added in v0.7.0

func InitRpcMetrics(m metric.Meter)

InitRpcMetrics so we need to make sure the otel_setup is executed before all the init() function related to issue rpcs://github.com/alibaba/opentelemetry-go-auto-instrumentation/issues/48

Types

type ClientRpcAttrsExtractor

type ClientRpcAttrsExtractor[REQUEST any, RESPONSE any, GETTER RpcAttrsGetter[REQUEST]] struct {
	Base RpcAttrsExtractor[REQUEST, RESPONSE, GETTER]
}

func (*ClientRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) GetSpanKey

func (s *ClientRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) GetSpanKey() attribute.Key

func (*ClientRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnEnd

func (s *ClientRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnEnd(attributes []attribute.KeyValue, context context.Context, request REQUEST, response RESPONSE, err error) ([]attribute.KeyValue, context.Context)

func (*ClientRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnStart

func (s *ClientRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnStart(attributes []attribute.KeyValue, parentContext context.Context, request REQUEST) ([]attribute.KeyValue, context.Context)

type RpcAttrsExtractor

type RpcAttrsExtractor[REQUEST any, RESPONSE any, GETTER RpcAttrsGetter[REQUEST]] struct {
	Getter GETTER
}

func (*RpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnEnd

func (r *RpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnEnd(attributes []attribute.KeyValue, context context.Context, request REQUEST, response RESPONSE, err error) ([]attribute.KeyValue, context.Context)

func (*RpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnStart

func (r *RpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnStart(attributes []attribute.KeyValue, parentContext context.Context, request REQUEST) ([]attribute.KeyValue, context.Context)

type RpcAttrsGetter

type RpcAttrsGetter[REQUEST any] interface {
	GetSystem(request REQUEST) string
	GetService(request REQUEST) string
	GetMethod(request REQUEST) string
	GetServerAddress(request REQUEST) string
}

type RpcClientMetric added in v0.7.0

type RpcClientMetric struct {
	// contains filtered or unexported fields
}

func RpcClientMetrics added in v0.7.0

func RpcClientMetrics(key string) *RpcClientMetric

func (*RpcClientMetric) OnAfterEnd added in v0.7.0

func (h *RpcClientMetric) OnAfterEnd(context context.Context, endAttributes []attribute.KeyValue, endTime time.Time)

func (*RpcClientMetric) OnAfterStart added in v0.7.0

func (h *RpcClientMetric) OnAfterStart(context context.Context, endTime time.Time)

func (*RpcClientMetric) OnBeforeEnd added in v0.7.0

func (h *RpcClientMetric) OnBeforeEnd(ctx context.Context, startAttributes []attribute.KeyValue, startTime time.Time) context.Context

func (*RpcClientMetric) OnBeforeStart added in v0.7.0

func (h *RpcClientMetric) OnBeforeStart(parentContext context.Context, startTime time.Time) context.Context

type RpcServerMetric added in v0.7.0

type RpcServerMetric struct {
	// contains filtered or unexported fields
}

func RpcServerMetrics added in v0.7.0

func RpcServerMetrics(key string) *RpcServerMetric

func (*RpcServerMetric) OnAfterEnd added in v0.7.0

func (h *RpcServerMetric) OnAfterEnd(context context.Context, endAttributes []attribute.KeyValue, endTime time.Time)

func (*RpcServerMetric) OnAfterStart added in v0.7.0

func (h *RpcServerMetric) OnAfterStart(context context.Context, endTime time.Time)

func (*RpcServerMetric) OnBeforeEnd added in v0.7.0

func (h *RpcServerMetric) OnBeforeEnd(ctx context.Context, startAttributes []attribute.KeyValue, startTime time.Time) context.Context

func (*RpcServerMetric) OnBeforeStart added in v0.7.0

func (h *RpcServerMetric) OnBeforeStart(parentContext context.Context, startTime time.Time) context.Context

type RpcSpanNameExtractor

type RpcSpanNameExtractor[REQUEST any] struct {
	Getter RpcAttrsGetter[REQUEST]
}

func (*RpcSpanNameExtractor[REQUEST]) Extract

func (r *RpcSpanNameExtractor[REQUEST]) Extract(request REQUEST) string

type ServerRpcAttrsExtractor

type ServerRpcAttrsExtractor[REQUEST any, RESPONSE any, GETTER RpcAttrsGetter[REQUEST]] struct {
	Base RpcAttrsExtractor[REQUEST, RESPONSE, GETTER]
}

func (*ServerRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) GetSpanKey

func (s *ServerRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) GetSpanKey() attribute.Key

func (*ServerRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnEnd

func (s *ServerRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnEnd(attributes []attribute.KeyValue, context context.Context, request REQUEST, response RESPONSE, err error) ([]attribute.KeyValue, context.Context)

func (*ServerRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnStart

func (s *ServerRpcAttrsExtractor[REQUEST, RESPONSE, GETTER]) OnStart(attributes []attribute.KeyValue, parentContext context.Context, request REQUEST) ([]attribute.KeyValue, context.Context)

Jump to

Keyboard shortcuts

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