Documentation
¶
Index ¶
- func NewPrometheus(opts ...Option) middleware.Middleware
- type Option
- type Options
- type Prometheus
- func (p *Prometheus) StreamClient(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (cs grpc.ClientStream, err error)
- func (p *Prometheus) StreamHandler(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) (err error)
- func (p *Prometheus) UnaryClient(ctx context.Context, method string, req, reply interface{}, ...) (err error)
- func (p *Prometheus) UnaryHandler(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPrometheus ¶
func NewPrometheus(opts ...Option) middleware.Middleware
Types ¶
type Option ¶
type Option func(*Options)
Option 实例值设置
func FilterOutFunc ¶
func FilterOutFunc(filterOutFunc middleware.FilterFunc) Option
FilterOutFunc 设置中间件忽略函数列表
type Options ¶
type Options struct { Enable bool // 是否启用监控 FilterOutFunc middleware.FilterFunc }
Options 注册相关参数
type Prometheus ¶
type Prometheus struct {
Options *Options
}
Prometheus 普罗米修斯指标监控中间件
func (*Prometheus) StreamClient ¶
func (p *Prometheus) StreamClient(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (cs grpc.ClientStream, err error)
StreamClient 流式服客户中间件 grpc.StreamClientInterceptor
func (*Prometheus) StreamHandler ¶
func (p *Prometheus) StreamHandler(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) (err error)
StreamHandler 流式中间件
func (*Prometheus) UnaryClient ¶
func (p *Prometheus) UnaryClient(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) (err error)
UnaryClient 非流式客户端中间件 grpc.UnaryClientInterceptor
func (*Prometheus) UnaryHandler ¶
func (p *Prometheus) UnaryHandler(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
UnaryHandler 非流式中间件
Click to show internal directories.
Click to hide internal directories.