metrics

package
v0.2.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Success = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "request_success_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	InternalError = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "request_error_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	BadRequestError = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "request_bad_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	ConflictRequestError = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "request_conflict_ops_total",
		Help: "Total execution",
	}, []string{"method"})

	NotFoundRequestError = promauto.NewCounterVec(prometheus.CounterOpts{
		Name: "request_notfound_ops_total",
		Help: "Total execution",
	}, []string{"method"})
)

Functions

func GRPCMetricsAndLogMiddleware

func GRPCMetricsAndLogMiddleware(logger *zerolog.Logger) grpc.UnaryServerInterceptor

GRPCMetricsAndLogMiddleware tracks error and success prom metrics for grpc, and also logs if there is an error

func HTTPMetricsMiddleware

func HTTPMetricsMiddleware(c *fiber.Ctx) error

Types

This section is empty.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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