otelgrpc

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractAddress

func ExtractAddress(addr string) (host, port string)

func GetProtoSize

func GetProtoSize(p any) int

func ParseFullMethod

func ParseFullMethod(fullMethod string) []attribute.KeyValue

Types

type Meter

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

func NewMeter

func NewMeter(hostName string, opts ...Option) Meter

func (*Meter) GetAttributes

func (m *Meter) GetAttributes() []attribute.KeyValue

func (*Meter) RecordStream

func (m *Meter) RecordStream(ctx context.Context, start time.Time, method string, err error)

func (*Meter) RecordUnary

func (m *Meter) RecordUnary(ctx context.Context, p UnaryParams)

func (*Meter) StreamClientInterceptor

func (m *Meter) StreamClientInterceptor() grpc.StreamClientInterceptor

func (*Meter) UnaryClientInterceptor

func (m *Meter) UnaryClientInterceptor() grpc.UnaryClientInterceptor

type MeterOpts

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

type Option

type Option func(*MeterOpts)

func WithMeterName

func WithMeterName(meterName string) Option

type UnaryParams

type UnaryParams struct {
	Start  time.Time
	Method string
	Req    any
	Res    any
	Err    error
}

Jump to

Keyboard shortcuts

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