prometheus

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unary        grpcType = "unary"
	ClientStream grpcType = "client_stream"
	ServerStream grpcType = "server_stream"
	BidiStream   grpcType = "bidi_stream"
)

Variables

This section is empty.

Functions

func SplitMethodName

func SplitMethodName(fullMethodName string) (string, string)

Types

type Middleware

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

func New

func New(opts Options) *Middleware

New returns a Middleware instance

func (*Middleware) StreamServerInterceptor

func (m *Middleware) StreamServerInterceptor() grpc.StreamServerInterceptor

StreamServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Streaming RPCs.

func (*Middleware) UnaryServerInterceptor

func (m *Middleware) UnaryServerInterceptor() grpc.UnaryServerInterceptor

UnaryServerInterceptor is a gRPC server-side interceptor that provides Prometheus monitoring for Unary RPCs.

type Options

type Options struct {
	ServiceName string
	Registerer  prometheus.Registerer
	ErrorToCode func(err error) codes.Code
}

Jump to

Keyboard shortcuts

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