grpcutil

package
v0.2.10-1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithStats added in v0.1.26

func ContextWithStats(ctx context.Context, stats *GRPCStats) context.Context

ContextWithStats Returns a new `context.Context` that holds a reference to `GRPCStats`.

func EnableAdmin added in v0.1.26

func EnableAdmin(s grpc.ServiceRegistrar) (cleanup func(), _ error)

func EnableDebug

func EnableDebug(s *grpc.Server)

func EnableHealth

func EnableHealth(srv string, s *grpc.Server)

func EnableReflection

func EnableReflection(s *grpc.Server)

func HeaderGet added in v0.2.1

func HeaderGet(h Header, name string) string

func IsGRPCRequest added in v0.1.26

func IsGRPCRequest(r *http.Request) bool

IsGRPCRequest returns true if the message is considered to be a GRPC message

Types

type GRPCStats added in v0.1.26

type GRPCStats struct {
	Duration clock.Duration
	Method   string
	Failed   float64
	Success  float64
}

func StatsFromContext added in v0.1.26

func StatsFromContext(ctx context.Context) *GRPCStats

StatsFromContext Returns the `GRPCStats` previously associated with `ctx`.

type GRPCStatsHandler added in v0.1.26

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

GRPCStatsHandler Implements the Prometheus collector interface. Such that when the /metrics handler is called this collector pulls all the stats from

func NewGRPCStatsHandler added in v0.1.26

func NewGRPCStatsHandler() *GRPCStatsHandler

func (*GRPCStatsHandler) Close added in v0.1.26

func (c *GRPCStatsHandler) Close()

func (*GRPCStatsHandler) Collect added in v0.1.26

func (c *GRPCStatsHandler) Collect(ch chan<- prometheus.Metric)

func (*GRPCStatsHandler) Describe added in v0.1.26

func (c *GRPCStatsHandler) Describe(ch chan<- *prometheus.Desc)

func (*GRPCStatsHandler) HandleConn added in v0.1.26

func (c *GRPCStatsHandler) HandleConn(ctx context.Context, s stats.ConnStats)

func (*GRPCStatsHandler) HandleRPC added in v0.1.26

func (c *GRPCStatsHandler) HandleRPC(ctx context.Context, s stats.RPCStats)

func (*GRPCStatsHandler) TagConn added in v0.1.26

func (*GRPCStatsHandler) TagRPC added in v0.1.26

func (c *GRPCStatsHandler) TagRPC(ctx context.Context, tagInfo *stats.RPCTagInfo) context.Context
type Header = metadata.MD

Jump to

Keyboard shortcuts

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