import "github.com/openfort-xyz/metrics"- func ExposeHTTP() http.Handler
- func GRPCStreamMiddleware(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
- func GRPCUnaryMiddleware(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
- func HTTPMiddleware(next http.Handler) http.Handler
- func JSONRPCMiddleware(next jsonrpc.Handler) jsonrpc.Handler
- func RabbitMQMiddleware(next pubsub.Handler) pubsub.Handler
- type Server
func ExposeHTTP
func ExposeHTTP() http.HandlerExposeHTTP returns a http.Handler that exposes the metrics
func GRPCStreamMiddleware
func GRPCStreamMiddleware(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) errorGRPCStreamMiddleware is a GRPC middleware that records the request count and duration of the request.
func GRPCUnaryMiddleware
func GRPCUnaryMiddleware(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)GRPCUnaryMiddleware is a GRPC middleware that records the request count and duration of the request.
func HTTPMiddleware
func HTTPMiddleware(next http.Handler) http.HandlerHTTPMiddleware is a HTTP middleware that records the request count and duration of the request.
func JSONRPCMiddleware
func JSONRPCMiddleware(next jsonrpc.Handler) jsonrpc.Handlerfunc RabbitMQMiddleware
func RabbitMQMiddleware(next pubsub.Handler) pubsub.HandlerRabbitMQMiddleware is a PubSub middleware that records the request count and duration of the request.
type Server
Server is a metrics server
type Server struct {
// contains filtered or unexported fields
}func NewServer
func NewServer(port int) *ServerNewServer creates a new metrics server
func (*Server) Start
func (s *Server) Start(_ context.Context) errorStart starts the metrics server
func (*Server) Stop
func (s *Server) Stop(ctx context.Context) errorStop stops the metrics server
Generated by gomarkdoc