usagemetrics

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithHandle

func ContextWithHandle(ctx context.Context) context.Context

ContextWithHandle creates a new context with a location to store metadata returned from a dispatched request.

This should only be called in middleware or testing functions.

func FromContext

func FromContext(ctx context.Context) *dispatch.ResponseMeta

FromContext returns any metadata that was stored in the context.

This is useful for testing that a handler is properly setting the context.

func SetInContext

func SetInContext(ctx context.Context, metadata *dispatch.ResponseMeta)

SetInContext should be called in a gRPC handler to correctly set the response metadata for the dispatched request.

func StreamServerInterceptor

func StreamServerInterceptor() grpc.StreamServerInterceptor

StreamServerInterceptor implements a gRPC Middleware for reporting usage metrics in both the trailer of the request, as well as to the registered prometheus metrics

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.UnaryServerInterceptor

UnaryServerInterceptor implements a gRPC Middleware for reporting usage metrics in both the trailer of the request, as well as to the registered prometheus metrics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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